You can use cloud-init to easily configure the Address Manager or DNS/DHCP Server network configuration information on your VM by creating a local ISO image that contains the network information and mounting the ISO to an installed Address Manager or DNS/DHCP Server VM.
To configure the network configuration using cloud-init
- Log in to a local Linux machine using the command line.
-
Create a file that contains the cloud-init configuration information for the
DNS/DHCP Server network information that you would like to configure.
The following contains an example of the contents of a file called user-data:
#cloud-config bluecat_netconf: ipaddr: "192.0.2.10" cidr: "24" gateway: "192.0.2.1" hostname: "bluecat"
Attention: The IP address configured in theipaddr
field must be the same IP address as the eth0 interface. -
Create a metadata configuration file containing dsmode
information.
The following contains an example of the contents of a file called meta-data:
dsmode: local
-
From the command line of a Linux machine, generate the ISO file that will
contain the Address Manager or DNS/DHCP Server configuration information using
the following command:
genisoimage -output service-config.iso -volid cidata -joliet -rock user-data meta-data
Where
user-data
is the name of the server service configuration file andmeta-data
is the name of the metadata configuration file. - Log in to the VMware vSphere.
- Navigate to the location of the Address Manager or DNS/DHCP Server VM to be configured with the server service configuration.
-
Edit the virtual machine settings so that its virtual CD/DVD device is
configured to use the ISO image (instead of the physical CD/DVD drive).
- Select the tab for the virtual machine you just created.
- Click Edit virtual machine settings.
-
On the Hardware tab, select
CD/DVD drive. On the right side:
- Select Connect at power on.
- Select Use ISO image file.
- Click Browse and navigate to your saved ISO image file.
-
If your virtual machine is currently powered on, reboot the machine. Otherwise,
power on the virtual machine.
The virtual machine boots from the ISO image and cloud-init configures the selected Address Manager or DNS/DHCP Server.