[libvirt-users] Libvirt in Windows not working
by arpita k
Hi,
This is Arpita.
I am using Libvirt API in the Windows Vista system.VMware is installed over
there.I have installed Libvirt and Python 2.6 in the Windows Vista system
andhave written a small test file in Python.
Here is the code:
import libvirt*
*
import sys
conn = libvirt.openReadOnly(None)
if conn == None:
print *'Failed to open connection to the hypervisor'
*
sys.exit(1)
try:
dom0 = conn.lookupByName(*"vmware1"*)
except:
print *'Failed to find the main domain'
*
sys.exit(1)
print *"Domain 0: id %d running %s"* % (dom0.ID(), dom0.OSType())
print dom0.info()
When I am trying to execute this python code I received error message that :
ImportError: No module named libvirt
Please help me.
Regards,
Arpita
13 years, 9 months
[libvirt-users] Disk atomicity...
by Dale Amon
I suspect the answer is no, as the very idea makes
my head hurt, but a confirmation would be nice:
Am I correct in assuming that it is a very bad idea
to mount a physical disk on both the physical machine
and on a hosted VM at the same time?
I can imagine getting away with it if one were RO, but
not otherwise.
Any takers?
13 years, 9 months
[libvirt-users] Live migration using virsh
by rajalakshmi
Sir,
I am working in cloud environment and i have set up a private cloud using
eucalyptus. I am trying to migrate virtual machines within the cloud using
virsh migrate command. I could successfully implement it but when i wanted
to know the method used to do live migration. I tried to interpret the code.
I also saw that they are setting a flag initially if it is live migration
and then assigning 1 to variable live. and i also could find that
xenDomainMigratePrepare is calling xend_op which in turn is calling
xend_op_ext. But i could'n understand the method of migration. Can you
please explain the logic?
13 years, 9 months
[libvirt-users] Network/bridge questions
by Alex
Hi,
I have an fc14 install and would like to install a few kvm guests but
am having difficulty with the networking. On the host I have disabled
NetworkManager and configured a bridge which has eth0, the only
physical interface on the server.
I have a dhcp server on the local lan, and if I add a mac address
entry to my dhcpd.conf, the guest will find an IP from there. I think
somehow the guest interface is not properly being routed through the
virtual gateway created by libvirtd, and is instead just routed
through br0 directly on the host. What am I missing?
Here is some relevant output from some of the things I know:
# # brctl show
bridge name bridge id STP enabled interfaces
br0 8000.485b3961b55c no eth0
vnet0
virbr0 8000.000000000000 yes
I don't understand what purpose the vnet0 has, or even how it got
there in the first place. Is it necessary, or did I do something wrong
here?
# virsh net-list --all
Name State Autostart
-----------------------------------------
default active yes
>From the guest xml file in /etc/libvirt/qemu/
<interface type='bridge'>
<mac address='52:54:00:a8:c5:9d'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</interface>
I've also flushed the firewall rules, so I'm sure the dhcp request
isn't being blocked. I've also tried changing the br0 above to virbr0,
with no change.
This is from "net-edit default" in virsh:
<network>
<name>default</name>
<uuid>3d1f153f-fc0f-4de5-98c8-7f99f96f34d6</uuid>
<forward mode='nat'/>
<bridge name='virbr0' stp='on' delay='0' />
<ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.122.2' end='192.168.122.254' />
</dhcp>
</ip>
</network>
Sure would appreciate any ideas you may have.
Thanks,
Alex
13 years, 9 months
[libvirt-users] libvirt, snapshots, LVM, and existing VMs
by Casey Link
Hello,
I am running libvirt 0.8.3 with a couple VMs using a LVM VG that I had
previously setup on my host. I did not use the storage pool
functionality of libvirt to create the VG in the first place
('pool-list' is empty).
Now I want to be able to take snapshots of the VMs. Having read this
previous post [1] on the mailing list, I gather that libvirt does
indeed support taking snapshots of VMs on an LVM. I suppose I need to
create storage pool that includes the <backingStore> element. However,
I am not sure how to go about creating this pool and making my
existing VMs utilize it.
Is what I am trying to do even possible? If so, what is the proper way
to go about doing it?
Best,
Casey Link
[1] http://www.redhat.com/archives/libvir-list/2009-February/msg00196.html
13 years, 9 months
[libvirt-users] iSCSI storage pool questions
by Anthony Goddard
Hi All,
I've been trying to figure out the best way of using an iSCSI SAN with KVM and thanks to a helpful post by Tom Georgoulias that I found on this list (https://www.redhat.com/archives/libvirt-users/2010-May/msg00008.html), it appears I have a solution.
What I'm wondering is the following:
1) If I use an iSCSI LUN as the storage pool (instead of creating an LVM VG from this iSCSI LUN manually first and using LVM in libvirt) do I loose any functionality (such as snapshotting)?
2) If I am intending on doing offline & live-migration between hosts, does each host have to connect to the same LUN / storage pool, or should each host have a separate LUN that is stores VMs on and then each host should simply see all of the LUNs so that migration is possible?
For example:
I create a LUN on the SAN, connect this to host 1 as a pool called "pool 1" and create VMs on it.
Then, on host 2, do I connect to the same "pool 1" and create VMs there, or do I just connect to "pool 1" in order to see it (for migrations) but also define "pool 2" from another new LUN on the SAN and create VMs there? Hope that makes sense..
I'm trying to understand in what situations I might get myself in trouble by two hosts performing storage operations at the same time on the same pool (which is unlikely, but I'm trying to figure out where I stand)
Thanks!
Anthony
13 years, 9 months
[libvirt-users] virsh : Need help to manage a vm on a remote vmWare
by Etienne GOSSET
Hello,
I'm trying to use the tool virsh of libvirt.
I want to manage via CLI a vm on a vmware hypervisor which is hosted on a remote host (Is that what you call the node??).
I read a lot of thing on your site but I really don't understand how to do something...
I saw that:
>virsh edit $your-vm-name
I think "$your-vm-name" is the xml file you're talking about?
Is it mandatory to use those XML file in order to use virsh? (Because it is very huge!)
I also saw this way of using virsh :
>virsh --connect esx://user@hypervisorHost://path/to/myVM.vmx
Result is:
error: invalid argument in libvirt was built without the 'esx' driver
What is the problem here?
For information, I installed libvirt-0.8.7, can you give me the first step to manage an existing vm hosted on a distant vmWare (via CLI).
Thank you in advance.
13 years, 9 months
[libvirt-users] network-performance
by Orion Poplawski
I'm just starting to take a look at guest networking performance and am a
little disappointed. I'm comparing two setups:
Host: Windows Server 2008 R2 Hyper-V
Guest: CentOS 5.5 x86_64
Host: CentOS 5.5 x86_64 kvm running libvirt
Guest: CentOS 5.5 x86_64
The guests are essentially identical except that I'm running the Microsoft
Linux Integration Components synthetic drivers on the windows hosted VM. The
libvirt setup uses bridged networking. Running bonnie++ on a nfs mounted
filesystem on each guest I'm seeing the libvirt hosted guest get between
16%-35% of the performance of the Hyper-V guest. Is this expected? Is there
anything I can do to increase network performance of the kvm guest?
--
Orion Poplawski
Technical Manager 303-415-9701 x222
NWRA/CoRA Division FAX: 303-415-9702
3380 Mitchell Lane orion(a)cora.nwra.com
Boulder, CO 80301 http://www.cora.nwra.com
13 years, 9 months
[libvirt-users] Not getting a virsh console
by Nikunj A. Dadhania
Hi,
I am seeing a problem with a earlier working domain configuration. Here
is the domain xml file. I am not getting the virsh console now. I am
trying this on RHEL 6.0.
Here is the list of steps that I am using:
[root@krm1 test]# virsh define vmtest.xml
Domain vmtest3 defined from vmtest.xml
[root@krm1 test]# virsh start vmtest3
Domain vmtest3 started
[root@krm1 test]# virsh console vmtest3
Connected to domain vmtest3
Escape character is ^]
[root@krm1 test]# virsh dominfo vmtest3
Id: 2
Name: vmtest3
UUID: 2b38ff93-1bc6-c78c-1ed8-ffb936c86dac
OS Type: hvm
State: running
CPU(s): 1
CPU time: 17.3s
Max memory: 524288 kB
Used memory: 524288 kB
Persistent: yes
Autostart: disable
[root@krm1 test]#
The state of the domain shows running. One more thing that i noted was
that qemu-kvm is consuming 100% of the cpu. So not sure if the qemu-kvm
has started properly. I am not sure how to debug the issue. Would
appreciate some help on this.
Some more information:
I have attached following file /var/log/libvirt/qemu/vmtest3.log
Executing the following command on the bash works fine and the VM comes up:
/usr/libexec/qemu-kvm -M rhel6.0.0 -enable-kvm -m 512 -smp 1,sockets=1,cores=1,threads=1 -drive file=/home/bharata/cgroup-scalability/test/test.qcow2 -nographic
While executing the command in the vmtest3.log, the VM does not come at
all.
Here is the domain xml:
<domain type='kvm'>
<name>vmtest3</name>
<memory>524288</memory>
<vcpu>1</vcpu>
<os>
<type arch='i686'>hvm</type>
<boot dev='hd'/>
</os>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/home/bharata/cgroup-scalability/test/test.qcow2'/>
<target dev='hda' bus='ide'/>
</disk>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target port='0'/>
</console>
</devices>
</domain>
Thanks,
Nikunj
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/libexec/qemu-kvm -S -M rhel6.0.0 -cpu qemu32 -enable-kvm -m 512 -smp 1,sockets=1,cores=1,threads=1 -name vmtest3 -uuid 2b38ff93-1bc6-c78c-1ed8-ffb936c86dac -nographic -nodefconfig -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/vmtest3.monitor,server,nowait -mon chardev=monitor,mode=control -rtc base=utc -no-acpi -boot c -drive file=/home/bharata/cgroup-scalability/test/test.qcow2,if=none,id=drive-ide0-0-0,boot=on,format=qcow2 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2
09:53:22.536: debug : virCgroupNew:493 : New group /libvirt/qemu/vmtest3
09:53:22.536: debug : virCgroupDetect:230 : Detected mount/mapping 0:cpu at /cgroup/cpu in
09:53:22.536: debug : virCgroupDetect:230 : Detected mount/mapping 1:cpuacct at /cgroup/cpuacct in
09:53:22.536: debug : virCgroupDetect:230 : Detected mount/mapping 2:cpuset at /cgroup/cpuset in
09:53:22.536: debug : virCgroupDetect:230 : Detected mount/mapping 3:memory at /cgroup/memory in
09:53:22.536: debug : virCgroupDetect:230 : Detected mount/mapping 4:devices at /cgroup/devices in
09:53:22.536: debug : virCgroupDetect:230 : Detected mount/mapping 5:freezer at /cgroup/freezer in
09:53:22.536: debug : virCgroupMakeGroup:451 : Make group /libvirt/qemu/vmtest3
09:53:22.536: debug : virCgroupMakeGroup:463 : Make controller /cgroup/cpu/libvirt/qemu/vmtest3/
09:53:22.536: debug : virCgroupMakeGroup:463 : Make controller /cgroup/cpuacct/libvirt/qemu/vmtest3/
09:53:22.536: debug : virCgroupMakeGroup:463 : Make controller /cgroup/cpuset/libvirt/qemu/vmtest3/
09:53:22.536: debug : virCgroupMakeGroup:463 : Make controller /cgroup/memory/libvirt/qemu/vmtest3/
09:53:22.536: debug : virCgroupMakeGroup:463 : Make controller /cgroup/devices/libvirt/qemu/vmtest3/
09:53:22.536: debug : virCgroupMakeGroup:463 : Make controller /cgroup/freezer/libvirt/qemu/vmtest3/
09:53:22.536: debug : virCgroupSetValueStr:275 : Set value '/cgroup/cpu/libvirt/qemu/vmtest3/tasks' to '7312'
09:53:22.545: debug : virCgroupSetValueStr:275 : Set value '/cgroup/cpuacct/libvirt/qemu/vmtest3/tasks' to '7312'
09:53:22.554: debug : virCgroupSetValueStr:275 : Set value '/cgroup/cpuset/libvirt/qemu/vmtest3/tasks' to '7312'
09:53:22.562: debug : virCgroupSetValueStr:275 : Set value '/cgroup/memory/libvirt/qemu/vmtest3/tasks' to '7312'
09:53:22.569: debug : virCgroupSetValueStr:275 : Set value '/cgroup/devices/libvirt/qemu/vmtest3/tasks' to '7312'
09:53:22.577: debug : virCgroupSetValueStr:275 : Set value '/cgroup/freezer/libvirt/qemu/vmtest3/tasks' to '7312'
09:53:22.585: debug : qemudInitCpuAffinity:2618 : Setting CPU affinity
09:53:22.586: debug : qemuSecurityDACSetProcessLabel:547 : Dropping privileges of VM to 107:107
char device redirected to /dev/pts/2
13 years, 9 months