[libvirt-users] Virsh blkstat doesn't work on Xen HVM
by 張文哲
Hi
I tried to use virsh blkstat to get information of a block, but it
returns an error message as shown below
This function works fine in KVM, but fail in XEN.
I tried XEN 3.4.3 ,4.0.0 and 4.0.1 with libvirt 0.7.1 from fedora yum
server and 0.8.1 from libvirt .
All of them are fail to get the block status.
The following is the config file and error message of virsh domblkstat.
Any one knows how to make this function work?
[root@localhost ~]# virsh dumpxml vm1
<domain type='xen' id='1'>
<name>vm1</name>
<uuid>12af1ed4-2f2d-f02d-9a2a-5d4f377889d5</uuid>
<memory>524288</memory>
<currentMemory>524288</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/var/lib/libvirt/images/vm1.img'/>
<target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:36:0f:fb:7a'/>
<source bridge='eth0'/>
<script path='/etc/xen/scripts/vif-bridge'/>
<target dev='vif1.0'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/0'/>
<target port='0'/>
</serial>
<console type='pty' tty='/dev/pts/0'>
<source path='/dev/pts/0'/>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='yes' keymap='en-us'/>
<sound model='es1370'/>
</devices>
</domain>
[root@localhost ~]# virsh domblkstat vm1 hda
error: Failed to get block stats vm1 hda
error: internal error read_bd_stats: Failed to read any block statistics
14 years, 6 months
[libvirt-users] PCI Passthrough
by Jonathan Tripathy
Hi Everyone,
When I try and assign a physical device to a guest using virt-manager,
libvirt throws an error:
"Failed to create inactive domain"
I'm using libvirt 0.8.1 which I compiled myself, along with Xen 4.0 on
Ubuntu 10.04 Dom0
I'm also using virt-manager 0.8.4 which I compiled myself.
Any help would be appreciated
Thanks
14 years, 6 months
[libvirt-users] Virsh blkstat doesn't work on Xen HVM
by wenche_chang@trend.com.tw
Hi
I tried to use virsh blkstat to get information of a block, but it returns an error message as shown below
This function works fine in KVM, but fail in XEN.
I tried XEN 3.4.3 ,4.0.0 and 4.0.1 with libvirt 0.7.1 from fedora yum server and 0.8.1 from libvirt .
All of them are fail to get the block status.
The following is the config file and error message of virsh domblkstat.
Any one knows how to make this function work?
[root@localhost ~]# virsh dumpxml vm1
<domain type='xen' id='1'>
<name>vm1</name>
<uuid>12af1ed4-2f2d-f02d-9a2a-5d4f377889d5</uuid>
<memory>524288</memory>
<currentMemory>524288</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/var/lib/libvirt/images/vm1.img'/>
<target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:36:0f:fb:7a'/>
<source bridge='eth0'/>
<script path='/etc/xen/scripts/vif-bridge'/>
<target dev='vif1.0'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/0'/>
<target port='0'/>
</serial>
<console type='pty' tty='/dev/pts/0'>
<source path='/dev/pts/0'/>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='yes' keymap='en-us'/>
<sound model='es1370'/>
</devices>
</domain>
[root@localhost ~]# virsh domblkstat vm1 hda
error: Failed to get block stats vm1 hda
error: internal error read_bd_stats: Failed to read any block statistics
TREND MICRO EMAIL NOTICE
The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.
TREND MICRO EMAIL NOTICE
The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.
14 years, 6 months
[libvirt-users] Working example of logical storage pool and volume creation?
by Justin Clift
Hi all,
Does anyone have a working example of creation of a logical storage pool
and volume?
I'm hitting a wall getting logical volumes to work on RHEL 6 beta.
There's a single drive I'm trying to setup (sdc) as a libvirt managed
logical storage pool, but all volume creation on it fails.
Here's what I'm finding so far:
Prior to any storage pool work, only the host boot drive (sda) is in lvm.
# vgs
VG #PV #LV #SN Attr VSize VFree
vg_host2 1 3 0 wz--n- 465.27g 0
# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 vg_host2 lvm2 a- 465.27g 0
# ls -la /dev/mapper
total 0
drwxr-xr-x. 2 root root 120 Jun 1 03:12 .
drwxrwxrwt. 21 root root 3920 Jun 1 03:12 ..
crw-rw----. 1 root root 10, 58 May 31 14:08 control
lrwxrwxrwx. 1 root root 7 May 31 14:10 vg_host2-lv_home -> ../dm-7
lrwxrwxrwx. 1 root root 7 May 31 14:08 vg_host2-lv_root -> ../dm-0
lrwxrwxrwx. 1 root root 7 May 31 14:10 vg_host2-lv_swap -> ../dm-8
#
Creation of a logical storage pool, using sdc:
# virsh pool-define-as guest_images_lvm logical - - /dev/sdc
libvirt_lvm /dev/mapper
Pool guest_images_lvm defined
# virsh pool-info guest_images_lvm
Name: guest_images_lvm
UUID: 17398035-8000-7252-ab25-58db95aed130
State: inactive
# virsh pool-build guest_images_lvm
Pool guest_images_lvm built
#
The physical device and volume group are seen in lvm:
# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 vg_host2 lvm2 a- 465.27g 0
/dev/sdc libvirt_lvm lvm2 a- 465.76g 465.76g
# vgs
VG #PV #LV #SN Attr VSize VFree
libvirt_lvm 1 0 0 wz--n- 465.76g 465.76g
vg_host2 1 3 0 wz--n- 465.27g 0
#
Starting the logical pool works:
# virsh pool-start guest_images_lvm
Pool guest_images_lvm started
#
Creation of volumes fail:
# virsh vol-create-as guest_images_lvm volume1 8G
error: Failed to create vol volume1
error: internal error '/sbin/lvcreate --name volume1 -L 8388608K
/dev/mapper' exited with non-zero status 3 and signal 0: Volume group
name expected (no slash)
Run `lvcreate --help' for more information.
#
So, it looked like "/dev/mapper" in the pool-define-as command should
have instead been the LVM volume group again. That doesn't work either
though:
# virsh pool-define-as guest_images_lvm logical - - /dev/sdc
libvirt_lvm libvirt_lvm
Pool guest_images_lvm defined
# virsh pool-build guest_images_lvm
Pool guest_images_lvm built
# virsh pool-start guest_images_lvm
Pool guest_images_lvm started
# virsh vol-create-as guest_images_lvm volume1 8G
error: Failed to create vol volume1
error: cannot read path 'libvirt_lvm/volume1': No such file or directory
Looking in the libvirtd logs for this last attempt, the volume was
actually successfully created. But libvirtd then checks for it's
presence (wrongly!), doesn't find it, and then lvremove's it:
03:01:24.000: debug : virRunWithHook:832 : /sbin/lvcreate --name
volume1 -L 8388608K libvirt_lvm
...
03:01:24.223: debug : virRunWithHook:848 : Command stdout: Logical
volume "volume1" created
...
03:01:24.223: error : virStorageBackendLogicalCreateVol:616 : cannot
read path 'libvirt_lvm/volume1': No such file or directory
...
03:01:24.223: debug : virRunWithHook:832 : /sbin/lvremove -f
libvirt_lvm/volume1
Guessing I'm either doing something wrong, or hitting bugs, or ?
Anyone have ideas/suggestions/etc?
Regards and best wishes,
Justin Clift
--
Salasaga - Open Source eLearning IDE
http://www.salasaga.org
14 years, 6 months
[libvirt-users] Mount options for fs type storage pools?
by Justin Clift
Hi all,
Presently writing up "Storage Pool" docs for the Fedora Virtualisation
Guide. (using both virsh and virt-manager)
Having trouble finding out how to specify mount options for fs type
storage pools.
For example:
# virsh pool-define-as guest_images_fs fs - - /dev/sdc1 - "/guest_images"
Pool guest_images_fs defined
# virsh pool-build guest_images_fs
Pool guest_images_fs built
# virsh pool-start guest_images_fs
Pool guest_images_fs started
# mount | grep guest_images
/dev/sdc1 on /guest_images type ext4 (rw)
#
Notice that /guest_images is mounted with default options. Nothing
wrong with that, but lets say the SysAdmin has a need to pass specific
mount options. (ie journal_checksum, or noatime, or nodiratime, etc)
Checked the virStorageBackendFileSystemMount() function in present git
master, and it doesn't look like mount options are considered for
anything other than Gluster?
How to do it, or is it best to not use libvirt to manage the mounting of
this type of storage when options are needed?
Regards and best wishes,
Justin Clift
--
Salasaga - Open Source eLearning IDE
http://www.salasaga.org
14 years, 6 months
[libvirt-users] Host should not touch passed-through USB device, how?
by Andreas Ntaflos
Hello list,
this may be off topic but it is closely related to my Libvirt adventures
so maybe you can help me.
I want to pass a USB device (a USB Huawei E620 modem) through to a KVM
guest. Pass-through in general works fine and the modem is visible in
the guest. However, the host still sees it and sometimes tries to access
it (such modems seem to also be USB storage devices). This naturally
leads to conflicts and I believe this crashed the guest very badly
yesterday.
So I am looking for a way to make sure the host passes through the USB
device (in its entirety) without trying to touch it and claim it as its
own. Preferably without disabling the USB storage subsystem completely
on the host.
Any ideas? Is there a best practice for such things in the Libvirt
world? Or any other world?
Thanks!
Andreas
--
Andreas Ntaflos
GPG Fingerprint: 6234 2E8E 5C81 C6CB E5EC 7E65 397C E2A8 090C A9B4
14 years, 6 months
[libvirt-users] Qemu driver not supporting VIR_DOMAIN_DEVICE_MODIFY_CONFIG yet?
by Guido Winkelmann
Hi,
According to the docs on
http://libvirt.org/html/libvirt-libvirt.html#virDomainDetachDeviceFlags
I ought to be able to do
virDomainDetachDeviceFlags(
<domain>,
<devicexml>,
VIR_DOMAIN_DEVICE_MODIFY_LIVE | VIR_DOMAIN_DEVICE_MODIFY_CONFIG);
to detach a volume both from a currently running VM instance and permanently
from the defined config file.
If I actually try that, though, I'm getting this error:
libvir: QEMU error : Requested operation is not valid: cannot modify the
persistent configuration of a domain
The same thing happens whether or not the domain is running and also happens
if I leave out the "VIR_DOMAIN_DEVICE_MODIFY_LIVE" part.
Does the qemu driver simply not support VIR_DOMAIN_DEVICE_MODIFY_CONFIG yet
(libvirt 0.8.1), or is there some other problem here?
Guido
14 years, 6 months
[libvirt-users] Monitoring KVM Machine Uptimes
by Karsten Knese
Hey folks.
Currently, I am working on an accounting-solution for Private Cloud with
Eucalyptus as my bachelor-thesis. Eucalyptus bases on libvirt providing
the KVM machines. Part of the thesis is kind of measurement for the
uptimes of each instance in the cloud.
As Eucalyptus is based on libvirt, i want to know if there is kind of
tool already setup for monitoring a vm in terms of uptimes, cputimes and
disk i/o.
If not, can anyone give me a hint, how i could grep these facts?
I found a tool called "virt-top" which monitors the vm, but for me there
is to much overhead.
Thanks for you support.
cheers,
Karsten
14 years, 6 months
[libvirt-users] FailOver IP
by Christian Hermann
hi guys!
i`am new to libvirt and i want using kvm with a ipv4 failover
ip-address. so this addres has the netmask 255.255.255.255.
this ip is directly bind to my root server by my provider. so i can not
use it on an other server.
can you tell me how i can use this ip address on a kvm virtual maschine,
build with libvirt?
Kind regards,
Chris
14 years, 6 months