Photon Network Manager Commands to update Hostname/IP Address/DNS in SRM & vSphere replication
search cancel

Photon Network Manager Commands to update Hostname/IP Address/DNS in SRM & vSphere replication

book

Article ID: 312686

calendar_today

Updated On:

Products

VMware Aria Suite VMware Live Recovery

Issue/Introduction

Symptoms:

  • When changing the DNS servers registered in SRM or vSphere Replication using ./opt/vmware/share/vami/vami_config_net, the tool does not reconfigure the network settings.
  • When selecting the DNS option in ./opt/vmware/share/vami/vami_config_net, the tool returns to the menu selection without allowing any reconfiguration. 
  • Unable to access the VAMI page of SRM/VR appliance.

Environment

VMware Site Recovery Manager 8.x
VMware vSphere Replication 8.x
VMware Site Recovery Manager 9.x
VMware vSphere Replication 9.x

Cause


Sometimes due to issues in the VAMI, the list of DNS servers cannot be changed in the UI. Instead then, the change must be done through the command line.

Resolution

The vami_config_net tool was an old tool that was used in SRM, vSphere Replication. Starting in SRM and vSphere Replication 8.8, the vami_config_net tool is deprecated. Any changes via command line to networking should be made using the netmgr command set.

Note: You must be logged in as root user to execute the commands below. 

To change the Hostname:
Get the system hostname.
netmgr hostname --get

Set the system hostname.
netmgr hostname --set --name <hostname>

To change DNS Servers details:
Get the list of DNS servers.
netmgr dns_servers --get

Set the DNS mode (DHCP or static) for one or more DNS servers (comma-separated list).
netmgr dns_servers --set --mode <dhcp|static> --servers <server1,server2,...>

Add a DNS server to the list of DNS servers.
netmgr dns_servers --add --servers <server>

Remove a specified DNS server from the list of DNS servers.
netmgr dns_servers --del --servers <server>

Note:

  • When changing the list of DNS servers (for example when changing networks or decommissioning old DNS servers), it is suggested to remove the current DNS servers first, then add the new ones. This is because there is a limited number of DNS servers that can be registered to the SRM server or vSphere Replication appliance. However the first DNS server can not be deleted.

  • Times when DNS entry may show stale and may not delete, In such cases restart the Appliance services for SRM/VR using below commands following which run Remove DNS server command - netmgr dns_servers --del --servers <server>

    Service restart For SRM
    sysmtemctl stop srm-server
    systemctl stop dr-client

    systemctl start srm-server
    systemctl start dr-client

    Service Restart For VR 
    systemctl stop hms
    systemctl stop hbrsrv
    systemctl stop dr-client

    systemctl start hms
    systemctl start hbrsrv
    systemctl start dr-client

    This needs to be run on command line

To change the ipv4 Address:
Get the IPv4 address for the specified interface
netmgr ip4_address --get --interface <ifname>

Set the IPv4 address 
netmgr ip4_address --set --interface <ifname> --mode <dhcp|static|none> --addr <ipv4_address/prefix> --gateway <gateway_address>

Below commands to be used to restart service. 
systemctl restart systemd-networkd (For network)
systemctl restart systemd-resolved  (For DNS)

For SRM/VR VAMI access issues, ensure that the IP configuration of the SRM or vSphere Replication appliance includes the correct DNS server and default gateway.
If the configuration is incorrect, update the DNS and IPv4 gateway settings using the steps provided above.

Additional Information

A full list of network related commands for Photon can be found in the related github

Photon Network Manager Command-line Interface (netmgr) 

For SRM / vSphere Replication 8.7 or below, you can also use the /opt/vmware/share/vami/vami_set_dns command to set up to two DNS servers,
  • /opt/vmware/share/vami/vami_set_dns [-d <domain>] [ -s <searchpath>] DNS_Server_1 [DNS_Server_2]



Impact/Risks:

Note: When making networking changes such as editing the list of DNS servers here, there can be unintentional outages as the current connection to the server in question is being changed. It is recommended that these changes be done during a maintenance window, and the changes be done via the VM's console.