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.
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
The following steps will show you how to create a VM instance with a specific IP address: