Help: Error creating Linux VM on Azure

Hello,

Connection to Azure seams to be working fine, but when trying to create a Linux VM (Ubuntu), I’ve been getting the following error on the VM log window:

Tue Feb 20 10:33:55 2018 [Z0][VM][I]: New state is ACTIVE
Tue Feb 20 10:33:55 2018 [Z0][VM][I]: New LCM state is PROLOG
Tue Feb 20 10:33:55 2018 [Z0][VM][I]: New LCM state is BOOT
Tue Feb 20 10:33:55 2018 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/114/deployment.0
Tue Feb 20 10:33:55 2018 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Tue Feb 20 10:34:06 2018 [Z0][VMM][I]: Command execution fail: /var/lib/one/remotes/vmm/az/deploy ‘/var/lib/one/vms/114/deployment.0’ ‘NebulaND01’ 116 NebulaND01
Tue Feb 20 10:34:06 2018 [Z0][VMM][I]: Error deploying Azure VM: e[31me[1mFailed to create virtual machine : e[31me[1mThe virtual machine image source is not valid.e[0me[0me[0me[0m
Tue Feb 20 10:34:06 2018 [Z0][VMM][I]: ExitCode: 255
Tue Feb 20 10:34:06 2018 [Z0][VMM][I]: Failed to execute virtualization driver operation: deploy.
Tue Feb 20 10:34:06 2018 [Z0][VMM][E]: Error deploying virtual machine
Tue Feb 20 10:34:06 2018 [Z0][VM][I]: New LCM state is BOOT_FAILURE

This is the Azure host:

HOST 9 INFORMATION
ID : 9
NAME : NebulaND01
CLUSTER : default
STATE : MONITORED
IM_MAD : az
VM_MAD : az
LAST MONITORING TIME : 02/20 13:12:59

HOST SHARES
RUNNING VMS : 1
MEMORY
TOTAL : 8.8G
TOTAL +/- RESERVED : 8.8G
USED (REAL) : 0K
USED (ALLOCATED) : 1024M
CPU
TOTAL : 500
TOTAL +/- RESERVED : 500
USED (REAL) : 0
USED (ALLOCATED) : 50

MONITORING INFORMATION
HOSTNAME="NebulaND01"
HYPERVISOR="AZURE"
IM_MAD=“az"
PRIORITY=”-1"
PUBLIC_CLOUD=“YES"
RESERVED_CPU=”“
RESERVED_MEM=”"
VM_MAD=“az”

WILD VIRTUAL MACHINES

NAME IMPORT_ID CPU MEMORY

VIRTUAL MACHINES

ID USER     GROUP    NAME            STAT UCPU    UMEM HOST             TIME

116 oneadmin oneadmin OpenNebula01 fail 0 0K NebulaND01 0d 00h21

I’ve downloaded the VHD image from “http://cloud-images.ubuntu.com/xenial/current/” (that’s why I can’t quite understand the “The virtual machine image source is not valid” error). And could load it into OpenNebula without a problem (just took a bit long, as it’s a 30GB image…):

This is the image template:

IMAGE 56 INFORMATION
ID : 56
NAME : Ubuntu16.04-Azure
USER : oneadmin
GROUP : oneadmin
DATASTORE : default
TYPE : OS
REGISTER TIME : 02/20 10:24:12
PERSISTENT : Yes
SOURCE : /var/lib/one//datastores/1/1883365189e91360ff1e39aae8e34e55
PATH : /var/tmp/xenial-server-cloudimg-amd64-disk1.vhd
FSTYPE : raw
SIZE : 30G
STATE : used
RUNNING_VMS : 1

PERMISSIONS
OWNER : um-
GROUP : —
OTHER : —

IMAGE TEMPLATE
DEV_PREFIX="vd"
DRIVER=“raw”

VIRTUAL MACHINES

ID USER     GROUP    NAME            STAT UCPU    UMEM HOST             TIME

116 oneadmin oneadmin OpenNebula01 fail 0 0K NebulaND01 0d 00h11

Versions of the related components and OS (frontend, hypervisors, VMs):
Steps to reproduce:
Current results:
Expected results:

And this is the VM template…:

TEMPLATE 21 INFORMATION
ID : 21
NAME : Ubuntu 16.04 - Azure
USER : oneadmin
GROUP : oneadmin
REGISTER TIME : 02/14 15:38:46

PERMISSIONS
OWNER : um-
GROUP : —
OTHER : —

TEMPLATE CONTENTS
CONTEXT=[
NETWORK=“YES”,
SSH_PUBLIC_KEY="ssh-rsa xxxxxxxxxxxxxxxxxxxxxx"
CPU="0.5"
CPU_COST="0.026"
DISK=[
IMAGE=“Ubuntu16.04-Azure”,
IMAGE_UNAME=“oneadmin” ]
DISK_COST="0.0000006"
FEATURES=[
ACPI=“yes”,
GUEST_AGENT=“yes”,
LOCALTIME=“yes” ]
GRAPHICS=[
LISTEN=“0.0.0.0”,
TYPE=“VNC” ]
HYPERVISOR=“kvm"
INPUTS_ORDER=”"
LOGO="images/logos/ubuntu.png"
MEMORY="1024"
MEMORY_COST="0.000014"
MEMORY_UNIT_COST="MB"
OS=[
ARCH=“x86_64”,
BOOT=“disk0” ]
PUBLIC_CLOUD=[
IMAGE=“Ubuntu 16.04 - COE”,
INSTANCE_TYPE=“Small”,
LOCATION=“West US 2”,
SSHPORT=“2222”,
TCP_ENDPOINTS=“80”,
TYPE=“AZURE”,
VM_PASSWORD=“xxxxxxxxx”,
VM_USER=“xxxxx”,
WIN_RM=“https” ]
SUNSTONE=[
NETWORK_SELECT=“NO” ]
USER_INPUTS=[
CPU=“O|fixed|| |0.5”,
MEMORY=“M|range||1024…16384|1024”,
VCPU=“O|range||1…16|1” ]
VCPU=“1”

Would anybody be able to point what I’m doing wrong? I’m quite sure it’s something very basic, but for the life of me, I just can’t figure that out…

This is OpenNebula 5.4.1 running on Ubuntu 16.04, by the way.

Thanks a lot,

Alex

not sure if this is Azure related at all (have no experience on that yet) but it seems you downloaded a VHD image (microsoft virtual harddisk). I dont know what image types are supported by Azure, to be honest…

In the template you specify it as a raw disk, with prefix “vd”. This tells the hypervisor to use virtio drivers, which is prob. why it fails. If you use “hd” or “sd” as prefix it might work.
Depending on what Azure can/cannot do, you might need to convert the VHD image to a format that is supported on Azure.
Hope this helps…

Hello Roland,

Thanks for trying to help… (And sorry the delay in replying.)

As far as I could find, VHD is indeed the preferred format to use in Azure.
It was on the Azure portal that I found the suggestion to go to “http://cloud-images.ubuntu.com/xenial/current/” for Ubuntu images for Azure.

I tried both “hd” or “sd” but end up with the same error…
Something else also happens every time a VM deployment fails: the image’s state changes to ERROR (disabling/enabling it brings its state back to READY…).

I’m still learning, so, forgive if this is a silly question…: would using a different driver other than “raw” be worth trying?

Regards,

Alex