Disk size of flavor does not take effect during deployment for Hyper-V

Bug #1135155 reported by zjing
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Alessandro Pilotti

Bug Description

Env:
OpenStack grizzly build + Hyper-V

Step:
1. select a image 'VM_HUPERV-1G' whose default disk size is 1G
[root@a ~]# nova image-list
+--------------------------------------+-----------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+-----------------+--------+--------+
| cd9daf46-4993-41e4-9763-252affd3c939 | VM_HUPERV-1G | ACTIVE | |
| 79bec37a-8ced-4f89-b866-a86b8f7b4f4a | VM_HUPERV-Image | ACTIVE | |
+--------------------------------------+-----------------+--------+--------+
2. select a flavor 2 whose disk size is 20.
[root@Godwin-Grizzly ~]# nova flavor-list
+--------------------------------------+----------------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | extra_specs |
+--------------------------------------+----------------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| 1 | m1.tiny | 512 | 0 | 0 | | 1 | 1.0 | True | {} |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True | {} |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True | {} |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True | {} |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True | {} |
+--------------------------------------+----------------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
3. Make a deployment by cli "nova --image cd9daf46-4993-41e4-9763-252affd3c939 --flavor 2 zj0228-2"
4. Wait for the deployment completed and instance state change to 'Active'
5. Check the disk size of the instance in Hyper-V server. it's 1024MB.

ISSUE:
Disk size of flavor does not take effect during deployment for Hyper-V
in step 5, the actual disk size should be 20G, not 1G since the flavor's disk size is 20G

Tags: hyper-v
Revision history for this message
zjing (zengjingbj) wrote :

This will lead to resource usage statistics error.
As far as I know, the resource statistics is based on the instance's flavor. in this case, the value of 'local_gb_used' field in the result of 'nova hypervisor-stats' will increase '20', but the actual storage usage only increase 1G

Revision history for this message
Alessandro Pilotti (alexpilotti) wrote :

Hi Zjing. It's a know issue, a fix is already planned for Grizzly.

Changed in nova:
assignee: nobody → Alessandro Pilotti (alexpilotti)
tags: added: hyper-v
Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/23405

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/23405
Committed: http://github.com/openstack/nova/commit/689e9e3e3d48928fe950b26745a7df6fee2f0718
Submitter: Jenkins
Branch: master

commit 689e9e3e3d48928fe950b26745a7df6fee2f0718
Author: Alessandro Pilotti <email address hidden>
Date: Mon Mar 4 11:34:42 2013 +0200

    Fixes disk size issue during image boot on Hyper-V

    Fixes bug: 1135155

    The local root disk size provided in the instance flavor was not properly
    taken into account in the Hyper-V driver, this patches provides a
    fix for this feature.

    In order to resize VHD images with differencing disks (CoW), the cached
    base disk is copied to a new file, which is resized to the size
    specified in the flavor and cached. This is necessary due to the fact that
    differencing VHD disks cannot be resized.

    The procedure described above is applied during image spawn, resize and
    live migration as needed.

    Trying to spawn an instance with a local root disk size smaller than the
    image VHD max. internal size will result in an error.

    Change-Id: I04f18f0e25c92ed1e1f9f6f18750329a3f9f1711

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-rc1 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.