yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #17619
[Bug 1334024] Re: Nova rescue fails for libvirt driver with config drive
** Changed in: nova
Status: Fix Committed => Fix Released
** Changed in: nova
Milestone: None => juno-2
--
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/1334024
Title:
Nova rescue fails for libvirt driver with config drive
Status in OpenStack Compute (Nova):
Fix Released
Bug description:
I am using config drive to boot VMs. In icehouse, I observed that nova
rescue fails and leaves the VM in SHUTOFF state.
Short error log:
instances/270e299b-90b2-46d5-bf9a-e7f6efe3742e/disk.config.rescue': No such file or directory
Difference in Havana and Icehouse code path:
# Havana
# Config drive
if configdrive.required_by(instance):
LOG.info(_('Using config drive'), instance=instance)
extra_md = {}
if admin_pass:
extra_md['admin_pass'] = admin_pass
for f in ('user_name', 'project_name'):
if hasattr(context, f):
extra_md[f] = getattr(context, f, None)
inst_md = instance_metadata.InstanceMetadata(instance,
content=files, extra_md=extra_md, network_info=network_info)
with configdrive.ConfigDriveBuilder(instance_md=inst_md) as cdb:
configdrive_path = basepath(fname='disk.config')
LOG.info(_('Creating config drive at %(path)s'),
{'path': configdrive_path}, instance=instance)
def basepath(fname='', suffix=suffix): << Adds suffix .rescue to disk.config.
return os.path.join(libvirt_utils.get_instance_path(instance),
fname + suffix)
# Icehouse:
# Config drive
if configdrive.required_by(instance):
LOG.info(_('Using config drive'), instance=instance)
extra_md = {}
if admin_pass:
extra_md['admin_pass'] = admin_pass
for f in ('user_name', 'project_name'):
if hasattr(context, f):
extra_md[f] = getattr(context, f, None)
inst_md = instance_metadata.InstanceMetadata(instance,
content=files, extra_md=extra_md, network_info=network_info)
with configdrive.ConfigDriveBuilder(instance_md=inst_md) as cdb:
configdrive_path = self._get_disk_config_path(instance)
LOG.info(_('Creating config drive at %(path)s'),
{'path': configdrive_path}, instance=instance)
@staticmethod
def _get_disk_config_path(instance):
return os.path.join(libvirt_utils.get_instance_path(instance),
'disk.config')
The suffix .rescue is missed here and hence, original disk.config is
overwritten.
Following change fixed the issue for me:
configdrive_path = self._get_disk_config_path(instance, suffix)
@staticmethod
def _get_disk_config_path(instance, suffix=''):
return os.path.join(libvirt_utils.get_instance_path(instance),
'disk.config' + suffix)
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1334024/+subscriptions
References