osc network port set
Updates a port.
You can update information for a port, such as its symbolic name and associated IPs. When you update IPs for a port, any previously associated IPs are removed, returned to the respective subnet allocation pools, and replaced by the IPs in the request body. Therefore, this operation replaces the fixed_ip
attribute when you specify it in the request body. If the updated IP addresses are not valid or are already in use, the operation fails and the existing IP addresses are not removed from the port.
When you update security groups for a port and the operation succeeds, any associated security groups are removed and replaced by the security groups in the request body. Therefore, this operation replaces the security_groups
attribute when you specify it in the request body. If the security groups are not valid, the operation fails and the existing security groups are not removed from the port.
When you update binding:profile
of a port with null it is treated as {} in the response.
The binding:vnic_type
attribute can be updated on unbound ports only. If the port is already bound, the update operation of the attribute returns the Conflict (409)
response code.
Only admins and users with a specific role can update the data plane status (default role: data_plane_integrator
).
Normal response codes: 200
Error response codes: 400, 401, 403, 404, 409, 412
Usage: osc network port set [OPTIONS] <ID>
Arguments:
<ID>
— port_id parameter for /v2.0/ports/{port_id}/add_allowed_address_pairs API
Options:
-
--admin-state-up <ADMIN_STATE_UP>
— The administrative state of the resource, which is up (true
) or down (false
). Default istrue
Possible values:
true
,false
-
--allowed-address-pairs <JSON>
— A set of zero or more allowed address pair objects each where address pair object contains anip_address
andmac_address
. While theip_address
is required, themac_address
will be taken from the port if not specified. The value ofip_address
can be an IP Address or a CIDR (if supported by the underlying extension plugin). A server connected to the port can send a packet with source address which matches one of the specified allowed address pairs.Parameter is an array, may be provided multiple times.
-
--binding-host-id <BINDING_HOST_ID>
— The ID of the host where the port resides. The default is an empty string -
--binding-profile <key=value>
— A dictionary that enables the application running on the specific host to pass and receive vif port information specific to the networking back-end. This field is only meant for machine-machine communication for compute services like Nova, Ironic or Zun to pass information to a Neutron back-end. It should not be used by multiple services concurrently or by cloud end users. The existing counterexamples (capabilities: [switchdev]
for Open vSwitch hardware offload andtrusted=true
for Trusted Virtual Functions) are due to be cleaned up. The networking API does not define a specific format of this field. The default is an empty dictionary. If you update it with null then it is treated like {} in the response. Since the port-mac-address-override extension thedevice_mac_address
field of the binding:profile can be used to provide the MAC address of the physical device a direct-physical port is being bound to. If provided, then themac_address
field of the port resource will be updated to the MAC from the active binding -
--binding-vnic-type <BINDING_VNIC_TYPE>
— The type of vNIC which this port should be attached to. This is used to determine which mechanism driver(s) to be used to bind the port. The valid values arenormal
,macvtap
,direct
,baremetal
,direct-physical
,virtio-forwarder
,smart-nic
andremote-managed
. What type of vNIC is actually available depends on deployments. The default isnormal
Possible values:
accelerator-direct
,accelerator-direct-physical
,baremetal
,direct
,direct-physical
,macvtap
,normal
,remote-managed
,smart-nic
,vdpa
,virtio-forwarder
-
--data-plane-status <DATA_PLANE_STATUS>
— Status of the underlying data plane of a portPossible values:
active
,down
-
--description <DESCRIPTION>
— A human-readable description for the resource. Default is an empty string -
--device-id <DEVICE_ID>
— The ID of the device that uses this port. For example, a server instance or a logical router -
--device-owner <DEVICE_OWNER>
— The entity type that uses this port. For example,compute:nova
(server instance),network:dhcp
(DHCP agent) ornetwork:router_interface
(router interface) -
--dns-domain <DNS_DOMAIN>
— A valid DNS domain -
--dns-name <DNS_NAME>
— A valid DNS name -
--extra-dhcp-opts <JSON>
— A set of zero or more extra DHCP option pairs. An option pair consists of an option value and name.Parameter is an array, may be provided multiple times.
-
--fixed-ips <JSON>
— The IP addresses for the port. If you would like to assign multiple IP addresses for the port, specify multiple entries in this field. Each entry consists of IP address (ip_address
) and the subnet ID from which the IP address is assigned (subnet_id
).- If you specify both a subnet ID and an IP address, OpenStack Networking tries to allocate the IP address on that subnet to the port. - If you specify only a subnet ID, OpenStack Networking allocates an available IP from that subnet to the port. - If you specify only an IP address, OpenStack Networking tries to allocate the IP address if the address is a valid IP for any of the subnets on the specified network.
Parameter is an array, may be provided multiple times.
-
--hints <key=value>
— Admin-only. A dict, at the top level keyed by mechanism driver aliases (as defined in setup.cfg). To following values can be used to control Open vSwitch’s Userspace Tx packet steering feature:{"openvswitch": {"other_config": {"tx-steering": "hash"}}}
-{"openvswitch": {"other_config": {"tx-steering": "thread"}}}
If omitted the default is defined by Open vSwitch. The field cannot be longer than 4095 characters.
-
--mac-address <MAC_ADDRESS>
— The MAC address of the port. By default, only administrative users and users with advsvc role can change this value -
--name <NAME>
— Human-readable name of the resource. Default is an empty string -
--numa-affinity-policy <NUMA_AFFINITY_POLICY>
— The port NUMA affinity policy requested during the virtual machine scheduling. Values:None
,required
,preferred
orlegacy
Possible values:
legacy
,preferred
,required
,socket
-
--port-security-enabled <PORT_SECURITY_ENABLED>
— The port security status. A valid value is enabled (true
) or disabled (false
). If port security is enabled for the port, security group rules and anti-spoofing rules are applied to the traffic on the port. If disabled, no such rules are appliedPossible values:
true
,false
-
--qos-policy-id <QOS_POLICY_ID>
— QoS policy associated with the port -
--no-qos-policy-id
— Set explicit NULL for the qos_policy_id -
--security-groups <SECURITY_GROUPS>
— The IDs of security groups applied to the port.Parameter is an array, may be provided multiple times.