yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #48790
[Bug 1558877] Re: libvirt.xml not change back after doing rescue and unrescue
Reviewed: https://review.openstack.org/294366
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2e39d6444aa4c231da96b4d6314519578dd3dbf2
Submitter: Jenkins
Branch: master
commit 2e39d6444aa4c231da96b4d6314519578dd3dbf2
Author: Leehom Li <feli5@xxxxxxxxx>
Date: Thu Mar 17 22:26:25 2016 -0400
Change "libvirt.xml" back to the original after doing unrescue
After doing rescue and unrescue "libvirt.xml" is not changed
back to the original.
This patch write back "libvirt.xml" using xml info stored
in "unrescue.xml"
Change-Id: I524ff57d7f21a1b5ecd20ab9b0e377ad9f7e04b9
Closes-Bug: #1558877
** Changed in: nova
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1558877
Title:
libvirt.xml not change back after doing rescue and unrescue
Status in OpenStack Compute (nova):
Fix Released
Bug description:
When doing rescue, instance's xml info will be flush into
"unrescue.xml", and then rescue instance's xml info will be write into
"libvirt.xml"
def rescue(self, context, instance, network_info, image_meta,
rescue_password):
unrescue_xml = self._get_existing_domain_xml(instance, network_info)
unrescue_xml_path = os.path.join(instance_dir, 'unrescue.xml')
libvirt_utils.write_to_file(unrescue_xml_path, unrescue_xml)
...
xml = self._get_guest_xml(context, instance, network_info, disk_info,
image_meta, rescue=rescue_images,
write_to_disk=True)
And when doing unrescue, nova will use xml info in "unrescue.xml" to restore domain, and then delete "unrescue.xml".
Though instance's domain info in memory is correct, xml info in "libvir.xml" is still rescue instance's.
And this should be fixed.
def unrescue(self, instance, network_info):
"""Reboot the VM which is being rescued back into primary images.
"""
instance_dir = libvirt_utils.get_instance_path(instance)
unrescue_xml_path = os.path.join(instance_dir, 'unrescue.xml')
xml = libvirt_utils.load_file(unrescue_xml_path)
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1558877/+subscriptions
References