Comment 2 for bug 1549194

Revision history for this message
byhan (2005hanbaoying) wrote : Re: resize a instance,then revert the resize,excute cold migrate,error

before cold migrate,you should resize the instance and then revert the resize

besides,the instance must be launched by image. using ceph

I have read the source ,find bug in here:
after resize, we will enlarge the size of image_cache
code path:D:\nova\nova\virt\libvirt\imagebackend.py

def create_image(self, prepare_template, base, size, *args, **kwargs):

        if not self.check_image_exists():
            prepare_template(target=base, max_size=size, *args, **kwargs)

        # prepare_template() may have cloned the image into a new rbd
        # image already instead of downloading it locally
        if not self.check_image_exists():
            self.driver.import_image(base, self.rbd_name)
        self.verify_base_size(base, size)

        if size and size > self.get_disk_size(self.rbd_name):
            self.driver.resize(self.rbd_name, size)

revert the resize ,the size of this image_cache did not become small
but the flavor become the smaller one

 means that:
 when cold migrate the instance, as we know running the same code as resize in openstack.
we will found flavor size is smaller than image_cache

verify_base_size throw exception