for machine in conn.list():
(truncated)
# Force the machine off, as MAAS will control the machine
# and it needs to be in a known state of off.
if state == VirshVMState.ON: conn.poweroff(machine)
(truncated)
system_id = create_node(
macs, arch, 'virsh', params, domain, machine).wait(30)
Looks like this is done intentionally in the code. I would suggest that it only powers it off if create_node succeeds.
src/provisionin gserver/ drivers/ hardware/ virsh.py# probe_virsh_ and_enlist
for machine in conn.list():
conn.poweroff( machine)
(truncated)
# Force the machine off, as MAAS will control the machine
# and it needs to be in a known state of off.
if state == VirshVMState.ON:
(truncated)
system_id = create_node(
macs, arch, 'virsh', params, domain, machine).wait(30)