Creating an instance with a specific IP address
The VM instances are typically used to host IT applications. Some applications require that a particular VM server should have a specific, fixed IP address. When DHCP is enabled, the virtual machine gets an IP address dynamically. This recipe shows you how we can assign a specific IP address to an instance.
Getting ready
A VM with a specific IP address can only be created using the OpenStack CLI. It involves a Port creation followed by an instance creation. As a prerequisite, ensure that a Network is created with the following attributes:
- Network name: Cookbook-Network-5
- Subnet name: Cookbook-Subnet-5
- Subnet IP address range: 20.20.20.0/28
How to do it…
The following steps will show you how to create a VM instance with a specific IP address:
- Using the appropriate credentials, SSH into the OpenStack node where the Neutron client software packages are installed.
- Source the shell RC file to initialize the environment variables required for the...