Comment 2 for bug 1244222

Revision history for this message
Thang Pham (thang-pham) wrote :

There are a few ways to extend the swap partition:
1. Create a new swap partition
2. Create a new swap file
3. Extend swap on an existing LVM2 logical volume

When you resize an instance, it is powered off and the root and ephemeral disks are resized (not swap). You can only add more space to the swap partition using one of the methods above, but not resize one that already exists. Hence, nova does not attempt to resize swap (i.e. disk.swap).

It can be easily fixed by deleting the disk.swap in driver.finish_migration and allowing nova to re-create disk.swap in driver._create_image. This seems valid because when an OS is shut down, the contents of the swap space are just garbage, the OS doesn't bother about what is in it.