VMware Cloud Community
VMCHIS
Enthusiast
Enthusiast

VCSA 5.5 Hostname Change Problem

Hi,

I am working on getting a new implementation of VCSA v5.5 up and running and I have the VM created and working, but I am having an issue changing the name of the server.  I am running the /opt/VMware/share/vami/vami_config_net program and setting the new name.  I then exit the program and reboot the VM and the old name comes back instead of the new name.  I have even tried setting the hostname using the Linux HOSTNAME command and it looks like it takes, but once again, as soon as I reboot the server, it reverts back to the old hostname.

Any ideas what is going on?

Thanks,

Sean

13 Replies
VMCHIS
Enthusiast
Enthusiast

nobody?

0 Kudos
neu-wolf
Contributor
Contributor

I met the same issue, you can check the /opt/vmware/var/log/vami/vami-ovf.log. if there's messages similar to  "The network for interface eth0 is managed internally, networking properties ignored", it is expected since the OVF settings is used to this VCSA.

While I am still struggle with the detailed solution for how to keep the hostname reserved and will update you once there's effective solution.

0 Kudos
VMCHIS
Enthusiast
Enthusiast

I got the answer from VMware support.  This is what I did to fix it.

edit /etc/sysconfig/networking/devices/ifcfg-eth0

     - Insert: HOSTNAME='newname.fqdn' (before IPADDR line)

     - Save and Quit

Run: /opt/VMware/share/vami/vami_config_net and change hostname

Check /etc/hosts and make sure the name changed

Run the web admin and go to the Admin page and set "yes" to "Certificate Regeneration Enabled"

Reboot and the new name will stick now.

Seems to be a bug or an "undocumented feature" and support is checking with developers on why it is happening, since it is not happening on their own internal servers.

0 Kudos
HDSR
Contributor
Contributor

This is not working for us, after reboot I still have the old hostname, we changed the /etc/sysconfig/networking/devices/ifcfg-eth0 and run /opt/vmware/share/vami/vami_config_net and change hostname

And we checked the /etc/host all looks we did a "yes" to "Certificate Regeneration Enabled" but after reboot we get the same old host name..

I hope VMware will solve this bug soon.

Second question: we like to change the vcenter to a other vlan and IP-address but when I change the ipaddress to a nother vlan the machine gets isolated and I cannot manage the distributed switch poort where the vcenter connects to. Is there a solution for this problem?

0 Kudos
JeffDe
Contributor
Contributor

I also followed the above instructions and the hostname reverted back after reboot.  The ifcfg-eth0 file kept the new hostname, the hosts file kept the new hostname.  However, the hostname command shows the old name as does the vCenter Appliance Management/Network page.

0 Kudos
jordabi
Contributor
Contributor

I just downloaded and installed the vCenter appliance today, and was able to set a static IP and change the hostname just fine using the web client.  simply launch the appliance, go to the Network tab and select the Address button.  Under etho info, choose static as the IPv4 Address Type and fill in the desired info.  You do not need to reboot, but I did to ensure the changes persisted after the reboot. They did.

0 Kudos
manu1305
Contributor
Contributor

0 Kudos
lapolonio
Contributor
Contributor

I noticed that outside the vm, in the vm config properties, you have to edit the settings as well.

ovfproperties.jpg

Also there was an unusual issue with time where my root password would expire.  I booted from a custom live CD and was able to edit /etc/shadow using a known hash. 

VCP082242
Contributor
Contributor

The recommended fix in the KB did not work for me.

I tracked this to bad error checking in vami_set_hostname.  The boot problem could be fixed with a one-liner in /opt/vmware/etc/init.d/vaos, but other programs call vami_set_hostname too, so I decided to neuter it.  I don't like programs that change my config files anyway....

Read the code below, understand what it does, cut-and-pasted into vCMA root console.

##

# Set your host name and fully qualified domain name manually

# in vi :w write the current file, :n move to next file. :q to quit

vi /etc/hosts /etc/hostname /etc/sysconfig/network


##

# Save a copy if the original file

cp /opt/vmware/share/vami/vami_set_hostname /opt/vmware/share/vami/vami_set_hostname.baq


##

# Make the bad script behave

sed -i '/FQDN=\$HOSTNAME/i HOSTNAME=\`hostname\`' /opt/vmware/share/vami/vami_set_hostname

sed -i s/^grep\ -v/#grep\ -v/ /opt/vmware/share/vami/vami_set_hostname

sed -i s/^echo\ \"127/#echo\ \"127/ /opt/vmware/share/vami/vami_set_hostname

sed -i s/^echo\ \"\$FQDN/#echo\ \"\$FQDN/ /opt/vmware/share/vami/vami_set_hostname


##

# Verify the changes made by sed

diff /opt/vmware/share/vami/vami_set_hostname /opt/vmware/share/vami/vami_set_hostname.baq


This solved my problems. 



0 Kudos
TincturaGinseng
Contributor
Contributor

For SLES use /etc/HOSTNAME instead /etc/hostname


vi /etc/HOSTNAME

0 Kudos
ojoo
Contributor
Contributor

Just change the address type from DHCP to static in de Vcenter server appliance under Network=> Address, then the option to change the host name appears.

0 Kudos
ciceroripi
Contributor
Contributor

Check this out. This is the only process that worked for me.

http://vmtoday.com/2014/04/vcva-network-settings-reverting/

You basically have to shutdown the appliance, go to the VM settings and change the hostname under the vAPP Options.

Turn on again, and should come up fine!

0 Kudos
sanjeebkumar
VMware Employee
VMware Employee

After changing networking parameters, run this command before rebooting

/opt/vmware/share/vami/vami_ovf_process --setnetworkexternallymanaged eth0


It should solve the problem.




0 Kudos