swap size not change after instance resized
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Low
|
Noel Nelson Dsouza |
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_
and get swap info with 'virsh' commands
virsh # domblklist 30
vdc /var/lib/
virsh # domblkinfo 30 vdc
Capacity: 1048576
* Resize instance from flv_5_root_
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.
def _create_image(self, context, instance,
...
if 'disk.swap' in disk_mapping:
mapping = disk_mapping[
swap_mb = 0
swap = driver.
if driver.
elif (inst_type['swap'] > 0 and
Changed in nova: | |
assignee: | nobody → Noel Nelson Dsouza (noelnelson) |
tags: | added: libvirt |
Changed in nova: | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in nova: | |
status: | Triaged → Invalid |
Eric Xie_TECS,
I am not able to reproduce your bug. ( As i know you are using Ice-house version)
My Environment
I am using Juno version of devstack.
Steps I used to reproduce the bug.
a) Creating instance with flavor : m1.tiny 0.3.4-x86_ 64-uec --flavor 1 vm1
nova boot --image cirros-
b) Creating new flavor with id 8 and swap size is 1MB 2_eph_1_ swap 8 1024 4 2
nova flavor-create --ephemeral 1 --swap 1 --rxtx-factor 1.0 --is-public True flv_5_root_
c) Resizing instance vm1 with flavor 8
nova resize --poll vm1 8
Output of Virsh command for the instance vm1.
virsh # domblklist 3 ------- ------- ------- ------- ------- ------ data/nova/ instances/ fc40d5ca- 3a23-417c- 9dfc-f258608225 34/disk data/nova/ instances/ fc40d5ca- 3a23-417c- 9dfc-f258608225 34/disk. local data/nova/ instances/ fc40d5ca- 3a23-417c- 9dfc-f258608225 34/disk. swap data/nova/ instances/ fc40d5ca- 3a23-417c- 9dfc-f258608225 34/disk. config
Target Source
-------
vda /opt/stack/
vdb /opt/stack/
vdc /opt/stack/
hdd /opt/stack/
virsh # domblkinfo 3 vdc
Capacity: 1048576
Allocation: 200704
Physical: 200704
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- --
Follow the above same steps with instance vm2.
a) Creating instance with flavor : m1.tiny 0.3.4-x86_ 64-uec --flavor 1 vm2
nova boot --image cirros-
b) Creating new flavor with id 40 and swap size is 4MB root_2_ eph_4_swap 40 512 4 2
nova flavor-create --ephemeral 1 --swap 4 --rxtx-factor 1.0 --is-public True flv_40_
c) Resizing instance vm1 with flavor 8
nova resize --poll vm2 40
Output of Virsh command for the instance vm2.
virsh # domblklist 5 ------- ------- ------- ------- ------- ------ data/nova/ instances/ 5d515c7a- cc80-46ed- b883-31919a0ace ff/disk data/nova/ instances/ 5d515c7a- cc80-46ed- b883-31919a0ace ff/disk. local data/nova/ instances/ 5d515c7a- cc80-46ed- b883-31919a0ace ff/disk. swap data/nova/ instances/ 5d515c7a- cc80-46ed- b883-31919a0ace ff/disk. config
Target Source
-------
vda /opt/stack/
vdb /opt/stack/
vdc /opt/stack/
hdd /opt/stack/
virsh # domblkinfo 5 vdc
Capacity: 4194304
Allocation: 200704
Physical: 200704
Nova list output:
stack@onecloud- Standard- PC-i440FX- PIIX-1996: ~/devstack$ nova list ------- ------- ------- ------- ----+-- ----+-- ------- ------+ ------- -----+- ------- -----+- ------- ------- ---+ ------- ------- ------- ------- ----+-- ----+-- ------- ------+ ------- -----+- ------- -----+- ------- ------- ---+ 3a23-417c- 9dfc-f258608225 34 | vm1 | VERIFY_RESIZE | - | Running | private=10.0.0.2 | cc80-46ed- b883-31919a0ace ff | vm2 | VERIFY_RESIZE | - | Running | private=10.0.0.3 | ------- ------- ------- ------- ----+-- ----+-- ------- ------+ ------- -----+- ------- -----+- ------- ------- ---+
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| fc40d5ca-
| 5d515c7a-
+------
Tried on resized instance twice time to resize. ( vm1 resized already)
After that i used below statement again
Resize instance from flv_8_root_ 2_eph_1_ swap to flv_40_ root_5_ eph_4_swap
stack@onecloud- Standard- PC-i440F. ..