mirror of
https://github.com/AlchemillaHQ/Sylve.git
synced 2026-06-14 00:46:34 +03:00
vm: networks: enable on create
This commit is contained in:
@@ -290,6 +290,7 @@ func (s *Service) NetworkAttach(req libvirtServiceInterfaces.NetworkAttachReques
|
||||
SwitchType: swType,
|
||||
MacID: &macObjId,
|
||||
Emulation: req.Emulation,
|
||||
Enable: true,
|
||||
}
|
||||
|
||||
if err := s.DB.Create(&network).Error; err != nil {
|
||||
|
||||
@@ -1003,6 +1003,7 @@ func (s *Service) createVMFromTemplateTarget(
|
||||
SwitchID: switchID,
|
||||
SwitchType: strings.ToLower(strings.TrimSpace(network.SwitchType)),
|
||||
Emulation: network.Emulation,
|
||||
Enable: true,
|
||||
}
|
||||
if err := tx.Create(&createdNetwork).Error; err != nil {
|
||||
return fmt.Errorf("failed_to_create_vm_network_from_template: %w", err)
|
||||
|
||||
@@ -1058,6 +1058,7 @@ func (s *Service) CreateVM(data libvirtServiceInterfaces.CreateVMRequest, ctx co
|
||||
SwitchID: switchId,
|
||||
SwitchType: swType,
|
||||
Emulation: data.SwitchEmulationType,
|
||||
Enable: true,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user