You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Cloudbase.it provides tools for creating OpenStack-ready cloud images. They've created a Windows Server 2012R2 images, which is ready for use (download and instructions here). This image is already imported into our environment.

If you need an another Windows Version, you must build the image yourself, with good help from the automated cloudbase-scripts. It is recommended to create the image on a Windows 10 host or VM. The following examples is a list of what we did to create a cloud ready Windows 10 image.

  1. Install the Windows 10 ADK (download) and choose only Deployment Tools
  2. Download the Windows 10 Enterprise Evaluation ISO, and mount it in your host/VM (you need to login with your Microsoft account to download ISOs)
  3. Download the stable amd64 virto-win iso, following this link
  4. Download the Windows OpenStack Imaging Tools
  5. Change the following:
    1. UnattendTemplate.xml: Change InputLocale and UserLocale from en-US to nb-NO

    2. Added ntnu_wallpaper.png to the UnattendResources-folder
    3. UnattendResources\Specialize.ps1:
      1. Change the line with Wallpaper.png to ntnu_wallpaper.png (do not change the destination filename in the copy-command, as the wallpaper is set through an imported local GPO)
    4. UnattendResources\Logon.ps1:
      1. Add the following to commands: netsh advfirewall firewall add rule name="All ICMP V4" protocol=icmpv4:any,any dir=in action=allow and netsh advfirewall firewall add rule name="All ICMP V6" protocol=icmpv6:any,any dir=in action=allow
  6. Create the following powershell-script, modify the three path-variables, and run it:
  7. CreateOpenStackImage.ps1
    Import-Module .\windows-openstack-imaging-tools-master\WinImageBuilder.psm1
    $virtualDiskPath = "C:\path\to\diskfile.raw"
    $wimFilePath     = "<windowsiso-mountpoint>\sources\install.wim>"
    $virtIOISOPath   = "C:\path\to\virtio-win-x.x.xxx.iso"
    $images = Get-WimFileImagesInfo -WimFilePath $wimFilePath
    $image = $images[0]
    New-WindowsCloudImage -WimFilePath $wimFilePath -ImageName $image.ImageName -VirtualDiskFormat RAW -VirtualDiskPath $virtualDiskPath -SizeBytes 18GB -VirtIOISOPath $virtIOISOPath -InstallUpdates
  8. You now have a .raw diskfile, which contains a Windows 10-installation that will automatically run sysprep once booted. Now you have to choices:

    1. Import the .raw file to glance (see Upload new images), and spawn an instance from the new image
    2. Create a new local KVM-vm (on a Linux host), be sure to choose a virtio NIC, attach the .raw-file, boot the VM
  9. Wait for the instance to shutdown (it will install updates, run the powershellscripts Logon.ps1FirstLogon.ps1 and Specialize.ps1 and finally run sysprep
  10. If you chose 8a, create a public snapshot of the instance. This snapshot is your new cloud ready Windows 10 image.
  11. If you chose 8b, upload the .raw-file to glance (Upload new images)

When you spawn a Windows instance, be sure to attach a keypair. Cloudbase-init will generate a random password for the user Admin, which can be retrieved with:

Retrieve admin-password
nova get-password <instance-id> <private-key-file>

NOTE: There is a known issue with Windows 10 - the hostname will not be set to wahtever you chose for instance name. This might be fixed in the future... (Link)

  • No labels