Template to install Win7 (cannot find target hard-disk)

Hello,
I’ve created the following Windows 7 template:

CONTEXT=[NETWORK="YES"]
CPU="4"
DISK=[CACHE="writethrough",DEV_PREFIX="hd",IMAGE="win7-boot",IMAGE_UNAME="oneadmin",READONLY="yes",TARGET="hda"]
DISK=[CACHE="writethrough",DEV_PREFIX="hd",IMAGE="win7-empty-hd",IMAGE_UNAME="oneadmin",TARGET="hdb"]
FEATURES=[ACPI="yes"]
GRAPHICS=[LISTEN="0.0.0.0",TYPE="VNC"]
HYPERVISOR="kvm"
LOGO="images/logos/windows8.png"
MEMORY="4096"
NIC=[NETWORK="shared-2100",NETWORK_UNAME="oneadmin"]
OS=[ARCH="x86_64",BOOT="cdrom,hd"]
RAW=[DATA="<cpu mode = 'host-passthrough'/>",TYPE="kvm"]
VCPU="4"

The image win7-boot is the installer ISO provided by the Microsoft website.
the image win7-empty-hd is an empty datablock of 20 GB.
Upon boot, the windows installation wizard boots just fine, I choose the ‘Custom (advanced)’ procedure to install a system from scratch, but I don’t see the destination hard-disk.
See screenshot here: screenshot of installer
What could the problem be ?
I’ve already tried changing the image type from DATABLOCK to OS, without any benefit.

We are using OpenNebula 4.14.2.

Thanks for your help.
Valerio

Hi Valerio!,

if you don’t mind using VirtIO drivers which are recommended for enhanced performance when using KVM, I’d have a look at this post which explains how to install Windows 7 in OpenNebula. If you need help just post here what you need.

Your win7-empty-hd is configured with the DEV_PREFIX=“hd” which should be an IDE emulated disk and Windows should see it but it’s been a long time since I installed Windows in OpenNebula.

Cheers!

Hello,
your suggestion mostly helps, and after the installation of the virtio drivers using the Red-Hat signed files, I managed to install Windows 7.
The VM boots fine, the context files worked as expected and the OS installed.

Now the next issue: is it possible to take a snapshot of the main disk of this VM, and use it as main HD of a new VM template so that the OS boots directly with all the packages and required software installed ?

Thanks,

This is what I’ve already tried:

  • took a snapshot the disk where the OS was installed from the currently running VM;
  • clone the template of the VM and just change the storage part so that it uses the snapshot created just before, removing everything else;
  • the VM boots, but without internet connectivity: it seems the context is not being correctly configured.

The template is:

CONTEXT=[FILES_DS="$FILE[IMAGE_ID=832] $FILE[IMAGE_ID=833]",INIT_SCRIPTS="startup.vbs",NETWORK="YES"]
CPU="4"
DISK=[CACHE="writethrough",IMAGE="win7-contextualized",IMAGE_UNAME="oneadmin"]
DISK=[CACHE="writethrough",IMAGE="win-virtio",IMAGE_UNAME="oneadmin",READONLY="yes"]
FEATURES=[ACPI="yes"]
GRAPHICS=[LISTEN="0.0.0.0",TYPE="VNC"]
HYPERVISOR="kvm"
LOGO="images/logos/windows8.png"
MEMORY="4096"
NIC=[NETWORK="shared-2100",NETWORK_UNAME="oneadmin"]
NIC_DEFAULT=[MODEL="virtio"]
OS=[ARCH="x86_64",BOOT="hd,cdrom"]
RAW=[DATA="<cpu mode = 'host-passthrough'/>",TYPE="kvm"]
VCPU="4"

The file startup.vbs is the one from https://github.com/OpenNebula/addon-context-windows
But probably the way it is specified in the INIT_SCRIPTS is not correct.

Morning Valerio!
Don’t know if you’ve already tried these steps though I’ve gathered from 5.2 documentation it’s quite the same for 4.14 (http://docs.opennebula.org/4.14/user/virtual_machine_setup/windows_context.html)

  1. Contextualization in Windows requires that two files are present in C:/
  2. You’ve to do some changes in your local group policy.

This post also looks useful for troubleshooting.

Cheers!