Friday, June 24, 2011

Add a second virtual disk to store your logs:
Power off vMA
Add a second virtual disk to the vMA VM
Power on vMA
Login using vi-admin
Format the new Disk with the following command: fdisk /dev/sdb
Use the n command to create a new partition
Use the p command to make the new partition a primary partition
Press 1 to make it partition #1
Use the default for the First Cylinder
Use the default for the Last Cylinder
Use the p command to verify the partition table
Use the w command to write the partition table to the hard disk
Press Enter a couple of times to confirm it's finished and return to the command prompt
Now we need to format the partition using the follow command: sudo mkfs -t ext3 /dev/sdb1

Now we have our new disk ready, we now need to mount it:

Edit /etc/fstab using the following command: nano /etc/fstab
Enter in the following line: /dev/sdb1 /var/log/syslog ext3 defaults,auto 1 2
Use Ctrl+X then y to save the file
Next: cd /var/log/ then mkdir syslog
Change the owner of the /syslog dir: sudo chown vi-admin:root /var/log/syslog
finally mount /var/log/syslog to mount the disk

Ok, now our new disk is mounted, we need to tell the vilogger application to store your logfiles there. The default location is /var/log/vmware so we need to change it:

Save the rule to make sure that it stays there after a reboot:sudo service iptables save

Configure the ESXi host using vMA to send those logs to vMA:vifptarget -s vmsrv.address.localvicfg-syslog -s vMA.address.local
For the free ESXi you can use vSphere Client to configure syslog:
From the Advanced Settings of the Configuration tab select Syslog and set the Syslog.Remote.Hostname parameter to the IP address of vMA