The above two lines should be replaced with vmxml = vm_xml.VMXML.new_from_inactive_dumpxml(vm_name)