Bug #1021

Wrong (uppercase) bus type when creating KVM instance through OCCI

Added by Tomas X over 9 years ago. Updated over 9 years ago.

Status:ClosedStart date:12/06/2011
Priority:NormalDue date:
Assignee:Daniel Molina% Done:

0%

Category:-
Target version:Release 3.2
Resolution:fixed Pull request:
Affected Versions:OpenNebula 3.2

Description

Hi,

when creating instance through current OCCI (draft 0.8), the attached OS disk gets stored with uppercase 'IDE' bus type which libvirtd doesn't like and says: "error: internal error unknown disk bus type 'IDE'". The possible solution is to lowercase bus string in file src/vmm/LibVirtDriverKVM.cc on line 363.

OCCI request:

<COMPUTE>
    <NAME>MyCompute</NAME>
    <INSTANCE_TYPE>small</INSTANCE_TYPE>
    <DISK>
        <STORAGE href="http://localhost:4567/storage/6"/>
    </DISK>
    <NIC>
        <NETWORK href="http://localhost:4567/network/5"/>
    </NIC>
</COMPUTE>

Image:

<IMAGE><ID>6</ID><UID>0</UID><GID>0</GID><UNAME>oneadmin</UNAME><GNAME>oneadmin</GNAME><NAME>CentOS6</NAME><TYPE>0</TYPE><PUBLIC>1</PUBLIC><PERSISTENT>0</PERSISTENT><REGTIME>1323087890</REGTIME><SOURCE>/opt/one/var/images/c714cbebe12b38b55a6eed9e7051495e</SOURCE><PATH>/var/lib/libvirt/images/CentOS6.img</PATH><FSTYPE></FSTYPE><SIZE>2048</SIZE><STATE>2</STATE><RUNNING_VMS>2</RUNNING_VMS><TEMPLATE><BUS><![CDATA[IDE]]></BUS><DEV_PREFIX><![CDATA[hd]]></DEV_PREFIX></TEMPLATE></IMAGE>

Template:

<VMTEMPLATE><ID>14</ID><UID>0</UID><GID>0</GID><UNAME>oneadmin</UNAME><GNAME>oneadmin</GNAME><NAME>CentOS6</NAME><PUBLIC>0</PUBLIC><REGTIME>1323088614</REGTIME><TEMPLATE><CONTEXT><FILES><![CDATA[/var/tmp/init.sh /home/woky/.ssh/id_rsa.pub]]></FILES><IP_PUBLIC><![CDATA[$NIC[IP]]]></IP_PUBLIC><ROOT_PUBKEY><![CDATA[id_rsa.pub]]></ROOT_PUBKEY></CONTEXT><CPU><![CDATA[1]]></CPU><DISK><BUS><![CDATA[ide]]></BUS><IMAGE><![CDATA[CentOS6]]></IMAGE><IMAGE_UNAME><![CDATA[oneadmin]]></IMAGE_UNAME></DISK><GRAPHICS><LISTEN><![CDATA[127.0.0.1]]></LISTEN><PORT><![CDATA[12233]]></PORT><TYPE><![CDATA[vnc]]></TYPE></GRAPHICS><MEMORY><![CDATA[1024]]></MEMORY><NAME><![CDATA[CentOS6]]></NAME><NIC><NETWORK><![CDATA[local]]></NETWORK><NETWORK_UNAME><![CDATA[oneadmin]]></NETWORK_UNAME></NIC><OS><ARCH><![CDATA[i686]]></ARCH><BOOT><![CDATA[hd]]></BOOT></OS><RAW><TYPE><![CDATA[kvm]]></TYPE></RAW><TEMPLATE_ID><![CDATA[14]]></TEMPLATE_ID><VCPU><![CDATA[1]]></VCPU></TEMPLATE></VMTEMPLATE>

Instance:

<VM><ID>43</ID><UID>0</UID><GID>0</GID><UNAME>oneadmin</UNAME><GNAME>oneadmin</GNAME><NAME>MyCompute</NAME><LAST_POLL>0</LAST_POLL><STATE>7</STATE><LCM_STATE>0</LCM_STATE><STIME>1323183187</STIME><ETIME>1323183271</ETIME><DEPLOY_ID></DEPLOY_ID><MEMORY>0</MEMORY><CPU>0</CPU><NET_TX>0</NET_TX><NET_RX>0</NET_RX><TEMPLATE><CPU><![CDATA[1]]></CPU><DISK><BUS><![CDATA[IDE]]></BUS><CLONE><![CDATA[YES]]></CLONE><DISK_ID><![CDATA[0]]></DISK_ID><IMAGE><![CDATA[CentOS6]]></IMAGE><IMAGE_ID><![CDATA[6]]></IMAGE_ID><READONLY><![CDATA[NO]]></READONLY><SAVE><![CDATA[NO]]></SAVE><SOURCE><![CDATA[/opt/one/var/images/c714cbebe12b38b55a6eed9e7051495e]]></SOURCE><TARGET><![CDATA[hda]]></TARGET><TYPE><![CDATA[DISK]]></TYPE></DISK><ERROR><MESSAGE><![CDATA[Error deploying virtual machine: Could not create domain from /opt/one/var//43/images/deployment.0]]></MESSAGE><TIMESTAMP><![CDATA[Tue Dec  6 15:54:30 2011]]></TIMESTAMP></ERROR><INSTANCE_TYPE><![CDATA[small]]></INSTANCE_TYPE><MEMORY><![CDATA[1024]]></MEMORY><NAME><![CDATA[MyCompute]]></NAME><NIC><BRIDGE><![CDATA[br0]]></BRIDGE><IP><![CDATA[192.168.58.244]]></IP><MAC><![CDATA[02:00:c0:a8:3a:f4]]></MAC><NETWORK><![CDATA[local]]></NETWORK><NETWORK_ID><![CDATA[5]]></NETWORK_ID><VLAN><![CDATA[NO]]></VLAN></NIC><VMID><![CDATA[43]]></VMID></TEMPLATE><HISTORY_RECORDS><HISTORY><SEQ>0</SEQ><HOSTNAME>localhost</HOSTNAME><VM_DIR>/opt/one/var/</VM_DIR><HID>2</HID><STIME>1323183192</STIME><ETIME>1323183271</ETIME><VMMMAD>vmm_kvm</VMMMAD><VNMMAD>dummy</VNMMAD><TMMAD>tm_shared</TMMAD><PSTIME>1323183192</PSTIME><PETIME>1323183270</PETIME><RSTIME>1323183270</RSTIME><RETIME>1323183271</RETIME><ESTIME>0</ESTIME><EETIME>0</EETIME><REASON>1</REASON></HISTORY></HISTORY_RECORDS></VM>

History

#1 Updated by Tomas X over 9 years ago

This doesn't happen when creating instance through sunstone.

#2 Updated by Ruben S. Montero over 9 years ago

  • Assignee set to Daniel Molina
  • Target version set to Release 3.2

#3 Updated by Ruben S. Montero over 9 years ago

  • Status changed from New to Assigned

#4 Updated by Daniel Molina over 9 years ago

Currently, you have defined the BUS attribute inside the Image (upcase) and inside the VM template (lowcase). When you start a new instance using Sunstone the value defined in the VM template will be used (lowcase). When you start a new instance through OCCI that template is not used, instead an instance_type is defined [1], so the value of the Image will be used and the instance will fail.

So, you should change the Image BUS attribute and the instance will start in both cases. The problem that I have found is when you create a new image through Sunstone, the BUS value is defined in uppercase.

[1] http://www.opennebula.org/documentation:rel3.0:occicg#defining_compute_types

#5 Updated by Ruben S. Montero over 9 years ago

  • Status changed from Assigned to Closed
  • Resolution set to fixed

Fixed sunstone when specifying the bus directly

Also available in: Atom PDF