官术网_书友最值得收藏!

Creating a Port without an associated instance using the OpenStack CLI

Port is another building block in OpenStack Neutron. You will not find a way to create a Port using the Horizon dashboard. As we saw earlier in the Associating a Network to an instance using Horizon recipe, a Port is created implicitly as a part of the create instance operation from the dashboard. However, using CLI, some advanced networking configuration can be accomplished. This recipe shows you how to create a Port using OpenStack CLI.

Getting ready

You will need the following information to get started:

  • The login credentials for SSH to a node where the Neutron client packages are installed
  • A shell RC file that initializes the environment variables for CLI

How to do it…

The next set of steps will show you how to use Neutron CLI to create a Port:

  1. Using the appropriate credentials, SSH into the OpenStack node where the Neutron client software packages are installed.
  2. Source the shell RC file to initialize the environment variables required for the CLI commands as seen in the previous recipe.
  3. The command to create a Port is neutron port-create and the only mandatory parameter is the Network name. However, it is a good practice to specify a name for the Port:
    How to do it…
  4. Note that the Port has been assigned a MAC address as well as an IP address.
  5. You can use the neutron port-list command to view a list of all the Ports in the system:
    How to do it…

How it works…

A Port primarily represents an endpoint in a Network. The most common Ports in an OpenStack environment are the virtual interfaces in a virtual machine.

When the neutron port-create command is executed, OpenStack Neutron allocates a unique MAC address to the Port. The Network name argument effectively helps Neutron in identifying a Subnet and then Neutron assigns an IP address to the Port from the list of available IP addresses in the Subnet.

The post-create request is also the most common trigger to configure the physical and virtual Networks using the appropriate drivers.

主站蜘蛛池模板: 边坝县| 天津市| 宁海县| 贵港市| 贵港市| 成武县| 黑龙江省| 淮安市| 手机| 吴旗县| 德保县| 淳安县| 兴安盟| 神木县| 黔江区| 沁源县| 达拉特旗| 大足县| 青河县| 兰溪市| 玉山县| 囊谦县| 长丰县| 东方市| 永靖县| 阿鲁科尔沁旗| 左权县| 巴彦县| 庐江县| 钟祥市| 朝阳县| 高清| 巴彦县| 吉林省| 凤凰县| 洛阳市| 沙洋县| 缙云县| 宁波市| 东乡| 吴忠市|