[Yahoo-eng-team] [Bug 1369854] Re: min_disk and size information wrong when creating an instance image

2015-11-23 Thread wangxiyuan
** Changed in: glance
 Assignee: wangxiyuan (wangxiyuan) => (unassigned)

** Changed in: glance
   Status: Confirmed => 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/1369854

Title:
  min_disk and size information wrong when creating an instance image

Status in Glance:
  Invalid
Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  If I launch an instance from an image that has min_disk set to 2GB,
  then create an image from the instance, the min_disk attribute is not
  set correctly on the image (it's set to 0). Instead of being set as an
  attribute, it exists as a property instead. This can cause issues when
  other services rely on min_disk to make decisions about size (e.g. bug
  1368600 for Horizon, not sure if Cinder is affected too).

  This doesn't seem to happen when creating a basic instance from an
  instance, only when there is also a volume involved.

  I'm not sure if this is a nova or glance issue so I'm opening a task
  on both for now.

  Steps to reproduce
  
  (done on a recent devstack)

  1. Create a new image with e.g. min_disk 2GB
  $ glance image-create --name mindisk2gb --disk-format qcow2 
--container-format bare --location 
https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-i386-disk.img 
--min-disk 2
  +--+--+
  | Property | Value|
  +--+--+
  | checksum | None |
  | container_format | bare |
  | created_at   | 2014-09-16T12:35:33  |
  | deleted  | False|
  | deleted_at   | None |
  | disk_format  | qcow2|
  | id   | 9bbed3a5-00bf-4901-855e-556ca02e7fb7 |
  | is_public| False|
  | min_disk | 2|  <-- min_disk 
set as expected
  | min_ram  | 0|
  | name | mindisk2gb   |
  | owner| eb6acc49df4b4390a99c722ded526284 |
  | protected| False|
  | size | 9159168  |  <-- size 
looks ok
  | status   | active   |
  | updated_at   | 2014-09-16T12:35:37  |
  | virtual_size | None |
  +--+--+

  2. Boot an instance from this image, backed by a volume (I believe this 
matches what happens when launching with "Image (creates a new volume)" in 
Horizon)
  $ nova boot --flavor 4115a835-04f0-4457-b93c-1817bc44812c --block-device 
device='/dev/vda',source='image',dest='volume',id='9bbed3a5-00bf-4901-855e-556ca02e7fb7',size=2,bootindex=0
 my_instance 
  
+--+--+
  | Property | Value
|
  
+--+--+
  | OS-DCF:diskConfig| MANUAL   
|
  | OS-EXT-AZ:availability_zone  | nova 
|
  | OS-EXT-STS:power_state   | 0
|
  | OS-EXT-STS:task_state| -
|
  | OS-EXT-STS:vm_state  | building 
|
  | OS-SRV-USG:launched_at   | -
|
  | OS-SRV-USG:terminated_at | -
|
  | accessIPv4   |  
|
  | accessIPv6   |  
|
  | adminPass| Uo2DL64GaY74 
|
  | config_drive |  
|
  | created  | 2014-09-16T12:55:30Z 
|
  | flavor   | m1.lowmem 
(4115a835-04f0-4457-b93c-1817bc44812c) |
  | hostId   |  
|
  | id   | 3e70fd2e-1dc6-4001-941e-9496a9514882 
|
  | image| Attempt to boot from volume - no 
image supplied  |
  | key_name 

[Yahoo-eng-team] [Bug 1369854] Re: min_disk and size information wrong when creating an instance image

2015-09-03 Thread Thierry Carrez
** Changed in: nova
   Status: Fix Committed => Fix Released

** Changed in: nova
Milestone: None => liberty-3

-- 
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/1369854

Title:
  min_disk and size information wrong when creating an instance image

Status in Glance:
  Confirmed
Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  If I launch an instance from an image that has min_disk set to 2GB,
  then create an image from the instance, the min_disk attribute is not
  set correctly on the image (it's set to 0). Instead of being set as an
  attribute, it exists as a property instead. This can cause issues when
  other services rely on min_disk to make decisions about size (e.g. bug
  1368600 for Horizon, not sure if Cinder is affected too).

  This doesn't seem to happen when creating a basic instance from an
  instance, only when there is also a volume involved.

  I'm not sure if this is a nova or glance issue so I'm opening a task
  on both for now.

  Steps to reproduce
  
  (done on a recent devstack)

  1. Create a new image with e.g. min_disk 2GB
  $ glance image-create --name mindisk2gb --disk-format qcow2 
--container-format bare --location 
https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-i386-disk.img 
--min-disk 2
  +--+--+
  | Property | Value|
  +--+--+
  | checksum | None |
  | container_format | bare |
  | created_at   | 2014-09-16T12:35:33  |
  | deleted  | False|
  | deleted_at   | None |
  | disk_format  | qcow2|
  | id   | 9bbed3a5-00bf-4901-855e-556ca02e7fb7 |
  | is_public| False|
  | min_disk | 2|  <-- min_disk 
set as expected
  | min_ram  | 0|
  | name | mindisk2gb   |
  | owner| eb6acc49df4b4390a99c722ded526284 |
  | protected| False|
  | size | 9159168  |  <-- size 
looks ok
  | status   | active   |
  | updated_at   | 2014-09-16T12:35:37  |
  | virtual_size | None |
  +--+--+

  2. Boot an instance from this image, backed by a volume (I believe this 
matches what happens when launching with "Image (creates a new volume)" in 
Horizon)
  $ nova boot --flavor 4115a835-04f0-4457-b93c-1817bc44812c --block-device 
device='/dev/vda',source='image',dest='volume',id='9bbed3a5-00bf-4901-855e-556ca02e7fb7',size=2,bootindex=0
 my_instance 
  
+--+--+
  | Property | Value
|
  
+--+--+
  | OS-DCF:diskConfig| MANUAL   
|
  | OS-EXT-AZ:availability_zone  | nova 
|
  | OS-EXT-STS:power_state   | 0
|
  | OS-EXT-STS:task_state| -
|
  | OS-EXT-STS:vm_state  | building 
|
  | OS-SRV-USG:launched_at   | -
|
  | OS-SRV-USG:terminated_at | -
|
  | accessIPv4   |  
|
  | accessIPv6   |  
|
  | adminPass| Uo2DL64GaY74 
|
  | config_drive |  
|
  | created  | 2014-09-16T12:55:30Z 
|
  | flavor   | m1.lowmem 
(4115a835-04f0-4457-b93c-1817bc44812c) |
  | hostId   |  
|
  | id   | 3e70fd2e-1dc6-4001-941e-9496a9514882 
|
  | image| Attempt to boot from volume - no 
image supplied  |
  | key_name