If you are a sysadmin, who is responsible for managing multiple servers, you should learn the fundamentals of virtualization and implement it in your environment.
If you have multiple hard drives installed on the server, you should first create a datastore.
Once a datastore is created, you can assign either full or part of the datastore’s storage to a virtual machine as explained in this article.
1. View Existing Disk Space Assigned to a VM
Launch vSphere Client -> Click on a specific virtual machine name from the left tree -> “Summary” Tab -> Under the “Resources” section in summary tab, it will display the following:
Provisioned: 24 GB
Not-Shared Storage: 24 GB
Used Storage: 24 GB
From here you can also notice that the datastore2 has 111.45 GB left.
Fig: Virtual machine Resources Disk Space Summary
2. Virtual Machine Properties
From the “Summary” tab, under “Commands” section, click on “Edit Settings” link, which will display the Virtual Machine properties window, as shown below.
Virtual Machine Properties -> Hardware tab -> Click on “Hard Disk 1″, which will display more details about the current disks that are assigned to the virtual machine.
Fig: Virtual Machine Hard Disk Properties
3. Add Hardware – Device Type (Hard Disk)
Click on “Add” button located at the top of the “Hardware” tab in the virtual machine properties dialogue, which will display the following add hardware wizard. Select Hard Disk and click Next.
Fig: Add Hardware Wizard – Select Hard Disk
4. Select a Disk – Create a new Virtual Disk
Select “Create a new Virtual Disk”. You also have an option of using an existing virtual disk, if it already has some space left in it.
Fig: Add Hardware Wizard – Select a Disk
5. Specify Virtual Disk Size and Provisioning Policy
In this example, since I know that datastore2 has 111 GB left, I’m using all of the available space from the datastore2.
In the Location, select “Specify a datastore” and choose the datastore where you want to create the virtual disk. In my case, I choose datastore2.
Fig: Specify Disk Size
6. Review New Disk Summary
Finally, review the options you’ve selected as shown below.
Fig: Summary of Virtual Hard Disk Creation
7. Virtual Disk created for VM
In the “Hardware” tab, you’ll now see a new hard disk listed as shown below.
Fig: New VM Hard Disk
8. Review New Disk Space for VM
Once the datastore is created, Click on a specific virtual machine name from the left tree -> “Summary” Tab -> Under the “Resources” section in summary tab, it will display that the provisioned size is 135 GB. Initially from step#1 above, it showed 24 GB. Now this shows the new virtual disk added to this virtual machine.
Reboot the virtual machine, for your operating system to pick-up this newly created disk space. If your previous disk is /dev/sda, this new disk will be /dev/sdb. You should partition and format this new /dev/sdb using fdisk mkfs command.
Fig: Virtual Machine Resources Disk Summary