+def start_guest_get_ref(ip, guest_name, virt='Xen'):
+ virt_xml = vxml.get_class(virt)
+ cxml = virt_xml(guest_name)
+ ret = cxml.create(ip)
+ if not ret:
+ logger.error("Error create domain %s" % guest_name)
+ return FAIL
- ret = start_test_domain(guest_name, ip)
- if not ret:
- return FAIL, None
-
- time.sleep(10)
- except Exception:
- logger.error("Error creating domain %s" % guest_name)
- return FAIL, None
-
+ time.sleep(10)
I know this was existing code, but can you change this to
poll_for_state_change() to check to see if the guest is running before
moving on.
classname = 'Xen_ComputerSystem'
cs_ref = CIMInstanceName(classname, keybindings = {
'Name':guest_name,
@@ -85,9 +78,9 @@
else:
local_migrate = 0
- status, cs_ref = start_guest_get_ref(options.ip, dom_name)
+ status, cs_ref = start_guest_get_ref(options.ip, dom_name, options.virt)
if status != PASS:
- destroy_and_undefine_domain(guest_name, options.ip)
+ destroy_and_undefine_domain(dom_name, options.ip)
Can you change the destroy_and_undefine_domain() calls to .destroy() and
.undefine() calls?
Thanks!
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com