3
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.
5
To use this extension, you must have installed Compute, with libvirt or Xen using local disk.
7
.. Are there any pre-requisites prior to using it such as special hardware or configuration?
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>
25
Name <email@mailingaddress.net>
43
This extension enables the assignment of config-drives to a 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::
53
Extension Query Response: JSON::
56
Document Change History
57
-----------------------
59
============= =====================================
60
Revision Date Summary of Changes
61
2011-09-16 Initial draft
62
============= =====================================
67
This extension to the OpenStack Compute API allows the addition of a configuration drive to an instance.
69
To support these new actions, the extension also issues new (faults, headers, resources, states, you name it.)
86
This extension to the OpenStack Compute API adds the following resources:
88
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.
90
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.
91
Upon instance create, a guest built with an imageRef config_drive attribute will create a local volume from the image.
96
Changes to the Cloud Servers Specification
97
------------------------------------------
99
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:
102
Example XML with config_drive attribute = True:
104
<?xml version="1.0" encoding="UTF-8"?>
105
<server xmlns="http://docs.openstack.org/compute/api/v1.1"
106
imageRef="http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"
107
flavorRef="52415800-8b69-11e0-9b19-734f1195ff37"
108
name="new-server-test"
112
<meta key="My Server Name">Apache1</meta>
115
<file path="/etc/banner.txt">
116
ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
117
dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
118
IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
119
c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
120
QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
121
ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
122
dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
123
c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
124
b25zLiINCg0KLVJpY2hhcmQgQmFjaA==
130
Example XML with config_drive attribute is an imageRef:
132
<?xml version="1.0" encoding="UTF-8"?>
133
<server xmlns="http://docs.openstack.org/compute/api/v1.1"
134
imageRef="http://servers.api.openstack.org/1234/images/
135
52415800-8b69-11e0-9b19-734f6f006e54"
136
flavorRef="52415800-8b69-11e0-9b19-734f1195ff37"
137
name="new-server-test"
138
config_drive="http://servers.api.openstack.org/1234/images/52415800-8b69-1341-9b19-734f6f006e54"
141
<meta key="My Server Name">Apache1</meta>
144
<file path="/etc/banner.txt">
145
ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
146
dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
147
IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
148
c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
149
QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
150
ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
151
dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
152
c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
153
b25zLiINCg0KLVJpY2hhcmQgQmFjaA==
159
Example JSON with config_drive attribute is true:
162
"name" : "new-server-test",
163
"imageRef" : "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54",
164
"flavorRef" : "52415800-8b69-11e0-9b19-734f1195ff37",
165
"config_drive" : "true",
167
"My Server Name" : "Apache1"
171
"path" : "/etc/banner.txt",
172
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
173
dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
174
IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
175
c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
176
QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
177
ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
178
dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
179
c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
180
b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
186
Example JSON with config_drive attribute is an imageRef:
189
"name" : "new-server-test",
190
"imageRef" : "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54",
191
"flavorRef" : "52415800-8b69-11e0-9b19-734f1195ff37",
192
"config_drive" : "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54",
194
"My Server Name" : "Apache1"
198
"path" : "/etc/banner.txt",
199
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
200
dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
201
IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
202
c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
203
QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
204
ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
205
dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
206
c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
207
b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="