1
The Config Drive Extension
2
=================================================================
5
The config-drive extension enables attaching a separate drive to the Compute guest on instance create. It is used with the OpenStack Compute 1.1 API to write configuration data into guest for those guests whose root filesystems cannot be mounted by the Compute host.
7
To use this extension, you must have installed Compute, with libvirt or Xen using local disk.
9
To obtain current information the extensions available to you, issue an EXTENSION query on the OpenStack system where it is installed, such as http://mycloud.com/v1.1/tenant/extensions.
18
http://docs.openstack.org/ext/config-drive/api/v1.1
24
Christopher MacGown <chris@pistoncloud.com>
42
This extension enables the assignment of config-drives to a
43
compute guest on instance create running in an OpenStack cloud.
45
Sample Query Responses
46
~~~~~~~~~~~~~~~~~~~~~~
48
As shown below, responses to an EXTENSION query in XML or JSON provide basic information about the extension.
50
Extension Query Response: XML::
54
.. todo:: Provide example of extension query XML response.
56
Extension Query Response: JSON::
60
.. todo:: Provide example of extension query JSON response.
62
Document Change History
63
~~~~~~~~~~~~~~~~~~~~~~~
65
============= =====================================
66
Revision Date Summary of Changes
67
2011-09-16 Initial draft
68
2012-03-30 Reformat of content
69
============= =====================================
74
This extension to the OpenStack Compute API allows the addition of a configuration drive to an instance.
76
This support is provided by the addition of new resources.
92
This extension to the OpenStack Compute API adds the following resources:
94
A config_drive attribute to the servers API that is None by default, but can optionally be True or the imageRef of a config-drive image.
96
Upon instance create, a guest built with a True config_drive attribute will create a local volume and partition it as a fat32 drive, all passed in metadata, networks, and keys will be written to the config_drive which is associated as the last available disk on the instance.
97
Upon instance create, a guest built with an imageRef config_drive attribute will create a local volume from the image.
103
Changes to the Cloud Servers Specification
104
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106
In section 4.1.2 (Create Servers) of the API Specification: Examples 4.3 and 4.4 should optionally add the config-drive attribute as in the below examples:
109
Example XML with config_drive attribute = True:
113
<?xml version="1.0" encoding="UTF-8"?>
114
<server xmlns="http://docs.openstack.org/compute/api/v1.1"
115
imageRef="http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"
116
flavorRef="52415800-8b69-11e0-9b19-734f1195ff37"
117
name="new-server-test"
121
<meta key="My Server Name">Apache1</meta>
124
<file path="/etc/banner.txt">
125
ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
126
dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
127
IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
128
c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
129
QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
130
ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
131
dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
132
c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
133
b25zLiINCg0KLVJpY2hhcmQgQmFjaA==
138
Example XML with config_drive attribute is an imageRef:
142
<?xml version="1.0" encoding="UTF-8"?>
143
<server xmlns="http://docs.openstack.org/compute/api/v1.1"
144
imageRef="http://servers.api.openstack.org/1234/images/
145
52415800-8b69-11e0-9b19-734f6f006e54"
146
flavorRef="52415800-8b69-11e0-9b19-734f1195ff37"
147
name="new-server-test"
148
config_drive="http://servers.api.openstack.org/1234/images/52415800-8b69-1341-9b19-734f6f006e54"
151
<meta key="My Server Name">Apache1</meta>
154
<file path="/etc/banner.txt">
155
ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
156
dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
157
IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
158
c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
159
QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
160
ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
161
dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
162
c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
163
b25zLiINCg0KLVJpY2hhcmQgQmFjaA==
169
Example JSON with config_drive attribute is true:
175
"name" : "new-server-test",
176
"imageRef" : "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54",
177
"flavorRef" : "52415800-8b69-11e0-9b19-734f1195ff37",
178
"config_drive" : "true",
180
"My Server Name" : "Apache1"
184
"path" : "/etc/banner.txt",
185
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
186
dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
187
IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
188
c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
189
QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
190
ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
191
dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
192
c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
193
b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
199
Example JSON with config_drive attribute is an imageRef:
205
"name" : "new-server-test",
206
"imageRef" : "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54",
207
"flavorRef" : "52415800-8b69-11e0-9b19-734f1195ff37",
208
"config_drive" : "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54",
210
"My Server Name" : "Apache1"
214
"path" : "/etc/banner.txt",
215
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
216
dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
217
IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
218
c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
219
QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
220
ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
221
dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
222
c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
223
b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="