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. 

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.5, 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.

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)

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) 

You can also use the /opt/vmware/share/vami/vami_set_dns command to set a specific list of DNS servers
  • /opt/vmware/share/vami/vami_set_dns -d <domain> <DNS_IP1> <DNS_IP2>


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.