Should support 'auto' and 'none' as network parameter when boot instances
Nova added support using 'auto' and 'none' as network parameters since microversion 2.37: http://git.openstack.org/cgit/openstack/nova/tree/nova/api/openstack/rest_api_version_history.rst#n389 we should also add support for this in OSC. Change-Id: I6e5f616dfa48895ebd13144effe9fda7cb94c649 Closes-bug: #1651288
This commit is contained in:
parent
5d62981beb
commit
ff18e3d0e9
@ -107,7 +107,7 @@ Create a new server
|
|||||||
[--user-data <user-data>]
|
[--user-data <user-data>]
|
||||||
[--availability-zone <zone-name>]
|
[--availability-zone <zone-name>]
|
||||||
[--block-device-mapping <dev-name=mapping> [...] ]
|
[--block-device-mapping <dev-name=mapping> [...] ]
|
||||||
[--nic <net-id=net-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,port-id=port-uuid> [...] ]
|
[--nic <net-id=net-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,port-id=port-uuid,auto,none> [...] ]
|
||||||
[--hint <key=value> [...] ]
|
[--hint <key=value> [...] ]
|
||||||
[--config-drive <value>|True ]
|
[--config-drive <value>|True ]
|
||||||
[--min <count>]
|
[--min <count>]
|
||||||
@ -158,7 +158,7 @@ Create a new server
|
|||||||
|
|
||||||
Map block devices; map is <id>:<type>:<size(GB)>:<delete_on_terminate> (optional extension)
|
Map block devices; map is <id>:<type>:<size(GB)>:<delete_on_terminate> (optional extension)
|
||||||
|
|
||||||
.. option:: --nic <net-id=net-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,port-id=port-uuid>
|
.. option:: --nic <net-id=net-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,port-id=port-uuid,auto,none>
|
||||||
|
|
||||||
Create a NIC on the server. Specify option multiple times to create
|
Create a NIC on the server. Specify option multiple times to create
|
||||||
multiple NICs. Either net-id or port-id must be provided, but not both.
|
multiple NICs. Either net-id or port-id must be provided, but not both.
|
||||||
@ -166,6 +166,8 @@ Create a new server
|
|||||||
port-id: attach NIC to port with this UUID,
|
port-id: attach NIC to port with this UUID,
|
||||||
v4-fixed-ip: IPv4 fixed address for NIC (optional),
|
v4-fixed-ip: IPv4 fixed address for NIC (optional),
|
||||||
v6-fixed-ip: IPv6 fixed address for NIC (optional).
|
v6-fixed-ip: IPv6 fixed address for NIC (optional).
|
||||||
|
none: (v2.37+) no network is attached.
|
||||||
|
auto: (v2.37+) the compute service will automatically allocate a network.
|
||||||
|
|
||||||
.. option:: --hint <key=value>
|
.. option:: --hint <key=value>
|
||||||
|
|
||||||
|
@ -393,7 +393,10 @@ class CreateServer(command.ShowOne):
|
|||||||
"net-id: attach NIC to network with this UUID, "
|
"net-id: attach NIC to network with this UUID, "
|
||||||
"port-id: attach NIC to port with this UUID, "
|
"port-id: attach NIC to port with this UUID, "
|
||||||
"v4-fixed-ip: IPv4 fixed address for NIC (optional), "
|
"v4-fixed-ip: IPv4 fixed address for NIC (optional), "
|
||||||
"v6-fixed-ip: IPv6 fixed address for NIC (optional)."),
|
"v6-fixed-ip: IPv6 fixed address for NIC (optional), "
|
||||||
|
"none: (v2.37+) no network is attached, "
|
||||||
|
"auto: (v2.37+) the compute service will automatically "
|
||||||
|
"allocate a network."),
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--hint',
|
'--hint',
|
||||||
@ -513,6 +516,9 @@ class CreateServer(command.ShowOne):
|
|||||||
block_device_mapping.update({dev_key: block_volume})
|
block_device_mapping.update({dev_key: block_volume})
|
||||||
|
|
||||||
nics = []
|
nics = []
|
||||||
|
if parsed_args.nic in ('auto', 'none'):
|
||||||
|
nics = [parsed_args.nic]
|
||||||
|
else:
|
||||||
for nic_str in parsed_args.nic:
|
for nic_str in parsed_args.nic:
|
||||||
nic_info = {"net-id": "", "v4-fixed-ip": "",
|
nic_info = {"net-id": "", "v4-fixed-ip": "",
|
||||||
"v6-fixed-ip": "", "port-id": ""}
|
"v6-fixed-ip": "", "port-id": ""}
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Added ``auto`` and ``none`` as values for ``--nic`` to
|
||||||
|
the``server create`` command. Specifying ``none`` will not
|
||||||
|
attach a network to the server. Specifying ``auto``
|
||||||
|
will automatically attach a network. Note, v2.37 (or newer)
|
||||||
|
of the Compute API is required for these options.
|
||||||
|
[Bug `1650342 <https://bugs.launchpad.net/bugs/1650342>`_]
|
Loading…
Reference in New Issue
Block a user