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
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: \nova\nova\ virt\libvirt\ imagebackend. py
after resize, we will enlarge the size of image_cache
code path:D:
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_exists( ):
self. driver. import_ image(base, self.rbd_name)
self.verify_ base_size( base, size)
# image already instead of downloading it locally
if not self.check_
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