← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1628449] [NEW] Exception when live block migration multiple ephemerals

 

Public bug reported:

When block live migrate an instance with multiple ephemeral an exception
FlavorDiskSmallerThanImage is raised.


Steps to Reproduce:
1) Created flavor with two ephemeral support.

~~~
[root@allinone9 ~(keystone_admin)]# nova flavor-create 2ephemeral-disks 6 512 1 1 --ephemeral 2
~~~

2) Spawned instance using created flavor.

~~~
[root@allinone9 ~(keystone_admin)]# nova boot --flavor 2ephemeral-disks --image cirros --ephemeral size=1 --ephemeral size=1 internal1
~~~

3) Instance spawned successfully.

~~~
[root@allinone9 ~(keystone_admin)]# nova list --field name,status,host | grep -i internal1
| 08619d2d-e3a2-4f67-a959-33cfbc08d153 | internal1 | ACTIVE | allinone9 |
~~~

4) Verifying that two extra ephemeral disks are connected with instance.

~~~
[root@allinone9 ~(keystone_admin)]# virsh domblklist 4
Target     Source
------------------------------------------------
vda        /var/lib/nova/instances/08619d2d-e3a2-4f67-a959-33cfbc08d153/disk
vdb        /var/lib/nova/instances/08619d2d-e3a2-4f67-a959-33cfbc08d153/disk.eph0
vdc        /var/lib/nova/instances/08619d2d-e3a2-4f67-a959-33cfbc08d153/disk.eph1
~~~

5) Tried to perform the block migration but it end with same error which
you have seen.

[root@allinone9 ~(keystone_admin)]# nova live-migration 08619d2d-
e3a2-4f67-a959-33cfbc08d153 compute1-9 --block-migrate

~~~
>From : /var/log/nova/nova-compute.log

2016-09-26 08:53:12.033 3958 ERROR nova.compute.manager [req-
f24d49f7-4d8e-4683-bcc0-952254764fca b09d7a1af46d42398c79a1dc0da02954
ca23990ed6c846b0b8d588fb5e304aeb - - -] [instance: 08619d2d-
e3a2-4f67-a959-33cfbc08d153] Pre live migration failed at compute1-9

2016-09-26 08:53:12.033 3958 ERROR nova.compute.manager [instance: 08619d2d-e3a2-4f67-a959-33cfbc08d153] 
2016-09-26 08:53:12.033 3958 ERROR nova.compute.manager [instance: 08619d2d-e3a2-4f67-a959-33cfbc08d153] FlavorDiskSmallerThanImage: Flavor's disk is too small for requested image. Flavor disk is 1073741824 bytes, image is 2147483648 bytes.
~~~

That error is because two mistake:

... LINE ~ 6588 in libvirt.py (method
libvirt._create_images_and_backing)

		image = self.image_backend.image(instance,
	                                         instance_disk,
	                                         CONF.libvirt.images_type)
                if cache_name.startswith('ephemeral'):
                    image.cache(fetch_func=self._create_ephemeral,
				fs_label=cache_name,
				os_type=instance.os_type,
	                        filename=cache_name,
                                size=info['virt_disk_size'],                  (a)
                                ephemeral_size=instance.flavor.ephemeral_gb)  (b) 
	        elif cache_name.startswith('swap'):
	            inst_type = instance.get_flavor()
                    swap_mb = inst_type.swap

...


(a) That argument 'size' does not exist in _create_ephemeral
(b) We should report here the actual size of the ephemeral disk (which is what has been asked by user during boot insteado of the total size allowed by the flavor for ephemeral disks)

** Affects: nova
     Importance: Undecided
     Assignee: sahid (sahid-ferdjaoui)
         Status: New


** Tags: newton-backport-potential

** Changed in: nova
     Assignee: (unassigned) => sahid (sahid-ferdjaoui)

** Tags added: newton-backport-potential

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

Title:
  Exception when live block migration multiple ephemerals

Status in OpenStack Compute (nova):
  New

Bug description:
  When block live migrate an instance with multiple ephemeral an
  exception FlavorDiskSmallerThanImage is raised.

  
  Steps to Reproduce:
  1) Created flavor with two ephemeral support.

  ~~~
  [root@allinone9 ~(keystone_admin)]# nova flavor-create 2ephemeral-disks 6 512 1 1 --ephemeral 2
  ~~~

  2) Spawned instance using created flavor.

  ~~~
  [root@allinone9 ~(keystone_admin)]# nova boot --flavor 2ephemeral-disks --image cirros --ephemeral size=1 --ephemeral size=1 internal1
  ~~~

  3) Instance spawned successfully.

  ~~~
  [root@allinone9 ~(keystone_admin)]# nova list --field name,status,host | grep -i internal1
  | 08619d2d-e3a2-4f67-a959-33cfbc08d153 | internal1 | ACTIVE | allinone9 |
  ~~~

  4) Verifying that two extra ephemeral disks are connected with
  instance.

  ~~~
  [root@allinone9 ~(keystone_admin)]# virsh domblklist 4
  Target     Source
  ------------------------------------------------
  vda        /var/lib/nova/instances/08619d2d-e3a2-4f67-a959-33cfbc08d153/disk
  vdb        /var/lib/nova/instances/08619d2d-e3a2-4f67-a959-33cfbc08d153/disk.eph0
  vdc        /var/lib/nova/instances/08619d2d-e3a2-4f67-a959-33cfbc08d153/disk.eph1
  ~~~

  5) Tried to perform the block migration but it end with same error
  which you have seen.

  [root@allinone9 ~(keystone_admin)]# nova live-migration 08619d2d-
  e3a2-4f67-a959-33cfbc08d153 compute1-9 --block-migrate

  ~~~
  From : /var/log/nova/nova-compute.log

  2016-09-26 08:53:12.033 3958 ERROR nova.compute.manager [req-
  f24d49f7-4d8e-4683-bcc0-952254764fca b09d7a1af46d42398c79a1dc0da02954
  ca23990ed6c846b0b8d588fb5e304aeb - - -] [instance: 08619d2d-
  e3a2-4f67-a959-33cfbc08d153] Pre live migration failed at compute1-9

  2016-09-26 08:53:12.033 3958 ERROR nova.compute.manager [instance: 08619d2d-e3a2-4f67-a959-33cfbc08d153] 
  2016-09-26 08:53:12.033 3958 ERROR nova.compute.manager [instance: 08619d2d-e3a2-4f67-a959-33cfbc08d153] FlavorDiskSmallerThanImage: Flavor's disk is too small for requested image. Flavor disk is 1073741824 bytes, image is 2147483648 bytes.
  ~~~

  That error is because two mistake:

  ... LINE ~ 6588 in libvirt.py (method
  libvirt._create_images_and_backing)

  		image = self.image_backend.image(instance,
  	                                         instance_disk,
  	                                         CONF.libvirt.images_type)
                  if cache_name.startswith('ephemeral'):
                      image.cache(fetch_func=self._create_ephemeral,
  				fs_label=cache_name,
  				os_type=instance.os_type,
  	                        filename=cache_name,
                                  size=info['virt_disk_size'],                  (a)
                                  ephemeral_size=instance.flavor.ephemeral_gb)  (b) 
  	        elif cache_name.startswith('swap'):
  	            inst_type = instance.get_flavor()
                      swap_mb = inst_type.swap

  ...

  
  (a) That argument 'size' does not exist in _create_ephemeral
  (b) We should report here the actual size of the ephemeral disk (which is what has been asked by user during boot insteado of the total size allowed by the flavor for ephemeral disks)

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


Follow ups