Managing Virtual Machine Disks

Here, we are going to see how to add some additional disks to the Windows VM that we created in the previous article. Go to the disk section and there, you can see that only one OS disk is available and there is an option to add Data Disks. You can have another data disk to store the data in some scenarios where you don’t want to use the same OS disk for storing the data.


When you try to create one new, it will give an error message that you don’t have any managed disks available and an option to create one.


While creating a new one, it will ask for further details to create one where I am giving a name as DemoVmDisk2 and grouping it to the same resource group with a premium storage.

Here, I am going to create the disk using an empty disk, which will be a blank disk, like putting a brand new hard drive into a computer. The other options you can see there are that we can build a disk based on a snapshot that we took earlier or even a VHD that we have out in blob storage.
 
Currently, the maximum size of a page blob is 1 terabyte which may be increased in future. Now, let us go ahead and just create this disk.


Now, you can see that our new disk is ready to get added and you can save the changes.


Adding a disk here alone will not show a disk there on your PC; for that, you have to update a configuration in the server. RDP to the server then Server Manager >> File and Storage Services >> Volumes >> Disks, where you can see an unknown one terabyte disk.


Right click on it and create a new volume and complete all the remaining steps. After that, in the Windows Explorer, go to "This PC" where you can see that we have this new volume that's just about 1 terabyte in size.


Next, we can scale the size of a virtual disk that is already been created. For that, we can do a scaling for our C drive here which is just only 126 GB to 1 TB.

Prior to scaling, it is important that you have to stop the server at the portal. It is very important to stop the server at the portal as shutting down the server from the start menu will give a window as follows, with a status saying the server is stopped while still incurring the compute charges. That means you are still paying for the VM.


So, if you don’t want to pay, you have to stop from this dashboard not from the operating system and for scaling also we have to stop the server running from the portal itself. Once you stopped and selected the OS disk from the disk section you can see the option to scale up. Here I am scaling to 1023 GB and click on save.


Start the virtual machine back and extend the volume from the server manager, then if you check the file explorer now you can see that the drive has scaled up.