[libvirt-users] vms not persistent after upgrading to f22?
by Rich Megginson
With f21 and earlier, I could just call virt-install to create VMs, and
they would persist after reboot.
After upgrading to f22, when I shut off a VM, it is removed, and has to
be recreated.
How can I get VMs to persist? Is there a virsh create or virt-install
switch to do this?
9 years, 2 months
[libvirt-users] Isolated networks && test lab
by Spanky Horawitz
I'm trying to migrate my VirtualBox test lab to KVM. In my VB
configuration, I have several VM routers with 4 interfaces each. Each
router has a bridged interface which connects them all together and to
the outside world. I have servers/clients dispersed on each of the
other private (Isolated) segments that use the routers as default
gateways.
In trying to make this work, I used Virtual Machine Manager to define 3x
Virtual Networks (Isolated networks) and created a VM router which has 3
interfaces (192.168.x.1) on each Isolated network and a 4th interface
using the br0 interface to get to the outside world. The router is able
to connect to the outside world.
Using Virtual Machine Manager, I also created "client" VM and connected
it's single interface to one of the Isolated networks. While testing
connectivity of the "client" VM to the router, it seems to go straight
to the Host (tested using 'ssh 192.168.x.1'.) I'm trying to isolate the
networks from the Host and have the router receive packets for the
192.168.x.1 address on the individual Isolated network segments.
Host:
br0 (em1): 192.168.1.16
vibr0 (default): 192.168.122.1
virbr1: 192.168.2.1
virbr2: 192.168.3.1
virbr3: 192.168.4.1
VM router:
eth0: 192.168.1.10
eth1: 192.168.2.1
eth2: 192.168.3.1
eth3: 192.168.4.1
VM client:
eth0: 192.168.3.101
Is there some trick to isolate the Host from the VM's? Is there a
comprehensive guide that explains how the networks should be setup
(with/without Virtual Machine Manager)? I'm not afraid to get my hands
dirty on the console if needed, but GUI's are easier to navigate when
you're learning a new technology. I switched to using RemoteBox for
managing my VB vm's as it made things a lot easier to deal with than
VBoxManage.
Thanks for your help!
9 years, 2 months
Re: [libvirt-users] Using unix-type channel ....
by Michal Privoznik
On 28.08.2015 08:34, Jean-Pierre Ribeauville wrote:
> HI,
>
>
>
> Thx for your hint.
>
>
>
> I've tried this instead :
>
>
>
> <channel type='unix'>
>
> <source mode='bind' path='/opt/omnivision_1.agent'/>
>
> <target type='virtio' name='omnivision_1.agent'/>
>
> <address type='virtio-serial' controller='0' bus='0' port='2'/>
>
> </channel>
>
>
>
> Then, when starting the Guest I get this error message :
[It's better to send just text via e-mail]
So, the error message is telling you, that qemu process does not have
enough permissions to bind to the unix socket under the given path.
Either you should level up qemu permissions (e.g. run it as root), or
use path that qemu will have access to. Or set correct permissions on
the socket target.
Michal
9 years, 2 months
[libvirt-users] Using unix-type channel ....
by Jean-Pierre Ribeauville
Hi,
I'm trying to use unix-type channel to send/receive datas between host and guest .
Here are the steps I follow :
1) Adding these lines to expose a channel unix type to my guest
<channel type='unix'>
<source mode='bind' path='/var/lib/libvirt/qemu/omnivision_1.agent'/>
<target type='virtio' name='org.qemu.guest_agent.0'/>
<alias name='channel0'/>
<address type='virtio-serial' controller='0' bus='0' port='2'/>
</channel>
2) the VM_Orion-1 Guest, exposing a channel "unix" omnivision_1.agent is started, then netstat shows these new things :
netstat -apn | grep qemu
unix 2 [ ACC ] STREAM LISTENING 37214 19124/qemu-kvm /var/lib/libvirt/qemu/VM_Orion-1.monitor
unix 2 [ ACC ] STREAM LISTENING 37219 19124/qemu-kvm /var/lib/libvirt/qemu/omnivision_1.agent
unix 3 [ ] STREAM CONNECTED 37242 19124/qemu-kvm /var/lib/libvirt/qemu/omnivision_1.agent
unix 3 [ ] STREAM CONNECTED 37240 19124/qemu-kvm /var/lib/libvirt/qemu/VM_Orion-1.monitor
3) I start , on the host , a simple test in order to send datas to the guest:
.....
sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock < 0) {
perror("opening stream socket");
return(1);
}
server.sun_family = AF_UNIX;
strcpy(server.sun_path, argv[1]);
printf("connecting to socket number : %d \n",sock);
fflush(stdout);
if (connect(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un)) < 0) {
close(sock);
perror("connecting stream socket");
return(1);
}
printf("writing data on stream socket");
if (write(sock, DATA, sizeof(DATA)) < 0)
perror("writing on stream socket");
close(sock);
.....
4) invoking > test "/var/lib/libvirt/qemu/omnivision_1.agent"
then I got :
connecting to socket number : 3
writing data on stream socket
and following netstat result :
netstat -apn | grep qemu
unix 2 [ ACC ] STREAM LISTENING 39348 20587/qemu-kvm /var/lib/libvirt/qemu/VM_Orion-1.monitor
unix 2 [ ACC ] STREAM LISTENING 39353 20587/qemu-kvm /var/lib/libvirt/qemu/omnivision_1.agent
unix 2 [ ] STREAM CONNECTING 0 - /var/lib/libvirt/qemu/omnivision_1.agent
unix 3 [ ] STREAM CONNECTED 39375 20587/qemu-kvm /var/lib/libvirt/qemu/omnivision_1.agent
unix 3 [ ] STREAM CONNECTED 39373 20587/qemu-kvm /var/lib/libvirt/qemu/VM_Orion-1.monitor
5) if I try to re-invoke test "/var/lib/libvirt/qemu/omnivision_1.agent" then :
netstat -apn | grep qemu
tcp 0 0 127.0.0.1:5902 0.0.0.0:* LISTEN 20587/qemu-kvm
tcp 0 0 127.0.0.1:5902 127.0.0.1:57772 ESTABLISHED 20587/qemu-kvm
unix 2 [ ACC ] STREAM LISTENING 39348 20587/qemu-kvm /var/lib/libvirt/qemu/VM_Orion-1.monitor
unix 2 [ ACC ] STREAM LISTENING 39353 20587/qemu-kvm /var/lib/libvirt/qemu/omnivision_1.agent
unix 2 [ ] STREAM CONNECTING 0 - /var/lib/libvirt/qemu/omnivision_1.agent
unix 2 [ ] STREAM CONNECTING 0 - /var/lib/libvirt/qemu/omnivision_1.agent
unix 3 [ ] STREAM CONNECTED 39375 20587/qemu-kvm /var/lib/libvirt/qemu/omnivision_1.agent
unix 3 [ ] STREAM CONNECTED 39373 20587/qemu-kvm /var/lib/libvirt/qemu/VM_Orion-1.monitor
on the guest side , I try to retrieve datas sent by host , by using this kind of thing :
...
int fd = open("/dev/virtio-ports/org.qemu.guest_agent.0", O_RDWR | O_NONBLOCK);
ssize_t size = read(fd, &buffer, 100);
...
As you can imagine , I never receive any data from the host .
Is it the right way to use this "unix-type" channel ?
Thx for your patience.
Regards,
J.P. Ribeauville
P: +33.(0).1.47.17.27.87
Puteaux 3 Etage 5 Bureau 4
jpribeauville(a)axway.com<mailto:jpribeauville@axway.com>
http://www.axway.com<http://www.axway.com/>
P Pensez à l'environnement avant d'imprimer.
9 years, 2 months
[libvirt-users] Virtio serial exposition
by Jean-Pierre Ribeauville
Hi,
I try to exchange datas between host and Guest by adding these lines in a guest .xml conf file :
<channel type='pty'>
<target type='virtio' name='arbitrary.virtio.serial.port.name'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
Then /dev/virtio-ports/arbitrary.virtio.serial.port.name is exposed in the guest and a /dev/pts/x is seen as source path on the host.
I checked that on two Linux hosts :
1)
libvirt-daemon-driver-qemu-1.2.8-16.el7_1.3.x86_64
qemu-kvm-1.5.3-86.el7_1.5.x86_64
qemu-kvm-common-1.5.3-86.el7_1.5.x86_64
qemu-guest-agent-2.1.0-4.el7.x86_64
ipxe-roms-qemu-20130517-6.gitc4bce43.el7.noarch
qemu-img-1.5.3-86.el7_1.5.x86_64
Linux sparring 3.10.0-229.el7.x86_64 #1 SMP Thu Jan 29 18:37:38 EST 2015 x86_64 x86_64 x86_64 GNU/Linux
2)
qemu-img-0.12.1.2-2.415.el6.x86_64
qemu-kvm-0.12.1.2-2.415.el6.x86_64
gpxe-roms-qemu-0.9.7-6.10.el6.noarch
Linux orion 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
The device is only exposed on the guest of the first host .
Is it due to a too old version of qemu and/or Linux on the second host or some packages missing on this second host ?
Thx.
Regards,
J.P. Ribeauville
P: +33.(0).1.47.17.27.87
Puteaux 3 Etage 5 Bureau 4
jpribeauville(a)axway.com<mailto:jpribeauville@axway.com>
http://www.axway.com<http://www.axway.com/>
P Pensez à l'environnement avant d'imprimer.
9 years, 2 months
Re: [libvirt-users] On which /dev/pts/x is channel source
by Jean-Pierre Ribeauville
Hi,
I just tested by using "unix virtio" channel instead of pty.
It looks easier to handle.
Thx for help.
Regards,
J.P.
-----Message d'origine-----
De : libvirt-users-bounces(a)redhat.com [mailto:libvirt-users-bounces@redhat.com] De la part de libvirt-users-request(a)redhat.com
Envoyé : mercredi 26 août 2015 15:38
À : libvirt-users(a)redhat.com
Objet : libvirt-users Digest, Vol 68, Issue 26
Send libvirt-users mailing list submissions to
libvirt-users(a)redhat.com
To subscribe or unsubscribe via the World Wide Web, visit
https://www.redhat.com/mailman/listinfo/libvirt-users
or, via email, send a message with subject or body 'help' to
libvirt-users-request(a)redhat.com
You can reach the person managing the list at
libvirt-users-owner(a)redhat.com
When replying, please edit your Subject line so it is more specific than "Re: Contents of libvirt-users digest..."
Today's Topics:
1. Isolated networks && test lab (Spanky Horawitz)
2. Re: On which /dev/pts/x is channel source mapped ?
(Pierre Schweitzer)
3. Virtio serial exposition (Jean-Pierre Ribeauville)
4. Re: On which /dev/pts/x is channel source mapped ?
(Daniel P. Berrange)
----------------------------------------------------------------------
Message: 1
Date: Tue, 25 Aug 2015 17:17:56 -0700
From: Spanky Horawitz <shorawitz(a)gmail.com>
To: libvirt-users(a)redhat.com
Subject: [libvirt-users] Isolated networks && test lab
Message-ID: <1440548276.17239.68.camel@psdchristensen>
Content-Type: text/plain; charset="utf-8"
I'm trying to migrate my VirtualBox test lab to KVM. In my VB configuration, I have several VM routers with 4 interfaces each. Each router has a bridged interface which connects them all together and to the outside world. I have servers/clients dispersed on each of the other private (Isolated) segments that use the routers as default gateways.
In trying to make this work, I used Virtual Machine Manager to define 3x Virtual Networks (Isolated networks) and created a VM router which has 3 interfaces (192.168.x.1) on each Isolated network and a 4th interface using the br0 interface to get to the outside world. The router is able to connect to the outside world.
Using Virtual Machine Manager, I also created "client" VM and connected it's single interface to one of the Isolated networks. While testing connectivity of the "client" VM to the router, it seems to go straight to the Host (tested using 'ssh 192.168.x.1'.) I'm trying to isolate the networks from the Host and have the router receive packets for the
192.168.x.1 address on the individual Isolated network segments.
Host:
br0 (em1): 192.168.1.16
vibr0 (default): 192.168.122.1
virbr1: 192.168.2.1
virbr2: 192.168.3.1
virbr3: 192.168.4.1
VM router:
eth0: 192.168.1.10
eth1: 192.168.2.1
eth2: 192.168.3.1
eth3: 192.168.4.1
VM client:
eth0: 192.168.3.101
Is there some trick to isolate the Host from the VM's? Is there a comprehensive guide that explains how the networks should be setup (with/without Virtual Machine Manager)? I'm not afraid to get my hands dirty on the console if needed, but GUI's are easier to navigate when you're learning a new technology. I switched to using RemoteBox for managing my VB vm's as it made things a lot easier to deal with than VBoxManage.
Thanks for your help!
9 years, 3 months
[libvirt-users] On which /dev/pts/x is channel source mapped ?
by Jean-Pierre Ribeauville
Hi,
By adding following lines in a Guest .xml conf file , I'm able to send / receive datas between host and this guest.
<channel type='pty'>
<target type='virtio' name='arbitrary.virtio.serial.port.name'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
My question is the following :
How may I find to which /dev/pts/x is mapped the source path ( from the host point of view) ?
I was able to find it by having a look in the virt manager GUI , but I want to do it programmatically.
I've tried to force it by specifying a source path in the .xml file .... No way
Thx for help.
Regards,
J.P. Ribeauville
P: +33.(0).1.47.17.27.87
Puteaux 3 Etage 5 Bureau 4
jpribeauville(a)axway.com<mailto:jpribeauville@axway.com>
http://www.axway.com<http://www.axway.com/>
P Pensez à l'environnement avant d'imprimer.
9 years, 3 months
[libvirt-users] from command line to xml file
by Jean-Pierre Ribeauville
Hi,
In order to use a virtio-serial to exchange data between host and its guests, I'd like to modify the .xml Guest conf file by adding these parameters ( as found in the command line) :
-device virtio-serial \
-chardev socket,path=/tmp/foo,server,nowait,id=foo \
-device virtserialport,chardev=foo,name=org.fedoraproject.port.0
How should I build the XML tags ?
Thx for help.
J.P. Ribeauville
P: +33.(0).1.47.17.27.87
Puteaux 3 Etage 5 Bureau 4
jpribeauville(a)axway.com<mailto:jpribeauville@axway.com>
http://www.axway.com<http://www.axway.com/>
P Pensez à l'environnement avant d'imprimer.
9 years, 3 months