How to create Windows VM?

hi oscar,

this might be worth a look, as can be seen in this bugreport, this message might be caused by differences between the CPU’s in your cluster. In the example posted there, the “monitor” flag is only present on the first core of a CPU.
EDIT: forgot to post the link: https://bugzilla.redhat.com/show_bug.cgi?id=873926

Can you check if you see something similar in the CPU model you use?
Check if you see any differences in the features of your cores by using:
“cat /proc/cpuinfo” on your virtualization servers.

I attach the info you have requested:

[root@vdicnode02 opt]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel® Core™ i7-2600K CPU @ 3.40GHz
stepping : 7
microcode : 0x29
cpu MHz : 3399.334
cache size : 8192 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi ept vpid tsc_adjust
bogomips : 6800.05
clflush size : 64
cache_alignment : 64
address sizes : 42 bits physical, 48 bits virtual
power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel® Core™ i7-2600K CPU @ 3.40GHz
stepping : 7
microcode : 0x29
cpu MHz : 3399.334
cache size : 8192 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi ept vpid tsc_adjust
bogomips : 6800.05
clflush size : 64
cache_alignment : 64
address sizes : 42 bits physical, 48 bits virtual
power management:

I added the link to the bugreport, i forgot that earlier. The cpuinfo you pasted shows 2 cores of one host, right ?

Do you have any servers in your cluster with different CPU’s, i.e. other generation, or intel or amd mixed ?
You can check the capabilities of your hosts with:
“virsh capabilities” and look for any differences between CPU functions.

With “virsh dumpxml (name of VM)” you can check for things like:
<feature policy='require' name='monitor'/> that might be there.

more info: https://bugzilla.redhat.com/show_bug.cgi?id=873926

https://docs.fedoraproject.org/en-US/Fedora/18/html/Virtualization_Administration_Guide/ch15s13s03.html and:
https://docs.fedoraproject.org/en-US/Fedora/18/html/Virtualization_Administration_Guide/ch15s13s04.html

here is some good documentation about cpu features you can expose to your VMs.
Either you are the unlucky owner of a CPU that shows different features per core, like the guy in the bugzilla-post, or you should remove “require monitor” from your XML’s, which can be set/unset with the docs above.

In my case, Windows 7 hang on boot was solved with the next contents as RAW data in the template:

<cpu mode='host-model'>
        <topology sockets='2' cores='8' threads='2'/>
        <model fallback='allow'/>
</cpu>

Hi, in the end, I have fixed it by setting tbe cpu host model to “Sandy Bridge”.

Thanks a lot

In my case, this setting helped:

RAW = [ DATA = "<cpu mode='host-passthrough'></cpu>", TYPE = kvm ]

Same case here!
Thanks marcindulak!
Thanks everyone!

Hi all,
I followed the instructions from VURoland in second post of this thread, but I keep seeing this:win
Am I missing something?
Any advice will be welcome!
OpenNebula5.6.1, Ceph-13 as a storage, WindowsServer2012.iso for the VM and the hdd for windows has DRIVER=qcow2.

Hello

In the second post @VURoland attached virtio-win.iso as CDROM to the VM template.

Last week I also tried to created windows based on Windows Server 2016 (it should also work with 2012).
What I did is a VM template with:

  • Windows ISO (Windows server 2012) CDROM image with driver raw
  • Virtio-win.ios CDROM image driver raw
  • Empty DATABLOCK Image with enought size (20GB for example) driver raw

Please note that using qcow2 driver didn’t work for me. I had to use raw instead.

Hope this help

Regards

Hello @jpfoures and thanks for the reply!
I changed it with empty datablock(50GB) and driver raw instead, but I ended with the screen posted in the previous post.
:frowning_face:
VirtIO.iso is also atached as a second CDROM, but the windows installer doesn’t see it.

Hello,

Did you attach the virtio-win.iso as CDROM ?

You need this during installation. When Windows server ask for a Disk, when it is not able to find it you can browse for a driver. You need to provide the path to the CDROM letter with Virtio drivers.
Once driver is installed you should see a disk of 50GB.

1 Like

@jpfoures BIG THANKS :beer:
I reattached VirtIO.iso with bus=pata(ide),driver=raw and managed to get the drivers loaded!

1 Like

hi all,
I’m trying to install W10 PRO enterprise using an ISO image but without success. I tried to follow the suggestion you all posted but something is still not correct.
Here is my template:

CONTEXT = [
NETWORK = “YES”,
SSH_PUBLIC_KEY = “$USER[SSH_PUBLIC_KEY]”,
TOKEN = “YES” ]
CPU = “4”
CPU_MODEL = [
MODEL = “core2duo” ]
DESCRIPTION = “Only used to install Windows from a CDROM”
DISK = [
IMAGE = “Win10_PRO_ENT_64bit_ISO_CDROM”,
IMAGE_UNAME = “adminveb”,
TARGET = “hda” ]
DISK = [
IMAGE = “Virtio_Windows_ISO_CDROM”,
IMAGE_UNAME = “adminveb” ]
DISK = [
IMAGE = “Win10_image_default”,
IMAGE_UNAME = “adminveb” ]
FEATURES = [
ACPI = “yes”,
APIC = “yes”,
HYPERV = “yes”,
LOCALTIME = “yes” ]
GRAPHICS = [
KEYMAP = “Italian”,
LISTEN = “0.0.0.0”,
TYPE = “VNC” ]
HYPERVISOR = “kvm”
INPUT = [
BUS = “usb”,
TYPE = “tablet” ]
INPUTS_ORDER = “”
LOGO = “images/logos/windows8.png”
MEMORY = “16384”
MEMORY_UNIT_COST = “MB”
NIC = [
MODEL = “virtio”,
NETWORK = “eurac_cluster1_network_remsen_user”,
NETWORK_UNAME = “adminzep”,
SECURITY_GROUPS = “100” ]
OS = [
ARCH = “x86_64”,
BOOT = “disk0,disk1,disk2,nic0” ]
RAW = [
DATA = “core2duo”,
TYPE = “kvm” ]
VCPU = “2”

the error I got in the log messages is the following:
Thu Jul 25 08:58:09 2019 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/474/deployment.0
Thu Jul 25 08:58:09 2019 [Z0][VMM][I]: Successfully execute transfer manager driver operation: tm_context.
Thu Jul 25 08:58:10 2019 [Z0][VMM][I]: ExitCode: 0
Thu Jul 25 08:58:10 2019 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Thu Jul 25 08:58:10 2019 [Z0][VMM][I]: Command execution fail: cat << EOT | /var/tmp/one/vmm/kvm/deploy ‘/var/lib/one//datastores/104/474/deployment.0’ ‘rseopn03.eurac.edu’ 474 rseopn03.eurac.edu
Thu Jul 25 08:58:10 2019 [Z0][VMM][I]: error: Failed to create domain from /var/lib/one//datastores/104/474/deployment.0
Thu Jul 25 08:58:10 2019 [Z0][VMM][I]: error: internal error: qemu unexpectedly closed the monitor: 2019-07-25T06:58:10.218026Z qemu-kvm: -drive file=/var/lib/one//datastores/104/474/disk.2,format=qcow2,if=none,id=drive-virtio-disk0,cache=none: could not open disk image /var/lib/one//datastores/104/474/disk.2: Image is not in qcow2 format
Thu Jul 25 08:58:10 2019 [Z0][VMM][E]: Could not create domain from /var/lib/one//datastores/104/474/deployment.0
Thu Jul 25 08:58:10 2019 [Z0][VMM][I]: ExitCode: 255
Thu Jul 25 08:58:10 2019 [Z0][VMM][I]: Failed to execute virtualization driver operation: deploy.
Thu Jul 25 08:58:10 2019 [Z0][VMM][E]: Error deploying virtual machine: Could not create domain from /var/lib/one//datastores/104/474/deployment.0
Thu Jul 25 08:58:10 2019 [Z0][VM][I]: New LCM state is BOOT_FAILURE

Could anybody tell me what I’m doing wrong?

Hi @Bart_11 ,
Below are the steps that I perform when I install windows machines. These are for WinServer2016, but Win10 are very similar:
1.Make empty datablock disk with desired size
2.Also we need windows-install.iso, one-context.iso and virtio.iso already uploaded
3.Prepare a template for VM
3a)mount windows-install.iso with Image mapping driver:RAW BUS:SCSI and mark as bootable
3b)mount virtio.iso with Image mapping driver:RAW BUS:Parallell ATA (IDE) and mark as bootable
3c)mount empty datablock disk with Image mapping driver:RAW BUS:Virtio and mark as bootable
4.Instantiate a VM
5.Select install destination and choose install driver from virtio (should be visible as D: or E: device)
6.Select folder /vioscsi/amd64 and install VirtIO drivers
7.Finish Windows installation
8.In Device Manager install driver for network and SMBus from virtio.iso
8a)for network install from folder /NetKVM
8b)for SMBus install from folder /BALOON
9.Poweroff (at this point windows-install.iso and virtio.iso can be unmounted)
10.Mount one-context-5.x.x.iso with Image mapping driver:RAW BUS:(not sure?) https://github.com/OpenNebula/addon-context-windows/releases/download/v5.8.0/one-context-5.8.0.iso
11.Power on and navigate to the device where one-context-5.x.x.iso is mounted
12.Install the executable in it
13.Reboot VM and the network should be working (at this point one-context.iso can be unmounted)
14.Enjoy your windows

1 Like

Hi thanks for your reply,
where can I mark the iso images as “bootable”? I’m using OpenNebula 5.4.6

In ONE-sunstone -> Templates -> Select your template -> Update -> OS&CPU tab -> first section is Boot and there is a checkbox under Boot order

1 Like

Hi,
thanks a lot for the suggestion!
I check my configuration and it was already checked as bootableboot_order .
The problem I’m facing now is that I can’t see any driver

my context is now as indicated here:

CONTEXT = [
NETWORK = “YES”,
SSH_PUBLIC_KEY = “$USER[SSH_PUBLIC_KEY]” ]
CPU = “4”
DESCRIPTION = “Only used to install Windows from a CDROM”
DISK = [
DEV_PREFIX = “sd”,
DRIVER = “raw”,
IMAGE = “Win10_PRO_ENT_64bit_ISO_CDROM”,
IMAGE_UNAME = “adminveb”,
TARGET = “sda” ]
DISK = [
DEV_PREFIX = “hd”,
DRIVER = “raw”,
IMAGE = “Virtio_Windows_ISO_CDROM”,
IMAGE_UNAME = “adminveb”,
TARGET = “sdb” ]
DISK = [
DEV_PREFIX = “vd”,
DRIVER = “raw”,
IMAGE = “Win10_image_data_block_default”,
IMAGE_UNAME = “adminveb”,
SIZE = “61440”,
TARGET = “hda” ]
FEATURES = [
ACPI = “yes”,
APIC = “yes”,
HYPERV = “yes”,
LOCALTIME = “no” ]
GRAPHICS = [
KEYMAP = “it”,
LISTEN = “0.0.0.0”,
PORT = “5901”,
TYPE = “VNC” ]
HYPERVISOR = “kvm”
INPUT = [
BUS = “usb”,
TYPE = “tablet” ]
INPUTS_ORDER = “”
LOGO = “images/logos/windows8.png”
MEMORY = “16384”
MEMORY_UNIT_COST = “MB”
NIC = [
MODEL = “virtio”,
NETWORK = “eurac_cluster1_network_remsen_user”,
NETWORK_UNAME = “adminzep”,
SECURITY_GROUPS = “100” ]
OS = [
ARCH = “x86_64”,
BOOT = “disk0,disk1,disk2” ]
RAW = [
DATA = “SandyBridge”,
TYPE = “kvm” ]
VCPU = “2”

Could you please help me in what I’m doing wrong?

Hmm,

Why is that Target=“sdb”? Must be empty or hd<something>
and

Target=“hda” must be empty or vd<something>.

ok I follow your suggestion
CONTEXT = [
NETWORK = “YES”,
SSH_PUBLIC_KEY = “$USER[SSH_PUBLIC_KEY]” ]
CPU = “4”
DESCRIPTION = “Only used to install Windows from a CDROM”
DISK = [
DEV_PREFIX = “hd”,
DRIVER = “raw”,
IMAGE = “Win10_PRO_ENT_64bit_ISO_CDROM”,
IMAGE_UNAME = “adminveb”,
TARGET = “hda” ]
DISK = [
DEV_PREFIX = “hd”,
DRIVER = “raw”,
IMAGE = “Virtio_Windows_ISO_CDROM”,
IMAGE_UNAME = “adminveb”,
TARGET = “hdb” ]
DISK = [
DEV_PREFIX = “vd”,
DRIVER = “raw”,
IMAGE = “Win10_image_data_block_default”,
IMAGE_UNAME = “adminveb”,
SIZE = “61440”,
TARGET = “vda” ]
FEATURES = [
ACPI = “yes”,
APIC = “yes”,
HYPERV = “yes”,
LOCALTIME = “no” ]
GRAPHICS = [
KEYMAP = “it”,
LISTEN = “0.0.0.0”,
PORT = “5901”,
TYPE = “VNC” ]
HYPERVISOR = “kvm”
INPUT = [
BUS = “usb”,
TYPE = “tablet” ]
INPUTS_ORDER = “”
LOGO = “images/logos/windows8.png”
MEMORY = “16384”
MEMORY_UNIT_COST = “MB”
NIC = [
MODEL = “virtio”,
NETWORK = “eurac_cluster1_network_remsen_user”,
NETWORK_UNAME = “adminzep”,
SECURITY_GROUPS = “100” ]
OS = [
ARCH = “x86_64”,
BOOT = “disk0,disk1,disk2” ]
RAW = [
DATA = “SandyBridge”,
TYPE = “kvm” ]
VCPU = “2”

and at least now I can see more drive


but if I choose the CD Drive E (virtio-win-0.1.1)
I got the following error

what is also strange is the fact that I can’t see the Hard drive of 60 GB where to install Windows OS

Might it be that my virtio ISO is not the correct one? if so could you please send me the link to the stable and valid version?