Introduction
While we provide pre-made images for Windows Server in mCloud, under some circumstances (BYO-Licensing etc), you may need to install Windows from ISO.
This guide runs through the process to complete this in mCloud.
This process is time consuming and can be fiddly. If you would prefer Micron21 support to complete this process in part or full for you, please contact the help desk and we would be happy to help.
Prerequisites
Summary
Below is a summary of the steps needed to create an instance from a Windows ISO you have uploaded to your mCloud project.
- Create 3 Volumes:
- Windows boot image volume.
- Windows ISO image volume.
- VirtIO-ISO image volume.
- Create an instance with these volumes.
- Start, then reboot the instance.
- During Windows setup, install VirtIO drivers.
- Install additional VirtIO drivers and QEMU guest agent on Windows.
- OPTIONAL - Run sysprep for imaging later.
- Shutdown Instance.
- Detach and delete VirtIO-ISO and Windows-ISO volumes.
- OPTIONAL - if step 6 taken, create an image from the Windows-Boot volume.
- Rename instance.
- Configure network interfaces.
Method
- Log in to the mCloud webUI.
- Go to Project > Volumes > Volumes
- Click Create Volume
- Create a boot volume with the following settings:
- Volume Name - Windows-Boot
- Volume Source - Image
- Use image as a source - Install-ISO-Windows-UEFI (this is important. See Additional Details for more information)
- Type - Default will be OK, if you want to use a specific storage type you have access to, you can
- Size (GB) - Set to 50GB
- Availability Zone - Whichever zone you are creating this instance in. Usually Kilsyth_01
- Click Create Volume again
- Create your ISO volume with the following settings:
- Name - Windows-ISO
- Volume Source - Image
- Use image as a source - Your uploaded windows ISO
- Type - Default will be OK, if you want to use a specific storage type you have access to, you can
- Size (GB) - Default is OK
- Availability Zone - Whichever zone you are creating this instance in. Usually Kilsyth_01
- Click Create Volume again
- Create your VirtIO volume with the following settings:
- Name - VirtIO-ISO
- Volume Source - Image
- Use image as a source - VirtIO-Windows-0.1.271
- Type - Default will be OK, if you want to use a specific storage type you have access to, you can
- Size (GB) - Default is OK
- Availability Zone - Whichever zone you are creating this instance in. Usually Kilsyth_01
- Click into each of these newly created volumes. Take note of the ID property for all:
- Select the flavor you will use for this deployment. To quickly see can quickly see the flavors available to you:
- Go to Project > Compute > Instances,
- Select Create Instance
- Go to the flavors tab and copy down the name
- Using the information gathered above, compile your Openstack CLI command, replacing the flavor, and volume IDs with the details gathered in steps 9 and 10.
openstack server create \
--flavor $FLAVOR_NAME \
--block-device source_type=volume,boot_index=0,delete_on_termination=false,uuid=$ID_OF_WINDOWS_BOOT \
--block-device source_type=volume,device_type=cdrom,boot_index=1,delete_on_termination=false,uuid=$ID_OF_WINDOWS_ISO \
--block-device source_type=volume,device_type=cdrom,delete_on_termination=false,uuid=$ID_OF_VIRTIO_ISO \
--availability-zone Kilsyth_01 \
--nic none \
$INSTANCE_NAME - Once you are happy with your command, use the openstack CLI to run the command.
- Back in the webui, go to Project > Compute > Instances. On your newly created instance, select the dropdown box, and select Console
- At this point, you will likely find yourself looking at an EFI shell that has failed to boot.
Ignore this, and click the "Send CtrlAltDel" button. - During the reboot, you will see the familiar windows ISO boot prompt. Click in the window and press any key to boot from the install media.
If you miss it, you can just press the "Send CtrlAltDel" button again. - Proceed with the Windows installation as normal. When you come to storage selection, click Load driver
- Browse to the virtio driver ISO, and select the appropriate version of the vioscsi driver for your version of Windows and click OK
- Click next and allow the installer to load the driver. Your boot disk should now be visible and available as an install location.
Note: Some windows installers will by default put a recovery partition at the end of the drive. You can either set up your partitions manually during install, or you can delete the recovery partition once install has completed to allow you to extend the disk - Complete the Windows install as normal and allow the system to restart once completed.
- Run through your standard Windows setup on boot, then login to the console
- Go to Explorer > VirtIO ISO. Run the Virtio-win-gt-x64.msi installer. You can install with all defaults:
- Also install the Guest Agent in the guest-agent folder:
- You can confirm these have been installed in Control Panel > Programs > Programs and Features
- Device manager should also have no more unknown devices:
- OPTIONAL - At this point, if you wish to be able to re-use this image to avoid further ISO installs, run a sysprep
- Shutdown the Instance
- Navigate to Project > Volumes > Volumes
- For the VirtIO-ISO volume, open the dropdown menu and select Manage Attachments. Detach the volume from your Instance.
- Repeat for the Windows-ISO Volume
- You can now delete the VirtIO-ISO and Windows-ISO volumes. If ever required, you will be able to re-create them using steps 6 and 8 of this guide
- OPTIONAL - If you ran a sysprep at step 25 so you can re-use this installation, open the dropdown menu for the Windows-Boot volume, and select Upload to Image. Give it a name, tick the force button as it is still "In-Use" and select Upload, then wait for completion before proceeding. This can take some time.
- Open the dropdown menu for your Windows-Boot volume and select Extend Volume. Enter the correct size you would like the volume to be and select Extend Volume
- Navigate to Project > Compute > Instances.
- Open the dropdown menu for your Windows VM, and select Edit Instance.
- Give your instance your desired name and select Save
- Open the dropdown menu again, and select Attach Interface. Choose your network and enter the IP you want to use. Repeat for all NICs you want to assign.
Note: If you are using a Micron21 public network, you will not be able to specify a fixed IP. Just leave this field blank and you will be assigned an IP automatically, which you can view by clicking on the instance name, and going to the interfaces tab. - Click Start Instance, then open the dropdown menu, and select Console. You can now log into Windows again.
- Load the disk management tool, and extend your Windows disk as you normally would.
Note: Some windows installers will by default put a recovery partition at the end of the drive. You can delete the recovery partition with the diskpart, and re-create if required after your disk extension. Refer to Microsoft documentation and Google for more information - Depending on the configuration of your Openstack networks, your NICs may get their IP's assigned by DHCP, or may have no configuration.
In either case, you can statically set your IP with the details from step 34. - From here, this is the same as any other Windows VM in Openstack. Your next actions could include setting up remote access and/or security groups.
Additional Information
Install-ISO-Windows-UEFI as Volume source
Windows VMs under Openstack are notoriously finicky. Creating our boot volume from this source image provides a whole lot of metadata to the Openstack platform about how this VM should be created and run, which is optimized for performance for Windows VMs. Some of the metadata enhancements include:
- UEFI Firmware
- Hyper-V enlightenments
- Disk bus specifications
- Boot menu enabled
- QEMU guest agent enabled
If you are interested in all of the metadata set by using this image, from the command line, you can query your volume to see the exact volume_image_metadata:
openstack volume show Windows-Boot
Disk Partitioning in Windows Installers
By default, some Windows ISOs will add the system recovery partition at the end of the disk, which prevents the disk being extended by the disk management tool.
Using diskpart, this partition can be deleted to allow you to extend the disk.
Openstack Network Setup
- If you are using a openstack network and enabled DHCP by Openstack during setup, your instances NIC will most likely be configured automatically with the correct IP address. This can be changed to a static configuration if you prefer
- While we wouldn't recommend using a public IP directly on a Windows VM, it will work. You will NOT be able to manually enter a fixed IP when attaching the interface.
Further Integrations
If you plan on deploying a lot of Windows servers from an image, you may also look into cloudbase-init
This is a piece of software that serves a similar purpose to cloud-init in linux. It can be used to automate a lot of setup on cloud deployed images, such as nic config, disk extensions, updates and more.
You would theoretically install this before your sysprep and arm it. Refer to the cloudbase-init documentation for more in-depth instructions