Add support for flavors with no local ephemeral disks¶
https://blueprints.launchpad.net/nova/+spec/flavor-root-disk-none
This feature adds the possibility to define a flavor,
that does not create any ephemeral disk locally on the hypervisor.
The proposal is to add a new flavor key local_disks.
If local_disks is set to False, no hypervisor-local root disk
or any other local ephemeral disk will be created.
A bootable volume needs to be created to launch an instance
from that flavor. All other additional disks can only be volume-based,
as well.
Problem description¶
Currently there is no way to force root disk being on cinder and having
no hypervisor-local ephemeral disks at all.
Setting root_gb to 0 defaults in creating an ephemeral root disk
with the size of the glance image.
We do not want to have ephemeral disks locally on the hypervisor; not on a local filesystem nor on a share mounted to /var/lib/nova/instances. As these shares grow, they become unmaintainable and performance gets worse. Storing the ephemeral root disk in the hypervisor’s local filesystem is also not a good idea, since consumer data on the root disk often cannot simply be deleted. Having more or less all block devices in cinder volumes gives us a unique and flexible feature set for maintaining block storage of instances and the instances themselves.
Use Cases¶
The use case for End Users is to not create ephemeral (root) disks locally on the hypervisor by accident. When launching an instance from a flavor with disabled local disks, the user will be informed to create a bootable volume in order to launch the instance with that volume. The volume can be an existing one or a new one, created upon the instance launch request via the block-device parameter. The end user does not need to worry about disk placement; which impacts instance migration, data persistence/loss, and/or shared storage performance.
The use case for deployers is to have the ability to prevent customers from creating ephemeral (root) disks locally on the hypervisor. Deployers do not have to worry to much about local HV filesystem sizing nor they do not need to create one big share for /var/lib/nova/instances, which gets mounted on all hypervisors. As that share grows it gets unmaintainable and performance is gets worse. They do not have to deal with customer data loss on ephemeral disks, stored on local hypervisor FS, in case of hypervisor outage.
Proposed change¶
The scope of the change:
new flavor key
local_disksin the APInew boolean column
local_disksfor table flavorsdefault value for
local_disksis Trueolder microversions display value of 0 for
root_gb,ephemeral_gbandswap_gb, iflocal_disks=Falsenewer microversions do not return the keys
root_gb,ephemeral_gbandswap_gb, iflocal_disks=Falseif
local_disks=Falseis givenroot_gb,ephemeral_gbandswap_gbare optionalif
local_disks=Falseis givenroot_gb,ephemeral_gbandswap_gbare automatically set to 0, given values get ignoredif
local_disksis omitted or set to True,root_gbis mandatory againerror, when flavor create request with
local_disks=Falseandroot_gb> 0 and/oremphemeral_gb> 0 and/orswap_gb> 0return descriptive exception, when flavor with
local_disks=Falseand requested image larger than given blockdevice layoutreturn descriptive exception, when flavor with
local_disks=Falseand given block_device parameter includesdest_type‘local’return descriptive exception, when resizing instance from flavor with
local_disks=Trueto flavor withlocal_disks=Falseadjust api doc to include detailed description of
local_diskskeyconfig-drive will not be touched by that change, config-drive will still reside on local HV disks, like libvirt.xml and console.log do
Alternatives¶
The alternative is to always boot instances with the additional block_device
parameter and dest_type ‘volume’, to make sure (root) disks are on cinder
volumes and no hypervisor-local ephemeral disk gets created.
But this has the downside, that someone might forget it and ephemeral disks
get created locally on the HV.
There is no way to force users, that no ephemeral root disks are being created
on the hypervisor.
Data model impact¶
add new column
local_diskstype boolean to flavor table (default is True)
REST API impact¶
introduce new api microversion which allows ‘None’ as disk value
POST v2.1/<tenant_id>/flavors:
{
"flavor": {
"name": "flavor_without_local_ephemeral_disks",
"ram": 1024,
"vcpus": 2,
"local_disks": false,
}
}
flavor show omits
root_gb,ephemeral_gbandswap_gb, whenlocal_disks=False:
{
"flavor": {
"OS-FLV-DISABLED:disabled": false,
"local_disks": false,
"os-flavor-access:is_public": true,
"id": "1",
"links": [
{
"href": "http://openstack.example.com/v2.1/openstack/flavors/1",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"ram": 512,
"vcpus": 1
}
}
with older microversions,
root_gb,ephemeral_gbandswap_gbwill be returned with value 0, whenlocal_disks=False:
{
"flavor": {
"OS-FLV-DISABLED:disabled": false,
"local_disks": false,
"disk": 0,
"OS-FLV-EXT-DATA:ephemeral": 0,
"os-flavor-access:is_public": true,
"id": "1",
"links": [
{
"href": "http://openstack.example.com/v2.1/openstack/flavors/1",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"ram": 512,
"swap": 0,
"vcpus": 1
}
}
root_gbis no longer mandatory withlocal_disks=Falsereturn 400 error when flavor has
local_disks=Falseand no BD mapping givenreturn 400 error when flavor has
local_disks=Falseanddest_typelocal given in BD mappingreturn 400 error when flavor has
local_disks=Trueand instance resize to flavorlocal_disks=Falserequestedreturn 400 error on flavor create, when
local_disks=Falseandroot_gband/orephemeral_gband/orswap_gbgiven
Security impact¶
None
Notifications impact¶
None
Other end user impact¶
End users need to provide a proper blockdevice mapping with dest_type
volume, in order to use a flavor with local_disks=False.
Performance Impact¶
None
Other deployer impact¶
If a deployer doesn’t want any ephemeral/local disk on the hypervisor nodes,
they just create flavors with local_disks=False and then all users of that
cloud have to provide a blockdevice mapping with dest_type ‘volume’ when
creating an instance.
Developer impact¶
None
Implementation¶
Assignee(s)¶
- Primary assignee:
tpatzig
Work Items¶
create db column
create api microversion with new key
support
local_disks=Falsefor flavor showexception handling if
local_disks=Falsein flavor and request contains local BD mappingadjust flavor unit test
Dependencies¶
None
Testing¶
Create flavor with
local_disks=FalseBoot instance with such flavor without volume
Boot instance with such flavor with local BD mapping
Boot instance with such flavor with volume
Documentation Impact¶
http://docs.openstack.org/openstack-ops/content/flavors.html
API doc will be updated to include the new flavor option local_disks.
References¶
None
History¶
Release Name |
Description |
|---|---|
Ocata |
Introduced |