[Libvirt-cim] Issue with DiskRASD size parameter on KVM with current sources.

Deepti B Kalakeri deeptik at linux.vnet.ibm.com
Thu Jul 31 12:37:07 UTC 2008



Dan Smith wrote:
> # HG changeset patch
> # User Dan Smith <danms at us.ibm.com>
> # Date 1217005489 25200
> # Node ID 3c80ea156a3c45bc321f9c465ba7692c011ab2e0
> # Parent  2972728363defd7c9a7683ebfa85a4dfc8225e32
> [TEST] Add test for DiskRASD size parameter
>
> Signed-off-by: Dan Smith <danms at us.ibm.com>
>
> diff -r 2972728363de -r 3c80ea156a3c suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py	Fri Jul 25 10:04:49 2008 -0700
> @@ -0,0 +1,127 @@
> +#!/usr/bin/python
> +#
> +# Copyright 2008 IBM Corp.
> +#
> +# Authors:
> +#    Dan Smith <danms at us.ibm.com>
> +#
> +# This library is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public
> +# License as published by the Free Software Foundation; either
> +# version 2.1 of the License, or (at your option) any later version.
> +#
> +# This library is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +# General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public
> +# License along with this library; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
> +#
> +
> +sup_types = ['Xen', 'XenFV', 'KVM']
> +default_dom = "diskrasd_test"
> +
> +import sys
> +
> +from CimTest.ReturnCodes import FAIL, PASS
> +from CimTest.Globals import do_main
> +from CimTest.Globals import logger
> +from VirtLib import utils
> +from XenKvmLib.test_doms import undefine_test_domain
> +from XenKvmLib.common_util import create_using_definesystem
> +from XenKvmLib import vsms
> +from XenKvmLib import enumclass
> +
> +def make_image(ip, size):
> +    s, fn = utils.run_remote(ip, "mktemp")
> +    if s != 0:
> +        return None
> +
> +    s, _ = utils.run_remote(ip,
> +                            "dd if=/dev/zero of=%s bs=1 count=%i" % (fn, size))
> +    if s != 0:
> +        return None
> +
> +    return fn
> +
> +def kill_image(ip, name):
> +    s, _ = utils.run_remote(ip, "rm -f %s" % name)
> +
> +    return s == 0
> +
> +def check_rasd_size(rasd, size):
> +    if rasd["AllocationUnits"] != "Bytes":
> +        logger.error("AllocationUnits != Bytes?")
> +        return FAIL
This test case fails with the current source on KVM.
KVM_DiskRASD is not able to fetch the *AllocationUnits and 
VirtualQuantity *on F9 for KVM.
Here is the xml file that I used to define the guest :

<domain type='kvm'>
<uuid>f07987b1-6a8b-4b65-bff3-41dc54c011df</uuid>
<name>diskrasd_test</name>
<on_poweroff>destroy</on_poweroff>
<on_crash>destroy</on_crash>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<currentMemory>32768</currentMemory>
<memory>32768</memory>
<devices>
<disk type='file' device='disk'>
<source file='/tmp/tmp.RAKm7sLnUF'/>
<target dev='hda'/>
</disk>
<graphics type='vnc' port='-1'/>
</devices>
</domain>

Here is the KVM_DiskRASD value for the above guest.

wbemcli gi 
http://root:p@localhost:5988/root/virt:KVM_DiskResourceAllocationSettingData.InstanceID="diskrasd_test/hda" 
-nl
localhost:5988/root/virt:KVM_DiskResourceAllocationSettingData.InstanceID="diskrasd_test/hda"
-Caption
-Description
-InstanceID="diskrasd_test/hda"
-ElementName
-ConfigurationName
-ChangeableType
-ResourceType=17
-OtherResourceType
-ResourceSubType
-PoolID
-ConsumerVisibility
-HostResource
*-AllocationUnits
-VirtualQuantity
*-Reservation
-Limit
-Weight
-AutomaticAllocation
-AutomaticDeallocation
-Parent
-Connection
-Address="/tmp/tmp.RAKm7sLnUF"
-MappingBehavior
-VirtualDevice="hda"

The details of the disk image used to define the guest is as below:
*ll /tmp/tmp.RAKm7sLnUF
-rw------- 1 root root 125952 2008-07-31 22:34 /tmp/tmp.RAKm7sLnUF

*I suppose the value of *125952 *should be filled in *VirtualQuantity 
*field ??
While *AllocationUnits and VirtualQuantity* value is being set properly 
for Xen/XenFV.

Since the test case has been accepted I am not sure if this is problem 
only on my machine.

Thanks and Regards,
Deepti.




More information about the Libvirt-cim mailing list