Tuesday, April 17, 2012

Changing router address in nutanix

On controller VMs:
1. nutanix@NTNX-Ctrl-VM-2-NTNX:/etc/network$ more interfaces (change it for startup)
gateway 10.50.80.253
2. route add default gw 10.50.80.253 ( to change it live without rebooting)
route delete default gw 10.50.80.254
3. cluster.cfg (change cluster.cfg on one and push it to others and vma)
grep gateway cluster.cfg
gateway = 10.50.80.253
4. Verify: netstat -r
5. You may have to use route delete the old address.
On VMA:
1.route add -net default gw 10.50.80.253
route delete -net default gw 10.50.80.254

2. vi-admin@pds-nxvma:/etc/sysconfig/network> cat routes
default 10.50.80.254 - -
3. Verify - netstat -r
4. cluster.cfg
5. You may have to delete the old route.
On ESXi:
/etc #


Verify:
esxcfg-route
VMkernel default gateway is 10.50.80.254
/etc # esxcfg-route -l
VMkernel Routes:
Network Netmask Gateway Interface
10.50.80.0 255.255.255.0 Local Subnet vmk0
192.168.5.0 255.255.255.0 Local Subnet vmk1
default 0.0.0.0 10.50.80.254 vmk0

VMWARE HA: isolation address
If old route is there, you may have to delete it. Vmware HA isolation IP might be using old router address, you can change it by disabling and enabling HA or changing this das.isolationaddress http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006421

Saturday, April 14, 2012

VM manipulation

1. /vmfs/volumes/4f611c3f-ca118ee2-d237-0025904c4fce/ServiceVM-1.23_Ubuntu # vim-cmd vmsvc/getallvms

2. vimcmd-vmsvc/power.getstate (power.off, if needed)

3. /vmfs/volumes/4f611c3f-ca118ee2-d237-0025904c4fce/ServiceVM-1.23_Ubuntu # vim-cmd vmsvc/unregister 8

4. /vmfs/volumes/4f611c3f-ca118ee2-d237-0025904c4fce/ServiceVM-1.23_Ubuntu # sed -i "s/NTNX-1-local-ds-NTNX/LOCAL_USSEAVM013/g" ServiceVM-1.23_Ubuntu.vmx

5. vim-cmd solo/registervm /vmfs/volumes/4f611c3f-ca118ee2-d237-0025904c4fce/ServiceVM-1.23_Ubuntu/ServiceVM-1.23_Ubuntu.vmx

6. vim-cmd hostsvc/maintenance_mode_exit, if it is in maintenance mode.

Wednesday, April 4, 2012

vmware-esxi-configuration-backup

http://www.r71.nl/kb/technical/212-vmware-esxi-configuration-backup


The commands vicfg-cfgbackup.pl (esxcfg-cfgbackup.pl) allow you to backup and restore the configuration of your ESX 3i host. Install the RCLI on your pc, download it by clicking the link on the webpage on an ESXi host.

To backup the host you would run the command.

vicfg-cfgbackup.pl --server -s

To restore your backup configuration to your host you would run the following command. This will cause the host to reboot once the process is complete.

vicfg-cfgbackup.pl --server -l

NOTES

- While this command can be used to restore your configuration, it is not a substitute for backup of your virtual machines. At this time, a new install of ESX 3i Installable will wipe out any existing datastores that exist on the host when you perform a new install.

- You can use the -q switch to supress the confirmation request that you will receive when you restore a configuratio backup or restore a host back to factory defaults.

- You must have all VMs on the host stopped and have put the host in maintenance mode. Also the build of the install on the ESX host must match the build that is recorded in the backup file. If that is not the case, you can use the -f switch to force the restore. This document is based on the 0.26 version of the RCLI and at this point both the maintenance mode and build number requirements are not enforced.

vicfg-cfgbackup.pl --server -f -l

To reset the host backup to factory defaults, use the below command. It will put the host in maintenance mode and it will not wipe out any existing datastores. Thus you will be able to add an existing virtual machines back into inventory by either manually adding the virtual machines or by restoring a configuration backup.

vicfg-cfgbackup.pl --server -r