[libvirt-users] Updates to cucmber-vhost - guineapigs wanted! :)
by Matthew Macdonald-Wallace
Hi all,
For those of you that are using cucumber for Continuous Integration or
similar I've created a set of steps that enable you to use cobbler and
cucumber to auto-provision using Libvirt.
I've just made some changes to the code however I don't have access to
all the hardware/software required to test it fully.
If you are able to, please check out the code from
http://tinyurl.com/virtcuke (my github repo) and test, posting bugs
against the project.
Thanks in advance,
Matt
14 years, 1 month
[libvirt-users] Is it possible to live migrate guest OS'es between different versions of kvm/qemu-kvm with libvirt?
by Nils Cant
Hi,
I currently have a couple of Debian KVM servers with all a different
version of kvm or qemu-kvm.
I can live migrate a guest OS from one server to the other just fine, as
long as the version of qemu-kvm is the same.
However, when I try to migrate a guest to a server running a newer (or
older) version of qemu-kvm, I run into problems. I think this is because
the xml configuration differs slightly between version.
For example, if I try to migrate from a server running qemu-kvm 0.11.0
to one running qemu-kvm 0.12.4, I get the following error:
virt01:~# virsh migrate --live testserver qemu+ssh://192.168.1.7/system
error: internal error unable to reserve PCI address 0:0:3
When migrating from kvm 85 to qemu-kvm 0.11.0:
virt02:~# virsh migrate --live testserver qemu+ssh://192.168.1.2/system
error: Unknown failure
Migrating one from 0.12.4 to 0.11.0 just completely breaks libvirt,
forcing me to kill -9 libvirtd and the kvm instance, etc.
I believe this is caused in part because different versions of qemu-kvm
need different xml configurations. To run my testserver on 0.12.4 for
example, I need to delete the lines with the PCI id's, just to be able
to start it.
So, is there a way to make this work? Perhaps tell libvirt to not send
the config file when doing a live migrate, and use the xml in
/etc/libvirt/qemu instead somehow?
Thanks in advance,
Nils
14 years, 2 months
[libvirt-users] Decent How-To now on the wiki for setting up Transport Layer Security
by Justin Clift
Hi all,
For anyone that's interested in setting up TLS with libvirt, but hasn't
gotten around to it yet, there's a decent guide on the wiki now:
http://wiki.libvirt.org/page/TLSSetup
It's user focused (ie SysAdmin's), and has lots of pics explaining
concepts, plus shows what needs to be done, and shows how to do it.
Please note, it doesn't cover SASL, it's just plain host based TLS.
Very much open to feedback on it, if people have suggestions for
improvement.
Hope that helps. :)
Regards and best wishes,
Justin Clift
14 years, 2 months
[libvirt-users] Unable to autostart storage pool.
by Sharad Mishra
Following xml file was used to create storage pool using 'virsh pool-create
<xml>'
<pool type='dir'>
<name>my-diskpool</name>
<uuid>2fbc894e-7619-6cda-a33c-b27fae5fbe8b</uuid>
<capacity>136024670208</capacity>
<allocation>11416657920</allocation>
<available>124608012288</available>
<source>
<host name='localhost'/>
</source>
<target>
<path>/var/lib/libvirt/images</path>
<permissions>
<mode>0700</mode>
<owner>0</owner>
<group>0</group>
</permissions>
</target>
</pool>
The command succeeds and a pool is created -
# virsh pool-list --all
Name State Autostart
-----------------------------------------
my-diskpool active no
When I try to set it up for autostart, I get -
# virsh pool-autostart my-diskpool
error: failed to mark pool my-diskpool as autostarted
error: invalid argument in pool has no config file
Why is it failing to autostart?
/etc/libvirt/storage has no xml file.
Thanks
Sharad Mishra
IBM
14 years, 3 months
[libvirt-users] Installing a VM to a virtio disk
by Brian Roberg
When provisioning new VMs, is it possible to enable virtio for the guest's
storage at the time of the installation? When I try to do so, the Ubuntu
installer says, "No root file system is defined" when it gets to the
partitioning step.
Here's the disk option I'm giving to virt-install:
--disk pool=libvirt-pool,size=4,bus=virtio
(I'm also using "--os-variant=ubuntulucid".)
I've been able to install a new VM using the IDE storage driver first and
then switch to virtio after the installation is complete, but it would
simplify the process if it could start with virtio right off the bat.
I'm using Ubuntu 10.04 LTS ("Lucid") host and guest, which provides libvirt
0.7.5 and kernel 2.6.32.
I'm about ready to concede defeat and set up a way to automate making the
change after the installation, but I thought I'd ask here first. Thanks!
--
Brian
14 years, 3 months
Re: [libvirt-users] [virt-tools-list] Client certificate paths?
by Cole Robinson
On 08/12/2010 10:29 AM, Lars Kellogg-Stedman wrote:
> Hello all,
>
> I'm trying to get virsh (and virt-manager) to talk to a remote libvirt
> instance. I cannot for the life of me figure out how to tell either
> tool where to find client or CA certificates. Do they *really* need
> to access the ones in /etc/pki? In particular, the client seems to
> want to read the *server's* private key, which for obvious reasons is
> only readable by root.
>
> I feel like I must be missing something obvious...if someone can point
> me towards a solution I would really appreciate it. Thanks!
>
> If it's relevant, I'm running everything under Fedora 13 right now, so
> that means libvirt-0.8.2-1.fc13.x86_64 and
> qemu-kvm-0.12.3-8.fc13.x86_64.
>
This is more a libvirt question, so CC-ing libvirt-users.
- Cole
14 years, 3 months
[libvirt-users] Libvirt and iptables rule order
by Brian Pitts
Hi,
On RHEL 5.5, I set up iptables rules for forwarding ports to some of my
virtual machines. For example.
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 3380 -j DNAT
--to-destination 192.168.123.2:3389
iptables -I FORWARD -d 192.168.123.2 -i eth0 -p tcp -m tcp --dport 3389
-m state --state NEW -j ACCEPT
These worked fine, and I saved them with 'service iptables save'.
However, upon rebooting the server the forwarding no longer works. When
I inspect the configuration with 'iptables -L', I see that the rules
libvirt creates were inserted before the rules from
/etc/sysconfig/iptables. Since the rules from libvirt include one that
rejects any new connections, the data I want forwarded is dropped. For
example,
target prot opt in out source destination
ACCEPT all -- any virbr1 anywhere 192.168.123.0/24 state
RELATED,ESTABLISHED
ACCEPT all -- virbr1 any 192.168.123.0/24 anywhere
ACCEPT all -- virbr1 virbr1 anywhere anywhere
REJECT all -- any virbr1 anywhere anywhere reject-with
icmp-port-unreachable
REJECT all -- virbr1 any anywhere anywhere reject-with
icmp-port-unreachable
ACCEPT tcp -- eth0 any anywhere 192.168.123.2 tcp
dpt:ms-wbt-server state NEW
How should I configure iptables so that my rules and libvirt's play
nicely? Basically I need my ACCEPTs to end up before libvirt's REJECTs.
I looked through the list archives and libvirt documentation but did not
see an answer to this question.
--
Brian Pitts
Systems Administrator | EuPathDB Bioinformatics Resource Center
706-542-1447 | bdp(a)uga.edu | http://eupathdb.org
14 years, 3 months
[libvirt-users] how to Create virtual machine
by Saravanan S
Hi,
I am working on a virtualization project that involves setting up virtual
appliances to implement the same, which tool is required to
1) create virtual appliances
2) deploy virtual appliances
3) manage virtual appliances/virtual machines
Could you please guide me with some pointers or resources to get started
with the creation of virtual machines?
I am little confused with libvirt with Xen and qemu.
how does xen or qemu related with libvirt ?
Thank you.
Saravanan Sundaramoorthy
Red Hat Certified Engineer
http://www.google.com/profiles/dearsaravanan#about
+91 99404 32545
14 years, 3 months
[libvirt-users] libvirt support spice protocol
by Songwen Liao
Hi,everyone,
there is a problem with libvirt support spice protocol.
i use the following patch file,but it seems not success.anyone have an idea
about that?
thanks.
patch file:
This adds an element
<graphics type='spice' port='5903' tlsPort='5904' listen='127.0.0.1'/>
This is the bare minimum that should be exposed in the guest
config for SPICE. Other parameters are better handled as per
host level configuration tunables
* docs/schemas/domain.rng: Define the SPICE <graphics> schema
* src/domain_conf.h, src/domain_conf.c: Add parsing and formatting
for SPICE graphics config
* src/qemu_conf.c: Complain about unsupported graphics types
---
docs/schemas/domain.rng | 30 +++++++++++++++++++++
src/conf/domain_conf.c | 65
++++++++++++++++++++++++++++++++++++++++++++++-
src/conf/domain_conf.h | 8 ++++++
src/qemu/qemu_conf.c | 9 ++++++
4 files changed, 111 insertions(+), 1 deletions(-)
diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index f9d6d7e..8aa2079 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -746,6 +746,36 @@
</group>
<group>
<attribute name="type">
+ <value>spice</value>
+ </attribute>
+ <optional>
+ <attribute name="port">
+ <ref name="PortNumber"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="tlsPort">
+ <ref name="PortNumber"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="listen">
+ <ref name="addrIP"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="passwd">
+ <text/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="keymap">
+ <text/>
+ </attribute>
+ </optional>
+ </group>
+ <group>
+ <attribute name="type">
<value>rdp</value>
</attribute>
<optional>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4930c38..ca5dfc3 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -165,7 +165,8 @@ VIR_ENUM_IMPL(virDomainGraphics,
VIR_DOMAIN_GRAPHICS_TYPE_LAST,
"sdl",
"vnc",
"rdp",
- "desktop")
+ "desktop",
+ "spice")
VIR_ENUM_IMPL(virDomainHostdevMode, VIR_DOMAIN_HOSTDEV_MODE_LAST,
"subsystem",
@@ -267,6 +268,12 @@ void virDomainGraphicsDefFree(virDomainGraphicsDefPtr
def)
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
VIR_FREE(def->data.desktop.display);
break;
+
+ case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
+ VIR_FREE(def->data.spice.listenAddr);
+ VIR_FREE(def->data.spice.keymap);
+ VIR_FREE(def->data.spice.passwd);
+ break;
}
VIR_FREE(def);
@@ -1692,6 +1699,38 @@ virDomainGraphicsDefParseXML(virConnectPtr conn,
def->data.desktop.fullscreen = 0;
def->data.desktop.display = virXMLPropString(node, "display");
+ } else if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
+ char *port = virXMLPropString(node, "port");
+ char *tlsPort;
+
+ if (port) {
+ if (virStrToLong_i(port, NULL, 10, &def->data.spice.port) < 0)
{
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse spice port %s"),
port);
+ VIR_FREE(port);
+ goto error;
+ }
+ VIR_FREE(port);
+ } else {
+ def->data.spice.port = 5900;
+ }
+
+ tlsPort = virXMLPropString(node, "tlsPort");
+ if (tlsPort) {
+ if (virStrToLong_i(tlsPort, NULL, 10, &def->data.spice.tlsPort)
< 0) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse spice tlsPort %s"),
tlsPort);
+ VIR_FREE(tlsPort);
+ goto error;
+ }
+ VIR_FREE(tlsPort);
+ } else {
+ def->data.spice.tlsPort = 0;
+ }
+
+ def->data.spice.listenAddr = virXMLPropString(node, "listen");
+ def->data.spice.passwd = virXMLPropString(node, "passwd");
+ def->data.spice.keymap = virXMLPropString(node, "keymap");
}
cleanup:
@@ -4100,6 +4139,30 @@ virDomainGraphicsDefFormat(virConnectPtr conn,
break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
+ if (def->data.spice.port)
+ virBufferVSprintf(buf, " port='%d'",
+ def->data.spice.port);
+
+ if (def->data.spice.tlsPort)
+ virBufferVSprintf(buf, " tlsPort='%d'",
+ def->data.spice.tlsPort);
+
+ if (def->data.spice.listenAddr)
+ virBufferVSprintf(buf, " listen='%s'",
+ def->data.spice.listenAddr);
+
+ if (def->data.spice.keymap)
+ virBufferEscapeString(buf, " keymap='%s'",
+ def->data.spice.keymap);
+
+ if (def->data.spice.passwd &&
+ (flags & VIR_DOMAIN_XML_SECURE))
+ virBufferEscapeString(buf, " passwd='%s'",
+ def->data.spice.passwd);
+
+ break;
+
}
virBufferAddLit(buf, "/>\n");
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 7ea1152..4cb10d3 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -334,6 +334,7 @@ enum virDomainGraphicsType {
VIR_DOMAIN_GRAPHICS_TYPE_VNC,
VIR_DOMAIN_GRAPHICS_TYPE_RDP,
VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP,
+ VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
VIR_DOMAIN_GRAPHICS_TYPE_LAST,
};
@@ -366,6 +367,13 @@ struct _virDomainGraphicsDef {
char *display;
int fullscreen : 1;
} desktop;
+ struct {
+ int port;
+ int tlsPort;
+ char *listenAddr;
+ char *keymap;
+ char *passwd;
+ } spice;
} data;
};
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 7ba0ac2..ae171bc 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -2067,6 +2067,12 @@ int qemudBuildCommandLine(virConnectPtr conn,
}
}
+ if (def->ngraphics > 1) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("only one graphics output is currently
supported"));
+ goto error;
+ }
+
if ((def->ngraphics == 1) &&
def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
virBuffer opt = VIR_BUFFER_INITIALIZER;
@@ -2155,6 +2161,9 @@ int qemudBuildCommandLine(virConnectPtr conn,
*/
ADD_ENV_COPY("QEMU_AUDIO_DRV");
ADD_ENV_COPY("SDL_AUDIODRIVER");
+ } else if (def->ngraphics) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("unsupported graphics output requested"));
}
if (def->nvideos) {
--
--
Name: Ben
------------------------------------------
Msn: liaosongwen(a)live.cn
14 years, 3 months