Monday, May 7, 2012

Steps for solving :HA agent has an error : cmd addnode failed for primary node: Internal AAM Error - agent could not start. : Unknown HA error error


1. Create a new cluster.
2. Disconnect the hosts from existing cluster add to the newly created cluster. ( 1st try to add the host which is having ha issue, if it works add other hosts)
3. Add all the host in new cluster, if Ha has configure properly in all hosts,delete the old cluster and rename the new with old cluster name. ==>  still problem exists proceeded further.

4. Put the host ( in which HA agent is not configured ) in maintenance  mode. ( VMs should be  moved to other host els need to face vm reboot)
5. Login to the host using ssh  ( enabe TSM in esxi)
6. Go to /etc/hosts and add the entry of all the host in the cluster.
7. Run following commands to remove aam agent ( ESXi).
                # services.sh stop
                # /opt/vmware/aam/VMware-aam-ha-uninstall.sh
                # rm -rf /opt/vmware/
                # services.sh start.
8.  Removed  - configured scratch partition
                Connect to vCenter Server or the ESXi host using the vSphere Client.
                Select the ESXi host in the inventory.
                Click the Configuration tab.
                Click Storage.
                Right-click a datastore and select Browse.
                Create a uniquely-named directory for this ESX host  ( Eg: localscrach)
                Click Advanced Settings under Software. 
                Select the ScratchConfig section.
                Change the cratchConfig.ConfiguredScratchLocation configuration option, specifying the full      path to the directory.            Eg. /vmfs/volumes/datastore1/localscrach
8. Reboot the host.
9. Add the host to the cluster ,exit maintenance mode.
10. HA will be reconfigured with out error.

Thursday, October 6, 2011

Enable Non-root access to login to ESX 4.1i

Objective: To enable the non root users to login tech support mode to EXS 4.1 i using ssh services. By default the ESX 4.1i TS console allows only root access.

Descriptions: In ESX 4.1i root user is allowed to remotely ( ssh) logging to techsupport mode. In IT infrastructure company it is not a good practices to give root credentials to login to the host ( ESX 4.1i).This article will provide the administrator to disable direct root login to ESX i host and enable non root account to access the Remote TS mode and su to the root console.

Step by Step procedure:

Step1. Create a user.

1. Login to host using root account. ( Enable Local TS mode)
2. From console type this cmd to add a user # useradd ( user name) -M -d /


( Note: -d / switch is used to access the same root directory of root user)

Step2

3.Change the password of the user (type this command in console # passwd user name) it will prompt for password give the password for the user.


Step 3

Edit /etc/passwd file ( command : # vi /etc/passwd) the out put seems like this.

Before editing: sshuser:x:501:501:Linux User , , , :/bin/sh

Step 4

The highlighted line need to be edited .

need to editing the file like this : sshuser:x:501:501:sshuser :/ :/bin/ash

Step 5

# Use viclient or vcenter to login to ESX host

# Check the user which added in console is reflecting in Local user & Groups tab

It looks like it 501 sshuser Linux,User

Step 6

#Go to Permission tab right click and go to Add permission

#Select the user from the server and add the user

Change the user right to administrator

The out put likes this

Step 7

# log in to the server using the new user( sshuser)

Supply user credentials you will prompt to $ prompt of the user.

# The login screen looks like this

Type su – to switch to root shell it will ask for root credentials once it accept you will get # prompt.

Step 8

Log in to host using viclient or vcenter with new user ( sshuser) go to the Permission tab delete root user from it

Step 9

# Try to login to TS mode with root user & Credentials

Denied shell access to root user

You can add root user at any time in later stage.

Enjoy :)


Tuesday, January 18, 2011

VMware command

esxccfg-vswif –l will display the service console list
esxcfg-vswitch –l will display the switch information
esxcfg-vswitch –L vmnic1 vSwitch0 will uplink vmnic1 to the vSwitch0
esxcfg-vswitch – U vmnic1 vSwitch0 will unlink vmnic1 from the vSwitch0
esxcfg-vmknic –l will list vmkernal
esxcfg-mpath –l will display the storage paths and device
node numbers
esxcfg-mpath –b will display the active storage device
esxcfg-info will give the complete host info.
esxcfg-rescan –vmhba no will rescan the particular datastore
esxcfg-rescan – all will rescan all the vmhba’s
vmkfstools –v will display the datastore
vmkfstools –X 20gb /vmfs/datastore-path/.vmdk will extend the disk size to 20 gb
vmkfstools -c 4000M /path of the datastore /file.vmdk creat a new virtual disk
esxtop will display the resource utilization of the host
resxtop will be executed from vcli
ps | grep vmx to check the pid of the running vm.
vicfg-authconfig allows to add the esxi4.1 to AD.
Vmware-cmd –-server hostname -–username username –-password password –l
( this cmd will list all the registered vms)
Vmware-cmd –-server hostname -–username username –-password password path of the vmx file start
( This will start the vm )
Vmware-cmd –-server hostname -–username username –-password password stop soft
( The vm will safely shutdown)
Vmware-cmd –-server hostname -–username username –-password password stop hard
( The vm will forcefully poweroff)

Thursday, November 11, 2010

Basic vmware questions.....

1. Difference between VI3 and vSphere4 and what is the current updated version available.
2. Basic difference between ESX 3.x 3.5 & 4.x
3. What is a standard procedure to restart ESX host in production environment.
4. What is port group and explain the use of VMkernal
5. How to recover the root password in ESX?
6. Explain the difference between datacenter role and administrator role. Which would be more powerful?
7. What is the major role about the vmtools and what is the necessity to install the tool in windows and other OS.
8. Tell me some of the port number which are used for vCenter and ESX
9. What is the PSOD and how to fix it?
10. Explain HA and DRS and what are the pre-requisitive to configure both?
11. What is the min hardware requirement to install ESX 4.x
12. Default Partitions created while installing ESX server.
13. Steps to add the NFS share to ESX host.
14. What is the output of this commands esxcfg-vswif –l & esxcfg-vswitch –l ?
15. How to check the vmware version in esx host using command?
16. What is the use of vmsupport command?
17. What is the use of the following commands?
i. esxcfg-vswitch – L vmnic1 vSwitch0
ii. esxcfg-mpath –l
iii. esxcfg-mpath –b
iv. uname –r
18. Using command prompt check whether lun is connected ESX host.
19. Using cmd how to check the path of registered virtual machines file?
20. How to stop the virtual machine from command prompt?