Instance's XXX_resize dir never be deleted if we resize a pre-grizzly instance in havana
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
wangpan | ||
Icehouse |
Fix Released
|
Undecided
|
wangpan |
Bug Description
reproduce steps:
1. create an instance under Folsom
2. update nova to Havana
3. resize the instance to another host
4. confirm the resize
5. examine the instance dir on source host
you will find the instance-
the reason is that:
in the _cleanup_resize in libvirt driver:
def _cleanup_
target = libvirt_
we get the instance path by using get_instance_path method in libvirt utils,
but we check the original instance dir of pre-grizzly instances' before we return it,
if this instance is a resized one which original instance dir exists on another host(the dest host),
the wrong instance path with uuid will be returned, and then the `target` existing check will be failed,
then the instance-
def get_instance_
"""Determine the correct path for instance storage.
This method determines the directory name for instance storage, while
handling the fact that we changed the naming style to something more
unique in the grizzly release.
:param instance: the instance we want a path for
:param forceold: force the use of the pre-grizzly format
:param relative: if True, just the relative path is returned
:returns: a path to store information about that instance
"""
pre_
if forceold or os.path.
if relative:
return instance['name']
return pre_grizzly_name
if relative:
return instance['uuid']
return os.path.
summary: |
Instance's XXX_resize dir never be deleted if we resize a pre-grizzly - instance + instance in havana |
Changed in nova: | |
milestone: | none → juno-2 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | juno-2 → 2014.2 |
This is a terrible bug because if we resize this instance several times between two hosts, the qcow2 converted operation will not be implemented, and the remote disk copied by ssh/rsync is a qcow2 with backing file one.
you can think that:
1. hostA has an instance-a_resize dir(which is the residual dir after the first resize)
2. hostA also has instance-a dir, the running instance's dir, and the disk file is a whole qcow2 one without backing file
3. if we resize instance-a to hostB, we firstly mv instance-a to instance-a_resize, but if the instance-a_resize dir is exists there, we just mv instance-a to it(under the instance-a_resize we have an instance-a dir now), then the instance's dir is wrong
4. nova believe the instance-a's disk is whole qcow2 file without backing file(checking this before we mv the instance dir), so nova copy a wrong disk with backing file(the wrong residual disk file), and then the instance will become ERROR if the backing file is not exist on the dest hostB.