Virsh migrate and paused vm
by Paras Pradhan
Hello
I have a question regarding virsh migrate. I see this when I migrate a vm
using the command
---
virsh --connect=xen:///system migrate --live --verbose vm1
xen+ssh://node2/system
---
I see the vm keeps running on node1 and on node2 its paused.
Libvirt version is 5.1.0-8.11.6.x86_64 and hypervisor is Xen 4.12. No
issues when running
---
xl migrate vm1 node2
---
Any help is appreciated.
Thanks
P
4 years, 4 months
php libvirt show active snapshot
by Todd Lewis
Is php libvirt able to list the active snapshot for the vm?
I can easily take snapshots and restore snapshots, but I can't figure
out how to display the currently active snapshot using php libvirt.
--
Todd Lewis
Grizzly Star
(469) 363-2907 Cell
www.grizzlystar.com
4 years, 4 months
My VMs don't get IP with libvirt and dnsmasq
by Computers Issues
Hello there,
I wanted to share a problem I'm having with libvirt, for the case someone
here could know how to solve it.
I'm using an Ubuntu 18.04 LTS, I have libvirtd already installed and I
think I got all the dependencies installed. So, I'm using virsh net-create
to create this network:
<network>
<name>pepito</name>
<forward mode='nat'/>
<bridge name='virbr2' stp='on' delay='0'/>
<ip address='192.168.150.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.150.2' end='192.168.150.254'/>
</dhcp>
</ip>
</network>
And then I create a domain with this xml:
<domain type='qemu' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>ARM</name>
<memory unit='KiB'>262144</memory>
<currentMemory unit='KiB'>262144</currentMemory>
<os>
<type arch='armv7l' machine='virt-2.9'>hvm</type>
<kernel>~/zImage</kernel>
<cmdline>console=ttyAMA0 root=/dev/vda</cmdline>
<boot dev='hd'/>
</os>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file=' ~/rootfs.qcow2'/>
<target dev='hda' bus='virtio'/>
</disk>
<controller type='virtio-serial' index='0'>
<address type='virtio-mmio'/>
</controller>
<interface type='network'>
<mac address='52:54:00:09:a4:37'/>
<model type='virtio'/>
<source network='pepito'/>
<address type='virtio-mmio'/>
</interface>
</devices>
<qemu:commandline>
<qemu:arg value='-device'/>
<qemu:arg value='virtio-net-pci'/>
<qemu:arg value='-netdev'/>
<qemu:arg value='user,id=net1'/>
</qemu:commandline>
</domain>
They both work as I created them in a different computer and everything
works. But I'm trying it on my other Ubuntu machine, and once virsh creates
the network and the domain, my VM never get an IP from that DHCP range.
This is libvirtd log:
abr 17 00:48:11 usuario-System-Product-Name dnsmasq-dhcp[13741]: DHCP, IP
range 192.168.150.2 -- 192.168.150.254, lease time 1h
abr 17 00:48:11 usuario-System-Product-Name dnsmasq-dhcp[13741]: DHCP,
sockets bound exclusively to interface virbr2
abr 17 00:48:11 usuario-System-Product-Name dnsmasq[13741]: reading
/etc/resolv.conf
abr 17 00:48:11 usuario-System-Product-Name dnsmasq[13741]: using
nameserver 127.0.0.53#53
abr 17 00:48:11 usuario-System-Product-Name dnsmasq[13741]: read /etc/hosts
- 7 addresses
abr 17 00:48:11 usuario-System-Product-Name dnsmasq[13741]: read
/var/lib/libvirt/dnsmasq/pepito.addnhosts - 0 addresses
abr 17 00:48:11 usuario-System-Product-Name dnsmasq-dhcp[13741]: read
/var/lib/libvirt/dnsmasq/pepito.hostsfile
Does anybody know why it could be that the VM never gets an IP from the
range I defined? As I said, exactly the same configuration worked in a
different machine, I don't know why it does not work here.
Thank you so much!!
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_camp...>
Libre
de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_camp...>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
4 years, 4 months
Ovs error when starting vm: ovs-vsctl: 'del-port' command requires at least 1 arguments
by Thomas Pircher
Hi,
my system got updated to libvirt 6.0.0 (from 5.6.0) this morning, and
now I'm having problems starting VMs that make use of openvswitch
portgroups.
When I start a VM, I get this error message on virsh:
> virsh # start testvm
> error: Failed to start domain testvm
> error: An error occurred, but the cause is unknown
The system log contains:
> Mar 30 09:45:39 tplinux ovs-vsctl[2763]: ovs|00001|db_ctl_base|ERR|'del-port' command requires at least 1 arguments
> Mar 30 09:45:39 tplinux libvirtd[735]: internal error: Child process (ovs-vsctl --timeout=5 -- --if-exists del-port) unexpected exit status 1: ovs-vsctl: 'del-port' command requires at least 1 arguments
> Mar 30 09:45:39 tplinux libvirtd[735]: internal error: Unable to delete port (null) from OVS
My network "test-net" looks like:
> <network>
> <name>test-net</name>
> <forward mode='bridge'/>
> <bridge name='test-net'/>
> <virtualport type='openvswitch'/>
> <portgroup name='fabric' default='yes'>
> <vlan trunk='yes'>
> <tag id='10' nativeMode='untagged'/>
> <tag id='20'/>
> <tag id='30'/>
> <tag id='40'/>
> <tag id='50'/>
> <tag id='60'/>
> <tag id='70'/>
> </vlan>
> </portgroup>
> </network>
And the network in the domain xml file is:
> <interface type='network'>
> <mac address='01:23:45:67:89:ab'/>
> <source network='test-net' portgroup='fabric'/>
> <model type='e1000'/>
> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
> </interface>
I didn't see any change in the changelog related to ovs or portgroups.
Is there something I need to change in my VM definition?
Thanks,
Thomas
4 years, 4 months
what a correct use for virConnectDomainEventRegisterAny API, how to Obtain a stable expected result
by thomas.kuang
HI, everyone:
My target deal with network hotplug use virDomainDetachDeviceFlags. Because when the API return ,the network maybe doesn’t remove from my vm guest os.
So I use virConnectDomainEventRegisterAny to register an event ID: VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED ,
my process as follow:
cb_para->call_id=virConnectDomainEventRegisterAny(cb_para->conn,cb_para->dom,VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, VIR_DOMAIN_EVENT_CALLBACK(vnf_control_del_network_cb), cb_para, vnf_control_del_network_cb_free);
flags |= VIR_DOMAIN_AFFECT_CONFIG;
if (virDomainIsActive(dom) == 1) {
flags |= VIR_DOMAIN_AFFECT_LIVE;
}
ret = virDomainDetachDeviceFlags(dom, xml, flags);
above code write in thread loop ,then in the same loop :
while (1) {
mission = vnf_mission_queue_get(task);
if (mission == NULL) {
sleep(1);
continue;
}
vnf_op_process(&mission->info); // this will deal with network hotplug,will call virConnectDomainEventRegisterAny then call virDomainDetachDeviceFlags
if (mission) {
vnf_mission_free(mission);
}
if(virEventRunDefaultImpl() < 0) { // at here process the registered callback for event-registered
printf();....
}
}
My problem is: some time , the virEventRunDefaultImpl can trigger the vnf_control_del_network_cb callback ,but some time there is nothing ,as if the VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED has lost.
what cause the Unpredictable behavior ? what is a correct use for virConnectDomainEventRegisterAny ?
if can't trigger the vnf_control_del_network_cb callback , the memory :cb_para will mem-leak,
so in order to deal the execpt ,i register a timer to process the VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED timeout
cb_para->timer_id = virEventAddTimeout(cb_para->time_out, vnf_control_del_network_timeout_cb, cb_para, vnf_control_del_network_cb_free);
thought use the timer ,can i avoid the cb_para mem-leak, but fail to achive hotplug network .
4 years, 4 months
Connections Driver VirtualBox
by claudia freitas
Good Morning!
My name is Cláudia, I'm trying to use the Connections to VirtualBox driver
from libvirt.org on Pacemaker to start a virtual machine created with the
VirtualBox hypervisor, so far I haven't been successful.
Could you send me a practical example of how to use the driver with the
VirtualDomain feature in Pacemaker? The examples I found only demonstrate
the use with Xen and Qemu.
Thanks,
4 years, 4 months
cloud-init libvirt
by PunkGeek
is there any way to use cloud-init configs in python libvirt?
cloud-init require to create an iso, which seems that ovirt support
cloud-config: https://red.ht/2K1gBkn
But how can I do that by python libvirt?
I know I can mount iso by python libvirt to the VM, but the process of
creating iso file is the problem which if it is possible to enter the
cloud-config commands by libvirt could be better to me.
Regards
4 years, 4 months
Running libvirtd on windows
by Dhananjay Joshi
Hi I have downloaded virt-viewer package for windows 10 to run the libvirt framework on windows .When I try to run the virt-viewer facing the issue of not getting the libvirtd URI to connect as below:
Any pointers on how to run libvirtd on windows would help...
[cid:4d4f58c1-09b4-4ee8-9d66-a9ab91cf1cd2]
This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.
4 years, 4 months