← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1447977] Re: swap size not change after instance resized

 

** Changed in: nova
       Status: Triaged => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1447977

Title:
  swap size not change after instance resized

Status in OpenStack Compute (Nova):
  Invalid

Bug description:
  1. My environment:
  nova: 2014.1, icehouse-stable
  hypervisor: libvirt 1.2.1,  + kvm

  2. Relevant log files:
  no

  3. Reproduce steps:
  * Launch one instance with default flavor m1.tiny which swap size is 0MB
  * Resize instance from m1.tiny to flv_5_root_2_eph_1_swap which swap's size is 1MB,
  and get swap info with 'virsh' commands
  virsh # domblklist 30
  vdc        /var/lib/nova/instances/fa13d27f-3ddd-48a5-86a8-aeaf04c2046d/disk.swap
  virsh # domblkinfo 30 vdc
  Capacity:       1048576
  * Resize instance from flv_5_root_2_eph_1_swap to flv_40_root_5_eph_4_swap,
  and get swap info with 'virsh' commands

  Expected results:
  *virsh # domblkinfo 5 vdc
    Capacity:       4194304

  Actual result:
  * virsh # domblkinfo 5 vdc
  Capacity:       1048576

  4. Reason maybe:
  nova.virt.libvirt.driver.py
  def _create_image(self, context, instance,
                        disk_mapping, suffix='',
                        disk_images=None, network_info=None,
                        block_device_info=None, files=None,
                        admin_pass=None, inject_files=True,
                        fallback_from_host=None):
  ...
          if 'disk.swap' in disk_mapping:
              mapping = disk_mapping['disk.swap']
              swap_mb = 0

              swap = driver.block_device_info_get_swap(block_device_info)
              if driver.swap_is_usable(swap):
                  swap_mb = swap['swap_size']   # use inst_type['swap']?
              elif (inst_type['swap'] > 0 and
                    not block_device.volume_in_mapping(
                      mapping['dev'], block_device_info)):
                  swap_mb = inst_type['swap']

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1447977/+subscriptions


References