VMware: Sparse glance vmdk's size property is mistaken for capacity
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Radoslav Gerganov | ||
Kilo |
Fix Released
|
Undecided
|
Unassigned | ||
Liberty |
Fix Released
|
Medium
|
Sven Anderson | ||
VMwareAPI-Team |
Confirmed
|
High
|
Arnaud Legendre |
Bug Description
Scenario:
a sparse vmdk whose file size is 800MB and whose capacity is 4GB is uploaded to glance without specifying the size property.
(glance uses the file's size for the size property in this case)
nova boot with flavor tiny (root disk size of 1GB) said image.
Result:
The vmwareapi driver fails to spawn the VM because the ESX server throws a fault when asked to 'grow' the disk from 4GB to 1GB (driver thinks it is attempt to grow from 800MB to 1GB)
Relevant hostd.log on ESX host:
2013-10-
opID=HB-
evaluation detected for "VMware ESX Server 5.0" (lastError=2,
desc.IsValid:Yes)
2013-10-
opID=a3057d82-8e] Task Created :
haTask-
2013-10-
New capacity (2097152) is not greater than original capacity (8388608).
I am still not exactly sure if this is consider user error on glance import, a glance shortcoming of not introspecting the vmdk, or a bug in the compute driver. Regardless, this bug is to track any potential defensive code we can add to the driver to better handle this scenario.
Changed in nova: | |
status: | New → Confirmed |
tags: | added: havana-backport-potential |
Changed in nova: | |
assignee: | Vui Lam (vui) → Arnaud Legendre (arnaudleg) |
Changed in openstack-vmwareapi-team: | |
assignee: | nobody → Arnaud Legendre (arnaudleg) |
tags: | added: icehouse-rd-potential |
tags: |
added: icehouse-rc-potential removed: icehouse-rd-potential |
tags: |
added: icehouse-rc1-potential removed: icehouse-rc-potential |
tags: | removed: icehouse-rc1-potential |
Changed in nova: | |
importance: | High → Medium |
Changed in nova: | |
assignee: | Radoslav Gerganov (rgerganov) → Qin Zhao (zhaoqin) |
Changed in nova: | |
assignee: | Qin Zhao (zhaoqin) → Radoslav Gerganov (rgerganov) |
Changed in nova: | |
milestone: | none → liberty-3 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | liberty-3 → 12.0.0 |
tags: | removed: havana-backport-potential |
For now, sparse image can be used if one of the following is true:
1. the selected flavor to boot with has a configured root disk capacity of 0 or >= capacity of the sparse image.
2. the capacity of the vmdk is what is set as the the size of the image.
(Note: size of sparse vmdk != capacity of vmdk). The capacity of the vmdk should be known a priori, or
inferrable by examining the embedded header of the sparse vmdk.
e.g.
> head -20 precise.vmdk | grep SPARSE
"RW 8388608" SPARSE "precise.vmdk"' in the header of the precise.vmdk,
disk header is reporting 8388608 sectors (of 512 bytes each), for a total of 4GB.
The glance image's size property can therefore be updated like so:
glance image-update --size 4294967296 _image_id_
3. correct the glance image's size to be the capacity of the disk, which is 4294967296.
(glance image-update --size 4294967296 image_id)