[one-users] Raw attributes not getting resolved

Jack Jill jacknjill111 at gmail.com
Thu Feb 4 10:16:03 PST 2010


I'm attempting to configure a console for my vm so I can connect to it via
"virsh", but I believe I am screwing up the declaration in the template.

<quote>
RAW = [ type = "kvm", data = "<console type=\"stdio\"><target
port=\"1\"/></console>" ]
</quote>

results in the following deployment descriptor:

<domain type='kvm'>
    <name>one-31</name>
    <memory>262144</memory>
    <os>
        <type>hvm</type>
        <boot dev='hd'/>
    </os>
    <devices>
        <emulator>/usr/bin/kvm</emulator>
        <disk type='file' device='disk'>
            <source file='/opt/nebula/ONE/var//31/images/disk.0'/>
            <target dev='vda' bus='virtio'/>
        </disk>
        <interface type='bridge'>
            <source bridge='br0'/>
            <model type='virtio'/>
        </interface>
        <interface type='bridge'>
            <source bridge='br0'/>
            <mac address='00:03:0a:00:01:04'/>
            <model type='virtio'/>
        </interface>
    </devices>
    <features>
        <pae/>
        <acpi/>
    </features>
    <console type="stdio"><target port="1"/></console>
</domain>

But when I attempt to connect to the console I get the following error:

<quote>
sudo virsh console one-31
[sudo] password for xxxx:
Connecting to uri: qemu:///system
No console available for domain
</quote>

virsh dumpxml shows the following:

<domain type='kvm' id='13'>
  <name>one-31</name>
  <uuid>89e69209-ba37-8ccf-832f-f637ab753710</uuid>
  <memory>262144</memory>
  <currentMemory>262144</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='i686' machine='pc-0.11'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <source file='/opt/nebula/ONE/var//31/images/disk.0'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <interface type='bridge'>
      <mac address='52:54:00:9c:c1:cb'/>
      <source bridge='br0'/>
      <target dev='vnet4'/>
      <model type='virtio'/>
    </interface>
    <interface type='bridge'>
      <mac address='00:03:0a:00:01:04'/>
      <source bridge='br0'/>
      <target dev='vnet5'/>
      <model type='virtio'/>
    </interface>
  </devices>
  <seclabel type='dynamic' model='apparmor'>
    <label>libvirt-89e69209-ba37-8ccf-832f-f637ab753710</label>
    <imagelabel>libvirt-89e69209-ba37-8ccf-832f-f637ab753710</imagelabel>
  </seclabel>
</domain>

As you can see no console element.

If I redefine the domain and add the following (via virsh), I can connect
successfully.

<domain type='kvm'>
  <name>one-31</name>
  <uuid>89e69209-ba37-8ccf-832f-f637ab753710</uuid>
  <memory>262144</memory>
  <currentMemory>262144</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='i686' machine='pc-0.11'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <source file='/opt/nebula/ONE/var//31/images/disk.0'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <interface type='bridge'>
      <mac address='52:54:00:9c:c1:cb'/>
      <source bridge='br0'/>
      <target dev='vnet4'/>
      <model type='virtio'/>
    </interface>
    <interface type='bridge'>
      <mac address='00:03:0a:00:01:04'/>
      <source bridge='br0'/>
      <target dev='vnet5'/>
      <model type='virtio'/>
    </interface>
    <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>
</domain>

So I tried passing in the following as RAW attributes:

RAW = [ type = "kvm",
              data = "<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>" ]

The above results in the following deployment descriptor being generated:

<domain type='kvm'>
    <name>one-32</name>
    <memory>262144</memory>
    <os>
        <type>hvm</type>
        <boot dev='hd'/>
    </os>
    <devices>
        <emulator>/usr/bin/kvm</emulator>
        <disk type='file' device='disk'>
            <source file='/opt/nebula/ONE/var//32/images/disk.0'/>
            <target dev='vda' bus='virtio'/>
        </disk>
        <interface type='bridge'>
            <source bridge='br0'/>
            <model type='virtio'/>
        </interface>
        <interface type='bridge'>
            <source bridge='br0'/>
            <mac address='00:03:0a:00:01:04'/>
            <model type='virtio'/>
        </interface>
    </devices>
    <features>
        <pae/>
        <acpi/>
    </features>
    <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>
</domain>

But still cannot connect to the console. The dumpxml (via virsh) reveals the
following:

oneadmin at uecB:~/domainTemplates$ virsh dumpxml one-32
Connecting to uri: qemu:///system
<domain type='kvm' id='15'>
  <name>one-32</name>
  <uuid>c51c3deb-7685-3722-9df1-10600d3f2df0</uuid>
  <memory>262144</memory>
  <currentMemory>262144</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='i686' machine='pc-0.11'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <source file='/opt/nebula/ONE/var//32/images/disk.0'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <interface type='bridge'>
      <mac address='52:54:00:9c:1f:76'/>
      <source bridge='br0'/>
      <target dev='vnet4'/>
      <model type='virtio'/>
    </interface>
    <interface type='bridge'>
      <mac address='00:03:0a:00:01:04'/>
      <source bridge='br0'/>
      <target dev='vnet5'/>
      <model type='virtio'/>
    </interface>
  </devices>
  <seclabel type='dynamic' model='apparmor'>
    <label>libvirt-c51c3deb-7685-3722-9df1-10600d3f2df0</label>
    <imagelabel>libvirt-c51c3deb-7685-3722-9df1-10600d3f2df0</imagelabel>
  </seclabel>
</domain>

As you can see, the RAW attributes did not get generated here. Any idea what
is going on and how I can get this resolved.


Also, the documentation at
http://opennebula.org/doku.php?id=documentation:rel1.4:kvmg

<quote>

  RAW = [ type = "kvm",

          data = "<console type=\"stdio\"><target port=\"1\"></console>" ]

</quote>

causes the deployment to fail with the following error in the vm.log

Thu Feb  4 11:37:59 2010 [VMM][I]: error: Failed to create domain from
/opt/nebula/ONE/var//30/images/deployment.0
Thu Feb  4 11:37:59 2010 [VMM][I]: error: at line 28: Opening and ending tag
mismatch: target line 28 and console
Thu Feb  4 11:37:59 2010 [VMM][I]:
Thu Feb  4 11:37:59 2010 [VMM][I]: ExitCode: 1
Thu Feb  4 11:37:59 2010 [VMM][E]: Error deploying virtual machine

Therefore please update the documentation.

Front Controller:
---------------------
Ubuntu Karmic
Open Nebula 1.4

Node:
-------
Ubuntu Karmic
KVM hypervisor

Thanks in advance,
RS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20100204/fe7e2ef7/attachment.htm>


More information about the Users mailing list