In this article, we are going to see how to attach and detach an extra storage to the Windows Azure Virtual Machine environment that we have provisioned in our earlier article. In our previous article we have seen the step by step approach on creating and configuring a Virtual machine that is running Windows Server 2008 R2. The virtual machine, which we provisioned, has a very limited storage of less than 50 GB; if we want to add more storage then we have an option to attach some extra external storage and can be removed whenever not necessary to be utilized in the application perspective. A data disk is basically a Virtual hard disk (VHD) that we will create either directly on to the local environment or to the cloud environment.
Data disks can be attached directly to the Virtual Machine which is provisioned with some files already available on the drive or we can create a new empty drive as well as per the requirement. But there are some of the limitations to the number of data disks based on the size of the Virtual Machine instance which we are going to utilized. Say an Extra Small instance can have only one data disk where as a Large Instance can have upto 8 data disks. Let us see the step-by-step process on how to attach and detach the disk to and from the Virtual Machines.
Steps to Attach a Disk to Virtual Machine:
Open Windows Azure Management Portal and navigate to the Virtual Machines sections where we can see a list of available virtual machines that are provisioned as well as stopped and not used as shown in the screen below:
Click on the Virtual Machine, which we created (F5debugVMWs) which will navigate to the Dashboard of the Virtual machine with the list of options to configure and monitor as shown in the screen below:
Click on the Attach button located at the bottom of the page to start attaching the disk to the Virtual Machine, which requires the additional storage as shown in the screen below:
Clicking on Attach button will show an option “Attach an Empty disk” as we don’t have any existing disk. So select the available option as shown in the screen below:
Provide the details of the Virtual Machine with the Storage Location, File Name and the Size of the data disk that need to attach as shown in the screen below:
Click on proceed button at the bottom of the page which will attach the data disk to the Virtual machine which will be listed in the Dashboard under Disks section as shown in the screen below:
Detach the disk from Virtual Machine:
Therefore, until now we have seen how to attach the data disk to the Virtual Machine, now we will see how we can detach the data disk from the Virtual Machine. Detaching is quite simple unless we need to know the name of the data disk, which we want to detach from the Virtual machine as larger instances, can have more number of attached disks.
To check the disks available as we seen in the above step login to the Management portal and navigate to the dashboard of the Virtual machine by selecting the name and we can see at the bottom the list of available disks. Each virtual machine has an operating system disk attached that you cannot detach without deleting the virtual machine. The local disk will not be listed in this section because it is not persistent.
Alternatively, we have another option to see the list of disks that are attached and mapped to the different virtual machines. To see the list of available disks attached click on the Virtual Machine and select disks, which will show the available disks as shown in the screen below:
We can see the Virtual machine disk name is auto generated to understand the name it’s been generated as the name consists of the cloud service name, the virtual machine name, and a numeric identifier. Let us see now how to detach the Disk from the Virtual machine, select the Detach disk option at the bottom of the screen as shown in the screen below:
We can see a popup window with the list of available disks, where we can select the data disk, which we need to detach and click on ok to proceed further as shown in the screen below:
We can see the process starts to detach the virtual machine data disk which we attached previously, once it’s detached we can see the data disk removed from the list of available disks as well as shown in the screen below:
Therefore, in this article we have seen how to attach and detach a virtual machines Data disk and the steps involved in diagnosing the various features of Data disk listings.