The first option worked like a charm. <br><br>The generated deployment descriptor was:<br><domain type='kvm'><br> <name>one-33</name><br> <memory>262144</memory><br> <os><br>
<type>hvm</type><br> <boot dev='hd'/><br> </os><br> <devices><br> <emulator>/usr/bin/kvm</emulator><br> <disk type='file' device='disk'><br>
<source file='/opt/nebula/ONE/var//33/images/disk.0'/><br> <target dev='vda' bus='virtio'/><br> </disk><br> <interface type='bridge'><br>
<source bridge='br0'/><br> <model type='virtio'/><br> </interface><br> <interface type='bridge'><br> <source bridge='br0'/><br>
<mac address='00:03:0a:00:01:04'/><br> <model type='virtio'/><br> </interface><br> </devices><br> <features><br> <pae/><br> <acpi/><br>
</features><br> <devices><serial type="pty"><source path="/dev/pts/5"/><target port="0"/></serial><console type="pty" tty="/dev/pts/5"><source path="/dev/pts/5"/><target port="0"/></console></devices><br>
</domain><br><br>And the dumpxml reveals the correct configuration:<br><domain type='kvm' id='16'><br> <name>one-33</name><br> <uuid>f239ee68-f86a-6cfd-0f7c-87ccf0c8d57a</uuid><br>
<memory>262144</memory><br> <currentMemory>262144</currentMemory><br> <vcpu>1</vcpu><br> <os><br> <type arch='i686' machine='pc-0.11'>hvm</type><br>
<boot dev='hd'/><br> </os><br> <features><br> <acpi/><br> <pae/><br> </features><br> <clock offset='utc'/><br> <on_poweroff>destroy</on_poweroff><br>
<on_reboot>restart</on_reboot><br> <on_crash>destroy</on_crash><br> <devices><br> <emulator>/usr/bin/kvm</emulator><br> <disk type='file' device='disk'><br>
<source file='/opt/nebula/ONE/var//33/images/disk.0'/><br> <target dev='vda' bus='virtio'/><br> </disk><br> <interface type='bridge'><br> <mac address='52:54:00:e8:39:7b'/><br>
<source bridge='br0'/><br> <target dev='vnet4'/><br> <model type='virtio'/><br> </interface><br> <interface type='bridge'><br> <mac address='00:03:0a:00:01:04'/><br>
<source bridge='br0'/><br> <target dev='vnet5'/><br> <model type='virtio'/><br> </interface><br> <serial type='pty'><br> <source path='/dev/pts/6'/><br>
<target port='0'/><br> </serial><br> <console type='pty' tty='/dev/pts/6'><br> <source path='/dev/pts/6'/><br> <target port='0'/><br>
</console><br> </devices><br> <seclabel type='dynamic' model='apparmor'><br> <label>libvirt-f239ee68-f86a-6cfd-0f7c-87ccf0c8d57a</label><br> <imagelabel>libvirt-f239ee68-f86a-6cfd-0f7c-87ccf0c8d57a</imagelabel><br>
</seclabel><br></domain><br><br>I do like option 2. Could you point me to the source code file where I can make your suggested change. I suppose I can browse through the source and figure out the right file....<br>
<br>Thanks,<br>RS<br><br><br><div class="gmail_quote">On Thu, Feb 4, 2010 at 3:15 PM, Ruben S. Montero <span dir="ltr"><<a href="mailto:rubensm@dacya.ucm.es">rubensm@dacya.ucm.es</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>
It seems that the console attribute needs to be defined within the<br>
devices element. We can try a couple of things:<br>
<br>
1. Let see if libvirt can deal with two devices elements. Try to add:<br>
RAW = [ type = "kvm",<br>
data = "</devices><serial type=\"pty\"><source<br>
<div class="im"> path=\"/dev/pts/5\"/><target port=\"0\"/></serial><console type=\"pty\"<br>
tty=\"/dev/pts/5\"><source path=\"/dev/pts/5\"/><target<br>
</div> port=\"0\"/></console></devices>" ]<br>
<br>
That is the same you have but within a device element<br>
<br>
2. We can modify the KVM driver so the RAW attributes are generated<br>
within the devices section. Or at least add an option to tell<br>
OpenNebula where to put the RAW attributes.<br>
<br>
3. If you need this for debugging purposes, you can always connect to<br>
the VM through VNC with the GRAPHICS attribute...<br>
<br>
Cheers<br>
<br>
Ruben<br>
<div><div></div><div class="h5"><br>
On Thu, Feb 4, 2010 at 7:16 PM, Jack Jill <<a href="mailto:jacknjill111@gmail.com">jacknjill111@gmail.com</a>> wrote:<br>
> I'm attempting to configure a console for my vm so I can connect to it via<br>
> "virsh", but I believe I am screwing up the declaration in the template.<br>
><br>
> <quote><br>
> RAW = [ type = "kvm", data = "<console type=\"stdio\"><target<br>
> port=\"1\"/></console>" ]<br>
> </quote><br>
><br>
> results in the following deployment descriptor:<br>
><br>
> <domain type='kvm'><br>
> <name>one-31</name><br>
> <memory>262144</memory><br>
> <os><br>
> <type>hvm</type><br>
> <boot dev='hd'/><br>
> </os><br>
> <devices><br>
> <emulator>/usr/bin/kvm</emulator><br>
> <disk type='file' device='disk'><br>
> <source file='/opt/nebula/ONE/var//31/images/disk.0'/><br>
> <target dev='vda' bus='virtio'/><br>
> </disk><br>
> <interface type='bridge'><br>
> <source bridge='br0'/><br>
> <model type='virtio'/><br>
> </interface><br>
> <interface type='bridge'><br>
> <source bridge='br0'/><br>
> <mac address='00:03:0a:00:01:04'/><br>
> <model type='virtio'/><br>
> </interface><br>
> </devices><br>
> <features><br>
> <pae/><br>
> <acpi/><br>
> </features><br>
> <console type="stdio"><target port="1"/></console><br>
> </domain><br>
><br>
> But when I attempt to connect to the console I get the following error:<br>
><br>
> <quote><br>
> sudo virsh console one-31<br>
> [sudo] password for xxxx:<br>
> Connecting to uri: qemu:///system<br>
> No console available for domain<br>
> </quote><br>
><br>
> virsh dumpxml shows the following:<br>
><br>
> <domain type='kvm' id='13'><br>
> <name>one-31</name><br>
> <uuid>89e69209-ba37-8ccf-832f-f637ab753710</uuid><br>
> <memory>262144</memory><br>
> <currentMemory>262144</currentMemory><br>
> <vcpu>1</vcpu><br>
> <os><br>
> <type arch='i686' machine='pc-0.11'>hvm</type><br>
> <boot dev='hd'/><br>
> </os><br>
> <features><br>
> <acpi/><br>
> <pae/><br>
> </features><br>
> <clock offset='utc'/><br>
> <on_poweroff>destroy</on_poweroff><br>
> <on_reboot>restart</on_reboot><br>
> <on_crash>destroy</on_crash><br>
> <devices><br>
> <emulator>/usr/bin/kvm</emulator><br>
> <disk type='file' device='disk'><br>
> <source file='/opt/nebula/ONE/var//31/images/disk.0'/><br>
> <target dev='vda' bus='virtio'/><br>
> </disk><br>
> <interface type='bridge'><br>
> <mac address='52:54:00:9c:c1:cb'/><br>
> <source bridge='br0'/><br>
> <target dev='vnet4'/><br>
> <model type='virtio'/><br>
> </interface><br>
> <interface type='bridge'><br>
> <mac address='00:03:0a:00:01:04'/><br>
> <source bridge='br0'/><br>
> <target dev='vnet5'/><br>
> <model type='virtio'/><br>
> </interface><br>
> </devices><br>
> <seclabel type='dynamic' model='apparmor'><br>
> <label>libvirt-89e69209-ba37-8ccf-832f-f637ab753710</label><br>
> <imagelabel>libvirt-89e69209-ba37-8ccf-832f-f637ab753710</imagelabel><br>
> </seclabel><br>
> </domain><br>
><br>
> As you can see no console element.<br>
><br>
> If I redefine the domain and add the following (via virsh), I can connect<br>
> successfully.<br>
><br>
> <domain type='kvm'><br>
> <name>one-31</name><br>
> <uuid>89e69209-ba37-8ccf-832f-f637ab753710</uuid><br>
> <memory>262144</memory><br>
> <currentMemory>262144</currentMemory><br>
> <vcpu>1</vcpu><br>
> <os><br>
> <type arch='i686' machine='pc-0.11'>hvm</type><br>
> <boot dev='hd'/><br>
> </os><br>
> <features><br>
> <acpi/><br>
> <pae/><br>
> </features><br>
> <clock offset='utc'/><br>
> <on_poweroff>destroy</on_poweroff><br>
> <on_reboot>restart</on_reboot><br>
> <on_crash>destroy</on_crash><br>
> <devices><br>
> <emulator>/usr/bin/kvm</emulator><br>
> <disk type='file' device='disk'><br>
> <source file='/opt/nebula/ONE/var//31/images/disk.0'/><br>
> <target dev='vda' bus='virtio'/><br>
> </disk><br>
> <interface type='bridge'><br>
> <mac address='52:54:00:9c:c1:cb'/><br>
> <source bridge='br0'/><br>
> <target dev='vnet4'/><br>
> <model type='virtio'/><br>
> </interface><br>
> <interface type='bridge'><br>
> <mac address='00:03:0a:00:01:04'/><br>
> <source bridge='br0'/><br>
> <target dev='vnet5'/><br>
> <model type='virtio'/><br>
> </interface><br>
> <serial type='pty'><br>
> <source path='/dev/pts/5'/><br>
> <target port='0'/><br>
> </serial><br>
> <console type='pty' tty='/dev/pts/5'><br>
> <source path='/dev/pts/5'/><br>
> <target port='0'/><br>
> </console><br>
> </devices><br>
> </domain><br>
><br>
> So I tried passing in the following as RAW attributes:<br>
><br>
> RAW = [ type = "kvm",<br>
> data = "<serial type=\"pty\"><source<br>
> path=\"/dev/pts/5\"/><target port=\"0\"/></serial><console type=\"pty\"<br>
> tty=\"/dev/pts/5\"><source path=\"/dev/pts/5\"/><target<br>
> port=\"0\"/></console>" ]<br>
><br>
> The above results in the following deployment descriptor being generated:<br>
><br>
> <domain type='kvm'><br>
> <name>one-32</name><br>
> <memory>262144</memory><br>
> <os><br>
> <type>hvm</type><br>
> <boot dev='hd'/><br>
> </os><br>
> <devices><br>
> <emulator>/usr/bin/kvm</emulator><br>
> <disk type='file' device='disk'><br>
> <source file='/opt/nebula/ONE/var//32/images/disk.0'/><br>
> <target dev='vda' bus='virtio'/><br>
> </disk><br>
> <interface type='bridge'><br>
> <source bridge='br0'/><br>
> <model type='virtio'/><br>
> </interface><br>
> <interface type='bridge'><br>
> <source bridge='br0'/><br>
> <mac address='00:03:0a:00:01:04'/><br>
> <model type='virtio'/><br>
> </interface><br>
> </devices><br>
> <features><br>
> <pae/><br>
> <acpi/><br>
> </features><br>
> <serial type="pty"><source path="/dev/pts/5"/><target<br>
> port="0"/></serial><console type="pty" tty="/dev/pts/5"><source<br>
> path="/dev/pts/5"/><target port="0"/></console><br>
> </domain><br>
><br>
> But still cannot connect to the console. The dumpxml (via virsh) reveals the<br>
> following:<br>
><br>
> oneadmin@uecB:~/domainTemplates$ virsh dumpxml one-32<br>
> Connecting to uri: qemu:///system<br>
> <domain type='kvm' id='15'><br>
> <name>one-32</name><br>
> <uuid>c51c3deb-7685-3722-9df1-10600d3f2df0</uuid><br>
> <memory>262144</memory><br>
> <currentMemory>262144</currentMemory><br>
> <vcpu>1</vcpu><br>
> <os><br>
> <type arch='i686' machine='pc-0.11'>hvm</type><br>
> <boot dev='hd'/><br>
> </os><br>
> <features><br>
> <acpi/><br>
> <pae/><br>
> </features><br>
> <clock offset='utc'/><br>
> <on_poweroff>destroy</on_poweroff><br>
> <on_reboot>restart</on_reboot><br>
> <on_crash>destroy</on_crash><br>
> <devices><br>
> <emulator>/usr/bin/kvm</emulator><br>
> <disk type='file' device='disk'><br>
> <source file='/opt/nebula/ONE/var//32/images/disk.0'/><br>
> <target dev='vda' bus='virtio'/><br>
> </disk><br>
> <interface type='bridge'><br>
> <mac address='52:54:00:9c:1f:76'/><br>
> <source bridge='br0'/><br>
> <target dev='vnet4'/><br>
> <model type='virtio'/><br>
> </interface><br>
> <interface type='bridge'><br>
> <mac address='00:03:0a:00:01:04'/><br>
> <source bridge='br0'/><br>
> <target dev='vnet5'/><br>
> <model type='virtio'/><br>
> </interface><br>
> </devices><br>
> <seclabel type='dynamic' model='apparmor'><br>
> <label>libvirt-c51c3deb-7685-3722-9df1-10600d3f2df0</label><br>
> <imagelabel>libvirt-c51c3deb-7685-3722-9df1-10600d3f2df0</imagelabel><br>
> </seclabel><br>
> </domain><br>
><br>
> As you can see, the RAW attributes did not get generated here. Any idea what<br>
> is going on and how I can get this resolved.<br>
><br>
><br>
> Also, the documentation at<br>
> <a href="http://opennebula.org/doku.php?id=documentation:rel1.4:kvmg" target="_blank">http://opennebula.org/doku.php?id=documentation:rel1.4:kvmg</a><br>
><br>
> <quote><br>
><br>
> RAW = [ type = "kvm",<br>
><br>
><br>
> data = "<console type=\"stdio\"><target port=\"1\"></console>" ]<br>
><br>
> </quote><br>
><br>
> causes the deployment to fail with the following error in the vm.log<br>
><br>
> Thu Feb 4 11:37:59 2010 [VMM][I]: error: Failed to create domain from<br>
> /opt/nebula/ONE/var//30/images/deployment.0<br>
> Thu Feb 4 11:37:59 2010 [VMM][I]: error: at line 28: Opening and ending tag<br>
> mismatch: target line 28 and console<br>
> Thu Feb 4 11:37:59 2010 [VMM][I]:<br>
> Thu Feb 4 11:37:59 2010 [VMM][I]: ExitCode: 1<br>
> Thu Feb 4 11:37:59 2010 [VMM][E]: Error deploying virtual machine<br>
><br>
> Therefore please update the documentation.<br>
><br>
> Front Controller:<br>
> ---------------------<br>
> Ubuntu Karmic<br>
> Open Nebula 1.4<br>
><br>
> Node:<br>
> -------<br>
> Ubuntu Karmic<br>
> KVM hypervisor<br>
><br>
> Thanks in advance,<br>
> RS<br>
><br>
</div></div>> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opennebula.org">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>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
Dr. Ruben Santiago Montero<br>
Associate Professor, Complutense University of Madrid<br>
<br>
URL: <a href="http://dsa-research.org/doku.php?id=people:ruben" target="_blank">http://dsa-research.org/doku.php?id=people:ruben</a><br>
Weblog: <a href="http://blog.dsa-research.org/?author=7" target="_blank">http://blog.dsa-research.org/?author=7</a><br>
</font></blockquote></div><br>