Config drive based on image property¶
When creating an instance, check the image property to decide if a config drive should be created.
Currently Nova decides if config drive is created for a server based on:
If the user specifies the config-drive option in server create API request, or,
If the server is scheduled to a compute node with force_config_drive option set.
But we need consider the image requirement also. Some images may explicitly require config drive.
Add an image property as “img_config_drive”, the value of the img_config_drive can be:
where these mean:
mandatory == instance must always have a config drive
optional == instance can use a config drive, but can still work if missing
Any other value will be treated as error. If no option specified, the default value is optional.
In future, this property may be extended to include more choices like ‘disable’ to disable config_drive. A mechanism should be presented at that time to make sure the ‘disable’ option is not treated as error.
The rule of config drive decision is described as followed table. A config drive will be created whenever user specified in API, required in image property or compute node configuration option specified it.
Set or Unset
Mandatory or Optional
Set or Unset
Another option is to combine the API option and image property into one instance property in the API layer, but this is not clean IMHO.
Data model impact¶
REST API impact¶
Other end user impact¶
This BP will add one more image property, so user should be aware of that.
There will be no performance impact.
Other deployer impact¶
It’s recommended that deployers update all compute nodes before they add the config drive property to any images. Otherwise, the image property is not checked by compute node w/o this features.
- Primary assignee:
Change the virt/configdrive.py to check image property also.
There are some discussion of the enhancement of image property as in https://blueprints.launchpad.net/nova/+spec/convert-image-meta-into-nova-object and the discussion is on-going.
This proposal is not conflict with that proposal, we just need make sure the new config drive property will be defined in the VirtProperties. It will be a small effort no matter which proposal lands firstly.
Tempest tests will be added so that we can make sure the image config drive property is treated correctly.
Document change needed for the new image property.