resize instance to smaller flavor
Hello,
I'm thinking about resizing instance flavor to smaller so i made these steps:
- Created instance 'test' with 20GB disk
- Created snapshot of this instance
- Downloaded snapshot to local disk
- Mounted it as loop device
- shrinked filesystem
- shrinked partition
- used qemu-img resize to shrink disk
- uploaded file as image(now everything looks ok, disk size&partition size are smaller than original)
- rebuilt instance using new image
and now there is a problem, when i rebuild actual instance with new, smaller image it have 20GB disk again(but partition is smaller). So I still can't change flavor to smaller because I'll see error saying that image size is bigger than new flavor.
Maybe someone know any workaround for shrinking instance size? I would be very grateful for any help.
This is confusing. How large is the disk (use
qemu-img info
)? How large is the image (openstack image show
)? Are you sure the partition table reflects the correct sizes? Where do you see the size of 20GB?Did you use the same flavor as before? Sounds like you changed the image but not the flavor.