Showing posts with label VMware. Show all posts
Showing posts with label VMware. Show all posts

Friday, September 14, 2012

Scan and Detect a new disk added from VMware to a Linux VM.

Scan and Detect a new disk added from VMware to a Linux VM

1. Before scanning a VMware SCSI disk, make a note of an already available disks on the server with "fdisk -l" command and the LUN ids from "cat /proc/scsi/scsi" file.



 2. Check how many scsi hostid's present in "ls -l /sys/class/scsi_host". I had only one scsi hostid (host0) present in the server as below,


3. Now lets scan and detect the VMware Scsi disk assigned to this server with the below command,

echo "- - -" > /sys/class/scsi_host/hostx/scan - where x is the hostid from the "ls -l /sys/class/scsi_host" output.

Had executed the below since i had only one hostid "host0".

echo "- - -" > /sys/class/scsi_host/host0/scan


4. For the servers who have more scsi host id's, execute the below forloop script to scan the new disks.

"for a in `ls /sys/class/scsi_host`; do echo $a; echo "- - -" > /sys/class/scsi_host/$a/scan; done"

5. Now verify the new disk on the server with "fdisk -l" command and the LUN ids from "cat /proc/scsi/scsi" file.



6. At next we will format the new disks in Linux LVM and create a FileSystem. 

Adding an additional disk in VMware for Linux VM

Adding an additional disk in VMware for Linux VM

1. Right click on the VM which you need to add a disk and goto settings from your VMware Workstation.

You will get the below window,


2. Make a note of already assigned disk to the VM. And click on Add.

3. Select Hardisk and click on next,


4. Select any one of the option from below, which ever suits the environment. I prefer the first one since it is my home machine.


5. Since my VM is currently active and i wanted to add the disk on the fly, i got below option only with SCSI disk.


6. Mention the required size of the new disk, Allocate all disk space should be enabled if it going to be a production environment, else the disk will grow by the usage till it reaches the required size.


7. Specify the name of the new disk file to be created and on which path or partition where you got the required disk space. And click on Finish.



8. We are done now, verify the disk is added here on the below box and click on OK.


9. Now click here for how to get the disk on the VM or Server.

Pages