Hi<br><br>I have faced the same issue while working with OpenNebula 1.4.<br><br>As you have already mentioned, I had to change LibVirtDriver.cc and recompile from source. <br><br>I had to add an else if block ( in bold font ) to the below piece of code in LibVirtDriver.cc<br>
<br> if ( type == "BLOCK" )<br> {<br> file << "\t\t<disk type='block' device='disk'>" << endl<br> << "\t\t\t<source dev='" << vm->get_remote_dir() << "/disk."<br>
<< i << "'/>" << endl;<br> }<br><br> /* Added newly */<br><b> else if ( type == "CDROM")<br>
{<br>
file << "\t\t<disk type='file' device='cdrom'>" << endl<br>
<< "\t\t\t<source file='" << vm->get_remote_dir() << "/disk."<br>
<< i << "'/>" << endl;<br>
}<br></b>
<br> else<br> {<br> file << "\t\t<disk type='file' device='disk'>" << endl<br> << "\t\t\t<source file='" << vm->get_remote_dir() << "/disk."<br>
<< i << "'/>" << endl;<br> }<br><br>I have also seen issues while working with qemu hypervisor version 0.11.0 (qemu-kvm-0.11.0). After making the above changes, I have created a new VM and the following deployment descriptor was created:<br>
<br><domain type='kvm'><br> <name>one-16</name><br> <memory>524288</memory><br> <os><br> <type>hvm</type><br> <boot dev='cdrom'/><br>
</os><br> <devices><br> <emulator>/usr/bin/kvm</emulator><br> <disk type='file' device='cdrom'><br> <source dev='/var/lib/one/16/images/disk.0'/><br>
<target dev='hdb'/><br> </disk><br> <graphics type='vnc' listen='0.0.0.0' port='15'/><br> </devices><br> <features><br> <acpi/><br>
</features><br></domain><br><br>disk.0 is linked to an iso file.<br>lrwxrwxrwx 1 oneadmin nogroup 23 2010-05-27 22:37 disk.0 -> /mnt/onenfs/ReactOS.iso<br><br><br>The following are the contents of var/log/libvirt/qemu/one-16.log<br>
<br>LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin /usr/bin/kvm -S -M pc-0.11 -m 512 -smp 1 -name one-16 -uuid 70ac26ff-654e-9149-8323-283a7e66f1b6 -monitor unix:/var/run/libvirt/qemu/one-16.monitor,server,nowait <b>-boot d -drive file=,if=ide,media=cdrom,index=1</b> -net none -serial none -parallel none -usb -vnc 0.0.0.0:-5885 -vga cirrus <br>
<br>Note the line in bold above. Ideally file should be pointing to '/var/lib/one/16/images/disk.0' but it was not pointing to anything. As a result VM couldn't boot.<br><br>Can somebody please throw some light on this issue. <br>
<br><div class="gmail_quote">On 18 May 2010 07:56, florian chazal <span dir="ltr"><<a href="mailto:florianchazal@gmail.com" target="_blank">florianchazal@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>Is it normal that when you create a virtual machine and you configure one of its disk as a cdrom : <br>
<br>#########Open nebula VM Template #########<br>...<br>OS = [ BOOT = \"cdrom\" ]<br>...<br>DISK = [ TYPE = "<span style="background-color: rgb(255, 0, 0);">cdrom</span>" ,<br>
SOURCE = "/srv/cloud/one/IM_template/debian-504-i386-netinst.iso" ,<br>TARGET = "hdc" ,<br>CLONE = "no" ,<br>SAVE = "no" ,<br>READONLY = "no" ]<br>DISK = [ TYPE = "disk" ,<br>
SOURCE = "/srv/cloud/one/IM_template/test.qcow2" ,<br>TARGET = "hda" ,<br>CLONE = "no" ,<br>SAVE = "no" ,<br>READONLY = "no" ]<br>...<br>################################<br>
<br>the libvirt driver translate it like this : <br><br>#########LibVirt VM Template #########<br>...<br><os><br> <type>hvm</type><br> <boot dev='"cdrom"'/><br>
</os><br> <devices><br> <emulator>/usr/bin/kvm</emulator><br> <disk type='file' device='<span style="background-color: rgb(255, 0, 0);">disk</span>'><br>
<source file='/srv/cloud/one/var/94/images/disk.0'/><br> <target dev='hdc'/><br> </disk><br> <disk type='file' device='disk'><br>
<source file='/srv/cloud/one/var/94/images/disk.1'/><br> <target dev='hda'/><br> </disk><br>...<br>################################<br>
<br>That is to say the translation doesn't care about my cdrom type . And the vm failed. but if I put cdrom in the device attirbute it works ...<br><br>I searched in the code and I realized that if the type is block in the ON template the device attirbute will be set as disk and if not it will be set at disk again : <a href="http://dev.opennebula.org/projects/opennebula/repository/revisions/master/show" target="_blank">root</a>
/ <a href="http://dev.opennebula.org/projects/opennebula/repository/revisions/master/show/src" target="_blank">src</a>
/ <a href="http://dev.opennebula.org/projects/opennebula/repository/revisions/master/show/src/vmm" target="_blank">vmm</a>
/ <a href="http://dev.opennebula.org/projects/opennebula/repository/revisions/master/changes/src/vmm/LibVirtDriver.cc" target="_blank">LibVirtDriver.cc</a> line 687 to 697 ...<br clear="all"><br><br>-- <br><font color="#888888">Florian Chazal<br>
</font><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Shashank Rachamalla<br>