Creating a Base Image for Virtual Machine Role on Windows Azure

I am assuming you have windows server 2008 R2 and hyper V installed on the server.

  1. Open Hyper-V manager and connect to Hyper-V server.

    windowsazure1.gif

  2. Now select the server, then right- click on it. And select New and click Virtual Machine.


    windowsazure2.gif

  3. It opens a New Virtual Machine Wizard. On the Specify Name and Location tab, specify the name for virtual machine. If you want to change location of the image, you can also do this by specifying the new location, and click Next.

    windowsazure3.gif

  4. Now in the Assign Memory step specify the memory allocated to VM. This amount can range from 8MB- 10236 MB. In our demo we will set it to 2048 MB, and click Next.

    windowsazure4.gif

  5. Next, in the Configure Networking step, select Local Area Connection - Virtual Network and then click Next.

    windowsazure5.gif

  6. Next, in the Connect Virtual Hard disk step, select the Create a virtual hard disk. Specify the name of the disk. If you want to change the location you can change it here. Set the size of the disk. If you want to choose an existing disk, you have to choose Use an existing virtual hard disk option, and browse to the disk location. If you are using an existing disk, you can skip the OS installation section.

    Note - The image file must contain a single partition with the OS installation and must not include a recovery partition.

    windowsazure6.gif

  7. Now, since we are creating a new disk we need to specify how OS (Windows server 2008 R2 Enterprise Edition) will be installed. Here are different options, either you can install OS later, or can install it from CD/DVD or from a network. Here we are using an .iso image for installing OS. So select the option Install an operating system from a boot CD/DVD-ROM. And select the image file and browse to the location. Now click next.

    windowsazure7.gif

  8. Click finish to create the virtual machine.

    windowsazure8.gif

  9. Now in the Hyper-V it shows the newly created virtual machine. If it not showing then refresh it.

    windowsazure9.gif

  10. Now right click the newly created machine and click Connect… Now click on the start as shown in figure to start the virtual machine.

    windowsazure10.gif

  11. Now it will start installing the windows server 2008 R2 from the specified location. If it doesn't start installation then might be installation location is incorrect. If the location is correct it asks for choosing language, currency format. Now click next.

    windowsazure11.gif

  12. Click Install Now to start installation.

    windowsazure12.gif

  13. Choose the windows Server 2008 R2 full installation and click Next. And accept the terms and conditions.

    windowsazure13.gif

  14. Now choose the custom installation.

    windowsazure14.gif

  15. When it prompts for installation like

    windowsazure15.gif

    By default installation creates a recovery partition automatically. But for VM role we need only single partition. So to configure it Now press SHIFT+F10 to open command prompt. At command prompt enter following commands:

    diskpart
    select disk 0
    create partition primary
    exit

    diskpart command will launch the diskpart tool. Now select the disk 0 and make this partition as primary. And exit from the diskpart tool.

    Now close the command prompt.
     
  16. Now continue the installation.
  17. Once the installation is complete it reboots and ask for login for the first time.

Now enter the login password and continue.

windowsazure16.gif


Similar Articles