← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1483645] Re: Ephemeral disk size in volume can be bypassed when booting instance

 

Reviewed:  https://review.openstack.org/213762
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c7de85445ad2c153710e066df7eba23d68d32010
Submitter: Jenkins
Branch:    master

commit c7de85445ad2c153710e066df7eba23d68d32010
Author: jichenjc <jichenjc@xxxxxxxxxx>
Date:   Fri Aug 14 02:42:58 2015 +0800

    Prevent boot if ephemeral disk size > flavor value
    
    Nova allows following command
    nova boot --image 3ec2603b-9113-4ca1-92cf-690e573985bd --flavor 11
    --block-device source=blank,dest=local
    --block-device source=blank,dest=local test
    
    which in turn translate the ephemeral disk mappings into 2
    default ephemeral disk and makes the total spanwed ephemeral
    disk size greater than flavor ephemeral disk.
    
    This patch add checks to this kind of situation and prevents it.
    
    Change-Id: I1952eeb04bf3835182e575e418632a6d611c84e9
    Closes-Bug: 1483645


** Changed in: nova
       Status: In Progress => Fix Released

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

Title:
  Ephemeral disk size in volume can be bypassed when booting instance

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  When booting a server with ephemeral disks without specifying the size
  it defaults to the flavor ephemeral disk size for all  of them.

  Steps:

          1. Create custom flavor with ephemeral disk > 0

  ubuntu@ubuntu:~$ nova flavor-list
  +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
  | ID | Name      | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
  +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
  | 1  | m1.tiny   | 512       | 1    | 0         |      | 1     | 1.0         | True      |
  | 11 | m1.custom | 512       | 5    | 10        |      | 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      |
  +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+

          2.  Boot instance with ephemerals without specifying their
  size

  ubuntu@ubuntu:~$ nova boot --image  3ec2603b-9113-4ca1-92cf-690e573985bd --flavor 11 --block-device source=blank,dest=local --block-device source=blank,dest=local test
  +--------------------------------------+----------------------------------------------------------------+
  | Property                             | Value                                                          |
  +--------------------------------------+----------------------------------------------------------------+
  | OS-DCF:diskConfig                    | MANUAL                                                         |
  | OS-EXT-AZ:availability_zone          | nova                                                           |
  | OS-EXT-SRV-ATTR:host                 | -                                                              |
  | OS-EXT-SRV-ATTR:hypervisor_hostname  | -                                                              |
  | OS-EXT-SRV-ATTR:instance_name        | instance-0000005e                                              |
  | OS-EXT-STS:power_state               | 0                                                              |
  | OS-EXT-STS:task_state                | scheduling                                                     |
  | OS-EXT-STS:vm_state                  | building                                                       |
  | OS-SRV-USG:launched_at               | -                                                              |
  | OS-SRV-USG:terminated_at             | -                                                              |
  | accessIPv4                           |                                                                |
  | accessIPv6                           |                                                                |
  | adminPass                            | RgeEPJp5fLYL                                                   |
  | config_drive                         |                                                                |
  | created                              | 2015-08-11T09:35:31Z                                           |
  | flavor                               | m1.custom (11)                                                 |
  | hostId                               |                                                                |
  | id                                   | 8b1659bf-5ffe-4855-aebe-a63991ce12cc                           |
  | image                                | cirros-0.3.4-x86_64-uec (3ec2603b-9113-4ca1-92cf-690e573985bd) |
  | key_name                             | -                                                              |
  | metadata                             | {}                                                             |
  | name                                 | test                                                           |
  | os-extended-volumes:volumes_attached | []                                                             |
  | progress                             | 0                                                              |
  | security_groups                      | default                                                        |
  | status                               | BUILD                                                          |
  | tenant_id                            | 0b2075b7a28440078e8f50a75eaa9066                               |
  | updated                              | 2015-08-11T09:35:31Z                                           |
  | user_id                              | 30a0b1adc4b94fefbf938568fe349910                               |
  +--------------------------------------+----------------------------------------------------------------+

   We see the ephemerals there:

  ubuntu@ubuntu:/opt/stack/data/nova/instances/8b1659bf-5ffe-4855-aebe-a63991ce12cc$ ls
  console.log  disk  disk.config  disk.eph0  disk.eph1  disk.info  kernel  libvirt.xml  ramdisk

  ubuntu@ubuntu:/opt/stack/data/nova/instances/8b1659bf-5ffe-4855-aebe-a63991ce12cc$ qemu-img info disk.eph0
  image: disk.eph0
  file format: qcow2
  virtual size: 10G (10737418240 bytes)
  disk size: 324K
  cluster_size: 65536
  backing file: /opt/stack/data/nova/instances/_base/ephemeral_10_40d1d2c
  Format specific information:
      compat: 1.1
      lazy refcounts: false
  ubuntu@ubuntu:/opt/stack/data/nova/instances/8b1659bf-5ffe-4855-aebe-a63991ce12cc$ qemu-img info disk.eph1
  image: disk.eph1
  file format: qcow2
  virtual size: 10G (10737418240 bytes)
  disk size: 196K
  cluster_size: 65536
  backing file: /opt/stack/data/nova/instances/_base/ephemeral_10_40d1d2c
  Format specific information:
      compat: 1.1
      lazy refcounts: false

  
  They are both defaulted to the size from the flavor (10 G) for a total of 20 G.  Normally, the total size of the ephemeral disks should not be greater than the size from the flavor, otherwise it will raise InvalidBDMEphemeralSize exception.

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


References