≡ Menu

VMWare ESXi 4: How to Add Virtual Hard Disk (from Datastore) to a VM Using vSphere Client

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.

On a very high-level, you should get started by installing VMWare ESXi server, which can be managed using vSphere Client.

Using vSphere client, you can create several virtual machines.

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

Add your comment

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book

Comments on this entry are closed.

  • aadilou September 20, 2010, 5:32 am

    If the new disk appears with an ‘hdparm’ then no need to reboot the virtual machine imho.

  • Anthony May 26, 2011, 10:04 am

    In step 4: Is there any benefit to using Mapped Raw LUN vs. Virtual Disk when adding a Hard Disk to a VM for storage? This is the first time I added a Hard Disk and all other disks are Mapped Raw LUNS…mine showed up as Virtual Disk beacuse I had created a datastore first then attached the datastore to the VM as a Virtual Disk. Is it OK to leave it as a virtual disk or are there performance or stability issues? This is a very basic Windows Server 2003 acting soley as a file server. I can remove the Hard Disk and start over but Im’ trying to avoid shutting down. This is VMWare 3.5 by the way.

    Thanks,
    Anthony

  • Ville October 8, 2012, 11:57 am

    I use mapped raw LUNs only when I want a VM to be able to access a native file system (EXT3/4 or NTFS), say, for backup purposes. This is in ESXi 5.1 (just upgraded).

  • Jeremy February 22, 2016, 9:27 pm

    Thank you for making this article. This article is helpful. I am migrating my system from Oracle’s VirtualBox to VMWare’s ESXi, so this article was helpful in getting started with storage in vSphere.