mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix a bug when creating a new VM and changing the network info
- This commit fixes a small bug where the network adapter won't be connected at startup of the VM and therefore can never be contacted by the salt master, the fix is to just simply apply the same config changes once the clone is completed
This commit is contained in:
parent
c725854596
commit
7834aeda7d
1 changed files with 5 additions and 0 deletions
|
@ -2422,6 +2422,11 @@ def create(vm_):
|
|||
|
||||
new_vm_ref = salt.utils.vmware.get_mor_by_property(_get_si(), vim.VirtualMachine, vm_name, container_ref=container_ref)
|
||||
|
||||
# Re-configure to make sure all info is correct, without this new network settings specifically
|
||||
# ip settings and connect on startup may not apply
|
||||
task = new_vm_ref.ReconfigVM_Task(spec=config_spec)
|
||||
salt.utils.vmware.wait_for_task(task, vm_name, 'reconfig', 5, 'info')
|
||||
|
||||
# Find how to power on in CreateVM_Task (if possible), for now this will do
|
||||
if not clone_type and power:
|
||||
task = new_vm_ref.PowerOn()
|
||||
|
|
Loading…
Add table
Reference in a new issue