Update ESXi hostname in OCI DNS for Oracle Cloud VMware Solution

While working with Oracle Cloud VMware Solution (OCVS), I encountered a scenario where I need to update the ESXi hostname post the OCVS SDDC was deployed.

Now, updating ESXi hostname is fairly easy as we would see but as ESXi servers are native BareMetal Instances within OCI compute, it is also important that those hostnames are also updated to maintain consistency.

Now by default for every subnet within the VCN , a private DNS Zone is created within OCI. This is by design based on the VCN resolver and the format for the DNS Domain names and Zones is as follows:

  • VCN domain name: <VCN-DNS-label>.oraclevcn.com
  • Subnet domain name: <subnet-DNS-label>.<VCN-DNS-label>.oraclevcn.com
  • Instance FQDN: <hostname>.<subnet-DNS-label>.<VCN-DNS-label>.oraclevcn.com

For an instance, you may assign a hostname. It’s assigned to the VNIC that’s automatically created during instance launch (that is, the primary VNIC). Along with the subnet domain name, the hostname forms the instance’s fully qualified domain name (FQDN):

Once we deploy the OCVS SDDC it automatically creates Private DNS Zones for the SDDC subnet which is created . This SDDC subnet has all the ESXi instances connected to it and thus DNS entry for the ESXi instances based on the Instance FQDN format is also automatically created.

Navigate to OCI > Networking > DNS Management> Zones .

Ensure you are in the right compartment

Select the Private Zones > appropriate subnet domain name.

Example : sub01234567.demolab.oraclevcn.com

These entries are protected in nature and cannot be modified directly from the OCI DNS.

Also, once there is a change in the ESXi hostname and FQDN , it needs to reflect in vCenter for which it needs to be removed from the vCenter and re-added back. Thus, I have documented the steps required to be done on OCVS and OCI to update the hostname.

  1. Put the ESXi hosts in maintenance mode in vCenter and NSX-T.
  2. Disconnect the ESXi host from the vCenter
  3. Remove the host from vCenter inventory
  4. Update hostname on VMware ESXi
    1. esxcli system hostname set –host=<hostname>
    2. esxcli system hostname set –fqdn=<hostname>sub01234567.demolab.oraclevcn.com

5. Update the ESXi name in OCI SDDC

Navigate to OCI console > VMware Solution > Software Defined Data Center > Select your SDDC

Under Resources > Select ESXi hosts

Click on the three dot symbol on the right of the ESXi host and Edit ESXi host.

Update the new hostname

6. Update the ESXi BareMetal Instance name

Under OCI console > Compute > Instances > View Instance details for the ESXi Compute Instance

7. Update the vNIC hostname

Under the same instances > Attached vNics and update the hostname.

The above step completes the config changes required in OCI, and if you go back and check the DNS records under DNS Management > Zones > Appropriate subnet domain > The NS records would be updated with the updated FQDN

8. Add the ESXi host back in the vCenter > Cluster

You will have to provide the credentials for ESXi host . Its the same vCenter credential available under SDDC.

9. Add the ESXi host in DSwitch

10. Remove the host from maintenance mode. Check NSX-T, the host should have automatically prepared within NSX-T.

11. Validate the config across vCenter, NSX-T.

Hope this blog will be helpful !!