搜索

第 59 章 port

download PDF

本章论述了 port 命令下的命令。

59.1. 端口创建

创建新端口

使用方法:

openstack port create [-h] [-f {json,shell,table,value,yaml}]
                             [-c COLUMN] [--noindent] [--prefix PREFIX]
                             [--max-width <integer>] [--fit-width]
                             [--print-empty] --network <network>
                             [--description <description>]
                             [--device <device-id>]
                             [--mac-address <mac-address>]
                             [--device-owner <device-owner>]
                             [--vnic-type <vnic-type>] [--host <host-id>]
                             [--dns-domain dns-domain] [--dns-name <dns-name>]
                             [--numa-policy-required | --numa-policy-preferred | --numa-policy-legacy]
                             [--fixed-ip subnet=<subnet>,ip-address=<ip-address> | --no-fixed-ip]
                             [--binding-profile <binding-profile>]
                             [--enable | --disable]
                             [--enable-uplink-status-propagation | --disable-uplink-status-propagation]
                             [--project <project>]
                             [--project-domain <project-domain>]
                             [--extra-dhcp-option name=<name>[,value=<value>,ip-version={4,6}]]
                             [--security-group <security-group> | --no-security-group]
                             [--qos-policy <qos-policy>]
                             [--enable-port-security | --disable-port-security]
                             [--allowed-address ip-address=<ip-address>[,mac-address=<mac-address>]]
                             [--device-profile <device-profile>]
                             [--tag <tag> | --no-tag]
                             <name>

表 59.1. positional 参数
概述

<name>

此端口的名称

表 59.2. 命令参数
概述

-h, --help

显示帮助信息并退出

--network <network>

此端口属于的网络(名称或 ID)

--description <description>

此端口的描述

--device <device-id>

端口设备 ID

--mac-address <mac-address>

此端口的 MAC 地址(仅限管理员)

--device-owner <device-owner>

此端口的设备所有者。这是使用端口的实体(如 network:dhcp)。

--vnic-type <vnic-type>

此端口的 vNIC 类型(直接 | 直接物理 | macvtap | normal | baremetal | virtio-forwarder, default: normal)

--host <host-id>

在主机 <host-id> 上分配端口(仅限id)

--dns-domain dns-domain

将 dns 域设置为此端口(端口需要 dns_domain 扩展)

--dns-name <dns-name>

为这个端口设置 dns 名称(需要 dns 集成扩展)

--numa-policy-required

调度此端口所需的 NUMA 关联性策略

--numa-policy-preferred

首选调度此端口的 NUMA 关联性策略

--numa-policy-legacy

使用旧模式调度此端口的 NUMA 关联性策略

--fixed-ip subnet=<subnet>,ip-address=<ip-address>

此端口所需的 ip 和/或子网(名称或 ID):subnet=<subnet>,ip-address=<ip-address> (repeat 选项来设置多个固定 IP 地址)

--no-fixed-ip

此端口没有 ip 或 subnet。

--binding-profile <binding-profile>

要传递的自定义数据以 binding:profile. data 传递为 <key>=<value> 或 JSON。(repeat 选项用于设置多个 binding:profile 数据)

--enable

启用端口(默认)

--disable

禁用端口

--enable-uplink-status-propagation

启用 uplink 状态传播

--disable-uplink-status-propagation

禁用 uplink 状态传播(默认)

--project <project>

所有者的项目(名称或 id)

--project-domain <project-domain>

项目所属的域(名称或 id)。这可用于在项目名称之间发生冲突。

--extra-dhcp-option name=<name>[,value=<value>,ip-version={4,6}]

要分配给此端口的额外 dhcp 选项:name=<name>[,value=<value>,ip-version={4,6}](repeat 选项来设置多个额外的 DHCP 选项)

--security-group <security-group>

与此端口(名称或 ID)关联的安全组(名称或 ID)(用于设置多个安全组的选项)

--no-security-group

没有与这个端口关联安全组

--qos-policy <qos-policy>

将 qos 策略附加到此端口(名称或 id)

--enable-port-security

为此端口启用端口安全性(默认)

--disable-port-security

禁用此端口的端口安全性

--allowed-address ip-address=<ip-address>[,mac-address=<mac-address>]

添加与这个端口关联的允许地址对: ip-address=<ip-address>[,mac-address=<mac-address>](repeat 选项来设置多个 allowed-address 对)

--device-profile <device-profile>

Cyborg 端口设备配置集

--tag <tag>

要添加到端口的标签(重复选项可设置多个标签)

--no-tag

没有与端口关联的标签

表 59.3. 输出格式选项
概述

-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml}

输出格式,默认为 table

-c COLUMN, --column COLUMN

指定要包含的列,可以重复显示多个列

表 59.4. JSON 格式选项
概述

--noindent

是否禁用缩进 json

表 59.5. Shell formatter 选项
概述

--prefix PREFIX

在所有变量名称中添加前缀

表 59.6. 表格式器选项
概述

--max-width <integer>

最大显示宽度 <1 要禁用。您还可以使用 CLIFF_MAX_TERM_WIDTH 环境变量,但参数具有优先权。

--fit-width

将表适合显示宽度。如果 --max-width 大于 0,则表示表示。将环境变量 CLIFF_FIT_WIDTH=1 设置为 always 启用

--print-empty

如果没有要显示的数据,打印空表。

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.