使用 Heat 在 Openstack 中配置网络 MTU
Configure network MTU in Openstack with Heat
在 Openstack 中使用 heat 模板创建网络时是否可以配置网络的 mtu?
我可以通过 CLI 设置 mtu openstack network --mtu <value> <network_id>
我在热导中看到了对 mtu 的引用,但它似乎不允许设置该值。
是的,可以使用热模板设置 MTU。您必须使用 value_specs
字段,它允许您使用其他属性。在此处查看其非常糟糕的文档:
我使用以下简单的热模板对其进行了测试:
heat_template_version: 2013-05-23
description: tests network
resources:
demo-network:
type: OS::Neutron::Net
properties:
name: demo-network
value_specs: { mtu: 1400 }
它确实创建了一个 MTU 为 1400 的网络,就像在模板中设置的那样。用显示命令检查它:
root@test-node:~# openstack network show demo-network
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up | UP |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2020-05-16T13:33:53Z |
| description | |
| dns_domain | None |
| id | 965d890f-0c37-400e-8ee0-ec6ce1fcf4e6 |
| ipv4_address_scope | None |
| ipv6_address_scope | None |
| is_default | None |
| is_vlan_transparent | None |
| location | cloud='', project.domain_id=, project.domain_name='Default', project.id='2dacaa8f6d3348f28e126b371bf1dfab', project.name='admin', region_name='RegionOne', zone= |
| mtu | 1400 |
| name | demo-network |
| port_security_enabled | True |
| project_id | 2dacaa8f6d3348f28e126b371bf1dfab |
| provider:network_type | vxlan |
| provider:physical_network | None |
| provider:segmentation_id | 60 |
| qos_policy_id | None |
| revision_number | 1 |
| router:external | Internal |
| segments | None |
| shared | False |
| status | ACTIVE |
| subnets | |
| tags | |
| updated_at | 2020-05-16T13:33:53Z |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
在 Openstack 中使用 heat 模板创建网络时是否可以配置网络的 mtu?
我可以通过 CLI 设置 mtu openstack network --mtu <value> <network_id>
我在热导中看到了对 mtu 的引用,但它似乎不允许设置该值。
是的,可以使用热模板设置 MTU。您必须使用 value_specs
字段,它允许您使用其他属性。在此处查看其非常糟糕的文档:
我使用以下简单的热模板对其进行了测试:
heat_template_version: 2013-05-23
description: tests network
resources:
demo-network:
type: OS::Neutron::Net
properties:
name: demo-network
value_specs: { mtu: 1400 }
它确实创建了一个 MTU 为 1400 的网络,就像在模板中设置的那样。用显示命令检查它:
root@test-node:~# openstack network show demo-network
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up | UP |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2020-05-16T13:33:53Z |
| description | |
| dns_domain | None |
| id | 965d890f-0c37-400e-8ee0-ec6ce1fcf4e6 |
| ipv4_address_scope | None |
| ipv6_address_scope | None |
| is_default | None |
| is_vlan_transparent | None |
| location | cloud='', project.domain_id=, project.domain_name='Default', project.id='2dacaa8f6d3348f28e126b371bf1dfab', project.name='admin', region_name='RegionOne', zone= |
| mtu | 1400 |
| name | demo-network |
| port_security_enabled | True |
| project_id | 2dacaa8f6d3348f28e126b371bf1dfab |
| provider:network_type | vxlan |
| provider:physical_network | None |
| provider:segmentation_id | 60 |
| qos_policy_id | None |
| revision_number | 1 |
| router:external | Internal |
| segments | None |
| shared | False |
| status | ACTIVE |
| subnets | |
| tags | |
| updated_at | 2020-05-16T13:33:53Z |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+