/How to change the IP address in a vCloud Director

How to change the IP address in a vCloud Director

Sometimes we need to change IP addresses in our systems, and some are easy than others. In his blog post, we will discuss how to change the IP address in a vCloud Director.

I will show how to change the IP address in a vCloud Director in a Linux vCD and a vCD Appliance.

Environment:

  • Linux CentOS7 vCloud Director 10.2.x
    • 2 vNIC with 2 IPs
      • IP1: 192.168.1.110/24 – Used for HTTP and Console Access (primary and console IP)
      • IP2: 192.168.1.111/24 – Used for DB (database host IP)
  • vCloud Director Appliance 10.2.
    • 2 vNIC with 2 IPs
      • IP1: 192.168.1.110/24 – Used for HTTP and Console Access (primary and console IP)
      • IP2: 192.168.2.110/24 – Used for DB (database host IP)
  • New IPs
    • IP1: 192.168.1.112/24
    • IP2: 192.168.1.113/24

Pre-checks or changes.

  1. Check the NFS shared folder permissions in your NAS. If you are setting those permissions per IP, do not forget to add the new IPs.
  2. Check your DNS names. If you plan to use the same DNS name, do not forget to set new IPS with the same DNS name.
  3. If you will use different IPs and DNS names and using Custom CA Signed Certificates, you need to add the new certificates to vCD. For self-signed certificates, no changes are needed.
  4. If you connect to your vCD using ssh, do not forget that you will lose connection after you change the eth0 interface IP. Use VM remote console instead.

In a Linux vCloud Director.

For the Linux version, you change your IP like in any normal Linux system. For this case, since I am using a CentOS7, I will use the nmtui network tool from CentOS.

These are the original IP addresses.

How to change the IP address in a vCloud Director

Running the nmtui Network management tool, we can easily change the IP addresses. Or you can do it manually, like in a normal Linux system.

How to change the IP address in a vCloud Director

After changing the IP addresses, restart the network service, and you should now have the new IPs.

How to change the IP address in a vCloud Director

Note: Do not forget to change your NFS shared folder settings. In my case, I needed to change my Sinology NFS Shared folder permissions to see the new IPs since I have set per IP.

After adding the IPs and run mount, I mounted -a Shared folder, and I can start and run the vCD configuration tool.

When you run the vCD configuration tool, you should get an error(cannot connect to DB), which is normal since the IP is different and cannot connect to the DB. Just follow the steps and enter the new IPs and your DB name and user. In the end, your vCloud Director should be ready to be used.

Now we have new IPs in our Linux CD, let us test.

As we can see above, the new IPs are working, and all vApps/VMs are power on.

In a vCloud Director Appliance.

These are the original IPs from vCD Appliance.

The vCD Appliance changing IPs is a bit different since some vami scripts do this automatically.

Inside the folder /opt/vmware/share/vami there are scripts to change our vCD Appliance.

In this case, we will use the script vami_config_net. With this script, we can change IPs, default gateway, DNS, and hostname.

1. First stop vCD Appliance Servcd /vice.

2. Run the script vami_config_net and change the first IP address that is in eth0.

3. Select option 7 to change the second IP address that is in eth1.

4. Select option 0 to check the new settings.

Select 1 to exit the menu script.

As we can check in the above settings, the hostname is the same. If you need a new hostname, use the same script to make those changes. So again, check if you want to use the same DNS name or change it. Do the changes in your DNS accordantly.

The new IP addresses are set.

Note: If you have your NFS shared folder, set the permission per IP, do not forget to change your NFS shared folder settings.

5. Now, we need to reconfigure vCD to see the new IP addresses. Again we need to use the vCD configuration tool /opt/vmware/vcloud-director/bin/configure.

After adding the IPs and run mount -a Shared folder was again mounted, and I can start and run the vCD configuration tool.

As we can notice above, the process is similar to what we used in the Linux CD configuration.

Note: Again, if you use certificates that rely on IPs and DNS Names, you need to change your certificates in vCD.

6. Re-import vCenter, NSX-V, or NSX-T used in your vCD Appliance.

7. Start your vCD Appliance service.

Now vCD is all set to use the new IPs.

Again after the changes, all services, vApps, and VMs are running fine.

With this last step, we finish this process and blog post How to change the IP address in a vCloud Director. I hope it can help you make this kind of change in your vCD.

Share this article if you think it is worth sharing. If you have any questions or comments, comment here, or contact me on Twitter.

©2021 ProVirtualzone. All Rights Reserved
By | 2021-05-30T19:22:53+02:00 May 30th, 2021|vCloud Director, VMware Posts|0 Comments

About the Author:

I have over 20 years of experience in the IT industry. I have been working with Virtualization for more than 15 years (mainly VMware). I recently obtained certifications, including VCP DCV 2022, VCAP DCV Design 2023, and VCP Cloud 2023. Additionally, I have VCP6.5-DCV, VMware vSAN Specialist, vExpert vSAN, vExpert NSX, vExpert Cloud Provider for the last two years, and vExpert for the last 7 years and a old MCP. My specialties are Virtualization, Storage, and Virtual Backup. I am a Solutions Architect in the area VMware, Cloud and Backup / Storage. I am employed by ITQ, a VMware partner as a Senior Consultant. I am also a blogger and owner of the blog ProVirtualzone.com and recently book author.

Leave A Comment