Skip to content

Commit 9980b9a

Browse files
committed
Microversion 2.94: FQDN in hostname
Extend microversion 2.90 to allow FQDNs in the hostname parameter. Multi-create with --hostname continues to be refused, returning error 400 to the user. This simplifies the code by not needing to handle any sort of suffix or prefix mangling of the FQDN to handle multiple instances. No other changes are made - not Neutron integration, metadata API changes (the FQDN will appear as-is in places where the hostname currently appears), etc. Change-Id: I47e397dc6da8263762479cc8ae4f8777a6d9d811 Implements: bp/fqdn-in-hostname
1 parent 8e3ffb8 commit 9980b9a

30 files changed

+960
-8
lines changed

api-ref/source/parameters.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6382,6 +6382,9 @@ server_hostname_req:
63826382
description: |
63836383
The hostname to configure for the instance in the metadata service.
63846384
6385+
Starting with microversion 2.94, this can be a Fully Qualified Domain Name
6386+
(FQDN) of up to 255 characters in length.
6387+
63856388
.. note::
63866389
63876390
This information is published via the metadata service and requires

api-ref/source/servers-actions.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,11 @@ Request
604604
.. literalinclude:: ../../doc/api_samples/servers/v2.90/server-action-rebuild.json
605605
:language: javascript
606606

607+
**Example Rebuild Server (rebuild Action) (v2.94)**
608+
609+
.. literalinclude:: ../../doc/api_samples/servers/v2.94/server-action-rebuild.json
610+
:language: javascript
611+
607612
Response
608613
--------
609614

api-ref/source/servers.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,11 @@ Request
448448
.. literalinclude:: ../../doc/api_samples/servers/v2.90/server-create-req.json
449449
:language: javascript
450450

451+
**Example Create Server With FQDN in Hostname (v2.94)**
452+
453+
.. literalinclude:: ../../doc/api_samples/servers/v2.94/server-create-req.json
454+
:language: javascript
455+
451456
Response
452457
--------
453458

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"server": {
3+
"OS-DCF:diskConfig": "AUTO",
4+
"OS-EXT-AZ:availability_zone": "us-west",
5+
"OS-EXT-SRV-ATTR:hostname": "updated-hostname.example.com",
6+
"OS-EXT-STS:power_state": 1,
7+
"OS-EXT-STS:task_state": null,
8+
"OS-EXT-STS:vm_state": "active",
9+
"OS-SRV-USG:launched_at": "2021-08-19T15:16:22.177882",
10+
"OS-SRV-USG:terminated_at": null,
11+
"accessIPv4": "1.2.3.4",
12+
"accessIPv6": "80fe::",
13+
"addresses": {
14+
"private": [
15+
{
16+
"OS-EXT-IPS-MAC:mac_addr": "00:0c:29:0d:11:74",
17+
"OS-EXT-IPS:type": "fixed",
18+
"addr": "192.168.1.30",
19+
"version": 4
20+
}
21+
]
22+
},
23+
"adminPass": "seekr3t",
24+
"config_drive": "",
25+
"created": "2019-04-23T17:10:22Z",
26+
"description": null,
27+
"flavor": {
28+
"disk": 1,
29+
"ephemeral": 0,
30+
"extra_specs": {},
31+
"original_name": "m1.tiny",
32+
"ram": 512,
33+
"swap": 0,
34+
"vcpus": 1
35+
},
36+
"hostId": "2091634baaccdc4c5a1d57069c833e402921df696b7f970791b12ec6",
37+
"id": "0c37a84a-c757-4f22-8c7f-0bf8b6970886",
38+
"image": {
39+
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
40+
"links": [
41+
{
42+
"href": "http://openstack.example.com/6f70656e737461636b20342065766572/images/70a599e0-31e7-49b7-b260-868f441e862b",
43+
"rel": "bookmark"
44+
}
45+
]
46+
},
47+
"key_name": null,
48+
"links": [
49+
{
50+
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/servers/0c37a84a-c757-4f22-8c7f-0bf8b6970886",
51+
"rel": "self"
52+
},
53+
{
54+
"href": "http://openstack.example.com/6f70656e737461636b20342065766572/servers/0c37a84a-c757-4f22-8c7f-0bf8b6970886",
55+
"rel": "bookmark"
56+
}
57+
],
58+
"locked": false,
59+
"locked_reason": null,
60+
"metadata": {
61+
"meta_var": "meta_val"
62+
},
63+
"name": "foobar",
64+
"os-extended-volumes:volumes_attached": [],
65+
"progress": 0,
66+
"security_groups": [
67+
{
68+
"name": "default"
69+
}
70+
],
71+
"server_groups": [],
72+
"status": "ACTIVE",
73+
"tags": [],
74+
"tenant_id": "6f70656e737461636b20342065766572",
75+
"trusted_image_certificates": null,
76+
"updated": "2019-04-23T17:10:24Z",
77+
"user_data": "ZWNobyAiaGVsbG8gd29ybGQi",
78+
"user_id": "fake"
79+
}
80+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"rebuild" : {
3+
"accessIPv4" : "1.2.3.4",
4+
"accessIPv6" : "80fe::",
5+
"OS-DCF:diskConfig": "AUTO",
6+
"imageRef" : "70a599e0-31e7-49b7-b260-868f441e862b",
7+
"name" : "foobar",
8+
"adminPass" : "seekr3t",
9+
"hostname": "custom-hostname.example.com",
10+
"metadata" : {
11+
"meta_var" : "meta_val"
12+
},
13+
"user_data": "ZWNobyAiaGVsbG8gd29ybGQi"
14+
}
15+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"server" : {
3+
"accessIPv4": "1.2.3.4",
4+
"accessIPv6": "80fe::",
5+
"name" : "new-server-test",
6+
"imageRef" : "70a599e0-31e7-49b7-b260-868f441e862b",
7+
"flavorRef" : "1",
8+
"availability_zone": "us-west",
9+
"OS-DCF:diskConfig": "AUTO",
10+
"hostname": "custom-hostname.example.com",
11+
"metadata" : {
12+
"My Server Name" : "Apache1"
13+
},
14+
"personality": [
15+
{
16+
"path": "/etc/banner.txt",
17+
"contents": "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6 b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
18+
}
19+
],
20+
"security_groups": [
21+
{
22+
"name": "default"
23+
}
24+
],
25+
"user_data" : "IyEvYmluL2Jhc2gKL2Jpbi9zdQplY2hvICJJIGFtIGluIHlvdSEiCg=="
26+
},
27+
"OS-SCH-HNT:scheduler_hints": {
28+
"same_host": "48e6a9f6-30af-47e0-bc04-acaed113bb4e"
29+
}
30+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"server": {
3+
"OS-DCF:diskConfig": "AUTO",
4+
"adminPass": "6NpUwoz2QDRN",
5+
"id": "f5dc173b-6804-445a-a6d8-c705dad5b5eb",
6+
"links": [
7+
{
8+
"href": "http://openstack.example.com/v2/6f70656e737461636b20342065766572/servers/f5dc173b-6804-445a-a6d8-c705dad5b5eb",
9+
"rel": "self"
10+
},
11+
{
12+
"href": "http://openstack.example.com/6f70656e737461636b20342065766572/servers/f5dc173b-6804-445a-a6d8-c705dad5b5eb",
13+
"rel": "bookmark"
14+
}
15+
],
16+
"security_groups": [
17+
{
18+
"name": "default"
19+
}
20+
]
21+
}
22+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"server": {
3+
"accessIPv4": "1.2.3.4",
4+
"accessIPv6": "80fe::",
5+
"addresses": {
6+
"private": [
7+
{
8+
"addr": "192.168.1.30",
9+
"OS-EXT-IPS-MAC:mac_addr": "00:0c:29:0d:11:74",
10+
"OS-EXT-IPS:type": "fixed",
11+
"version": 4
12+
}
13+
]
14+
},
15+
"created": "2013-09-03T04:01:32Z",
16+
"description": null,
17+
"locked": false,
18+
"locked_reason": null,
19+
"flavor": {
20+
"disk": 1,
21+
"ephemeral": 0,
22+
"extra_specs": {},
23+
"original_name": "m1.tiny",
24+
"ram": 512,
25+
"swap": 0,
26+
"vcpus": 1
27+
},
28+
"hostId": "92154fab69d5883ba2c8622b7e65f745dd33257221c07af363c51b29",
29+
"id": "0e44cc9c-e052-415d-afbf-469b0d384170",
30+
"image": {
31+
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
32+
"links": [
33+
{
34+
"href": "http://openstack.example.com/6f70656e737461636b20342065766572/images/70a599e0-31e7-49b7-b260-868f441e862b",
35+
"rel": "bookmark"
36+
}
37+
]
38+
},
39+
"key_name": null,
40+
"links": [
41+
{
42+
"href": "http://openstack.example.com/v2/6f70656e737461636b20342065766572/servers/0e44cc9c-e052-415d-afbf-469b0d384170",
43+
"rel": "self"
44+
},
45+
{
46+
"href": "http://openstack.example.com/6f70656e737461636b20342065766572/servers/0e44cc9c-e052-415d-afbf-469b0d384170",
47+
"rel": "bookmark"
48+
}
49+
],
50+
"metadata": {
51+
"My Server Name": "Apache1"
52+
},
53+
"name": "new-server-test",
54+
"config_drive": "",
55+
"OS-DCF:diskConfig": "AUTO",
56+
"OS-EXT-AZ:availability_zone": "nova",
57+
"OS-EXT-SRV-ATTR:hostname": "custom-hostname.example.com",
58+
"OS-EXT-STS:power_state": 1,
59+
"OS-EXT-STS:task_state": null,
60+
"OS-EXT-STS:vm_state": "active",
61+
"os-extended-volumes:volumes_attached": [
62+
{"id": "volume_id1", "delete_on_termination": false},
63+
{"id": "volume_id2", "delete_on_termination": false}
64+
],
65+
"OS-SRV-USG:launched_at": "2013-09-23T13:37:00.880302",
66+
"OS-SRV-USG:terminated_at": null,
67+
"progress": 0,
68+
"security_groups": [
69+
{
70+
"name": "default"
71+
}
72+
],
73+
"server_groups": [],
74+
"status": "ACTIVE",
75+
"tags": [],
76+
"tenant_id": "6f70656e737461636b20342065766572",
77+
"trusted_image_certificates": null,
78+
"updated": "2013-09-03T04:01:33Z",
79+
"user_id": "fake"
80+
}
81+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"server": {
3+
"accessIPv4": "4.3.2.1",
4+
"accessIPv6": "80fe::",
5+
"OS-DCF:diskConfig": "AUTO",
6+
"hostname" : "new-server-hostname.example.com"
7+
}
8+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"server": {
3+
"accessIPv4": "1.2.3.4",
4+
"accessIPv6": "80fe::",
5+
"addresses": {
6+
"private": [
7+
{
8+
"addr": "192.168.1.30",
9+
"OS-EXT-IPS-MAC:mac_addr": "00:0c:29:0d:11:74",
10+
"OS-EXT-IPS:type": "fixed",
11+
"version": 4
12+
}
13+
]
14+
},
15+
"created": "2013-09-03T04:01:32Z",
16+
"description": null,
17+
"locked": false,
18+
"locked_reason": null,
19+
"flavor": {
20+
"disk": 1,
21+
"ephemeral": 0,
22+
"extra_specs": {},
23+
"original_name": "m1.tiny",
24+
"ram": 512,
25+
"swap": 0,
26+
"vcpus": 1
27+
},
28+
"hostId": "92154fab69d5883ba2c8622b7e65f745dd33257221c07af363c51b29",
29+
"id": "0e44cc9c-e052-415d-afbf-469b0d384170",
30+
"image": {
31+
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
32+
"links": [
33+
{
34+
"href": "http://openstack.example.com/6f70656e737461636b20342065766572/images/70a599e0-31e7-49b7-b260-868f441e862b",
35+
"rel": "bookmark"
36+
}
37+
]
38+
},
39+
"key_name": null,
40+
"links": [
41+
{
42+
"href": "http://openstack.example.com/v2/6f70656e737461636b20342065766572/servers/0e44cc9c-e052-415d-afbf-469b0d384170",
43+
"rel": "self"
44+
},
45+
{
46+
"href": "http://openstack.example.com/6f70656e737461636b20342065766572/servers/0e44cc9c-e052-415d-afbf-469b0d384170",
47+
"rel": "bookmark"
48+
}
49+
],
50+
"metadata": {
51+
"My Server Name": "Apache1"
52+
},
53+
"name": "new-server-test",
54+
"config_drive": "",
55+
"OS-DCF:diskConfig": "AUTO",
56+
"OS-EXT-AZ:availability_zone": "us-west",
57+
"OS-EXT-SRV-ATTR:hostname": "new-server-hostname.example.com",
58+
"OS-EXT-STS:power_state": 1,
59+
"OS-EXT-STS:task_state": null,
60+
"OS-EXT-STS:vm_state": "active",
61+
"os-extended-volumes:volumes_attached": [],
62+
"OS-SRV-USG:launched_at": "2013-09-23T13:37:00.880302",
63+
"OS-SRV-USG:terminated_at": null,
64+
"progress": 0,
65+
"security_groups": [
66+
{
67+
"name": "default"
68+
}
69+
],
70+
"server_groups": [],
71+
"status": "ACTIVE",
72+
"tags": [],
73+
"tenant_id": "6f70656e737461636b20342065766572",
74+
"trusted_image_certificates": null,
75+
"updated": "2013-09-03T04:01:33Z",
76+
"user_id": "fake"
77+
}
78+
}

0 commit comments

Comments
 (0)