Creating ports

Ports in OpenStack can be created using the openstack port create command. Ports are automatically created by OpenStack upon server creation or can be created and attached to instances at a later time. Users may also create ports as a method of reserving IP addresses for later use or to avoid certain addresses from being allocated by OpenStack at all.

Getting ready

You will need the following details, at a minimum, for the port:

  • Network name or ID
  • Port name

For our example, the following will be used:

  • Network name: COOKBOOK_TENANT_NET_1
  • Port name: COOKBOOK_TEST_PORT_1

How to do it…

With the OpenStack client installed on our system, we are now able to create a port with the following command:

openstack port create COOKBOOK_TEST_PORT_1 
--network COOKBOOK_TENANT_NET_1

The output will resemble the following:

How to do it…

How it works...

When a port is created in OpenStack and associated with an instance or other virtual network device, it is bound to a Neutron agent on the respective node hosting the instance or device. Using details provided by the port, OpenStack services may construct a virtual machine interface (vif) or virtual ethernet interface (veth) on the host for use with a virtual machine, network namespace, or more depending on the application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.21.108