tyu7
Contributor
Contributor

Renaming VM name

Hello

I have an ESX host which was built by a guy who worked with us but no longer with us.

We have no VC, and we use VI to access the SC.

The ESX host was rebooted and after the reboot the host had a different name! Will I need to shut down all VMs on this host before renaming? What things do I need to consider before renaming?

How do I change the hostname and how can I prevent it from getting a different name! We use MS DNS & DHCP, does this need to be assinged in DNS or DHCP?

Cheers

0 Kudos
2 Replies
lamw
Community Manager
Community Manager

Well the hostname for the ESX Server should be statically configured along with a static IP Address, it's really not recommended to have it running on DHCP and allowing your DHCP server to randomly assign it a hostname.

You'll want to edit the following areas:

#You'll want to add your default gateway and hostname entry

/etc/sysconfig/network

#This where you'll statically configure your IP Address

/etc/sysconfig/network-scripts/ifcfg-vswif0

#You'll then want to restart your networking service

service network restart

i.e.

#cat /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=hostname.domain.com

GATEWAY=a.b.c.d

#cat /etc/sysconfig/network-scripts/ifcfg-vswif0

DEVICE=vswif0

BOOTPROTO=static

IPADDR=x.y.z.a

NETMASK=255.255.255.0

ONBOOT=yes

PORTGROUP=portgroup0

MACADDR=XX:XX:XX:XX:XX:XX

You can add a local /etc/hosts entry, but just make sure you keep it up to date if you decide on changing your hostname and/or IP

dmaster
VMware Employee
VMware Employee

check the following files:

for dns connectivity

/etc/resolv.conf

search domain.co.uk

nameserver x.x.x.x

nameserver x.x.x.x

for dns hostname of the esx host

/etc/hosts

and change the real esx server name

From the console type "esxcfg-advcfg -s <your new server name> /Misc/HostName". Then restart server

  1. Do not remove the following line, or various programs

  2. that require network functionality will fail.

127.0.0.1 localhost.localdomain localhost

192.168.3.250 name.domain.co.uk name