[PATCH] [TEST] Fix LogicalDisk-03_ld_gi_errs.py by using cim_define() function
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1223260772 25200
# Node ID 29da4cc05673c815d082af768eca278bd5b6b28b
# Parent b710ecb26adf500caa6b801fdf10e4efbed3877e
[TEST] Fix LogicalDisk-03_ld_gi_errs.py by using cim_define() function
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r b710ecb26adf -r 29da4cc05673 suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py
--- a/suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py Fri Oct 03 06:34:29 2008 -0700
+++ b/suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py Sun Oct 05 19:39:32 2008 -0700
@@ -186,7 +186,7 @@ def main():
test_disk = 'hda'
vsxml = get_class(options.virt)(test_dom, disk=test_disk)
- ret = vsxml.define(options.ip)
+ ret = vsxml.cim_define(options.ip)
if not ret:
logger.error("Failed to Define the dom: %s", test_dom)
return FAIL
16 years
KVM on Pegasus Test Run Summary for Oct 06 2008
by Deepti B Kalakeri
=================================================
KVM on Pegasus Test Run Summary for Oct 06 2008
=================================================
Distro: Fedora release 9.90.1 (Rawhide)
Kernel: 2.6.26-rc2-mm1-netns
libvirt: 0.4.5
Hypervisor: QEMU 0.9.1
CIMOM: Pegasus 2.7.1
Libvirt-cim revision: 708
Libvirt-cim changeset: 3ff9257bc87a
=================================================
FAIL : 0
XFAIL : 2
SKIP : 6
PASS : 127
-----------------
Total : 135
=================================================
XFAIL Test Summary:
ComputerSystem - 32_start_reboot.py: XFAIL
ComputerSystem - 33_suspend_reboot.py: XFAIL
=================================================
SKIP Test Summary:
ComputerSystem - 02_nosystems.py: SKIP
LogicalDisk - 02_nodevs.py: SKIP
VSSD - 02_bootldr.py: SKIP
VirtualSystemMigrationService - 01_migratable_host.py: SKIP
VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP
VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP
=================================================
Full report:
--------------------------------------------------------------------
AllocationCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
AllocationCapabilities - 02_alloccap_gi_errs.py: PASS
--------------------------------------------------------------------
ComputerSystem - 01_enum.py: PASS
--------------------------------------------------------------------
ComputerSystem - 02_nosystems.py: SKIP
ERROR - System has defined domains; unable to run
--------------------------------------------------------------------
ComputerSystem - 03_defineVS.py: PASS
--------------------------------------------------------------------
ComputerSystem - 04_defineStartVS.py: PASS
--------------------------------------------------------------------
ComputerSystem - 05_activate_defined_start.py: PASS
--------------------------------------------------------------------
ComputerSystem - 06_paused_active_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 22_define_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 23_suspend_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 27_define_suspend_errs.py: PASS
--------------------------------------------------------------------
ComputerSystem - 32_start_reboot.py: XFAIL
ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed')
ERROR - Unable to 'Reboot' dom 'cs_test_domain' using RequestedStateChange()
InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed
Bug:<00005>
--------------------------------------------------------------------
ComputerSystem - 33_suspend_reboot.py: XFAIL
ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed')
ERROR - Unable to 'Reboot' dom 'test_domain' using RequestedStateChange()
InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed
Bug:<00005>
--------------------------------------------------------------------
ComputerSystem - 35_start_reset.py: PASS
--------------------------------------------------------------------
ComputerSystem - 40_RSC_start.py: PASS
--------------------------------------------------------------------
ComputerSystem - 41_cs_to_settingdefinestate.py: PASS
--------------------------------------------------------------------
ComputerSystem - 42_cs_gi_errs.py: PASS
--------------------------------------------------------------------
ComputerSystemIndication - 01_created_indication.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 01_forward.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 03_reverse_errs.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 04_forward_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 01_forward.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 03_forward_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 05_hostsystem_cap.py: PASS
--------------------------------------------------------------------
ElementConforms - 01_forward.py: PASS
--------------------------------------------------------------------
ElementConforms - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementConforms - 03_ectp_fwd_errs.py: PASS
--------------------------------------------------------------------
ElementConforms - 04_ectp_rev_errs.py: PASS
--------------------------------------------------------------------
ElementSettingData - 01_forward.py: PASS
--------------------------------------------------------------------
ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS
--------------------------------------------------------------------
EnabledLogicalElementCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS
--------------------------------------------------------------------
HostSystem - 01_enum.py: PASS
--------------------------------------------------------------------
HostSystem - 02_hostsystem_to_rasd.py: PASS
--------------------------------------------------------------------
HostSystem - 03_hs_to_settdefcap.py: PASS
--------------------------------------------------------------------
HostSystem - 04_hs_to_EAPF.py: PASS
--------------------------------------------------------------------
HostSystem - 05_hs_gi_errs.py: PASS
--------------------------------------------------------------------
HostSystem - 06_hs_to_vsms.py: PASS
--------------------------------------------------------------------
HostedDependency - 01_forward.py: PASS
--------------------------------------------------------------------
HostedDependency - 02_reverse.py: PASS
--------------------------------------------------------------------
HostedDependency - 03_enabledstate.py: PASS
--------------------------------------------------------------------
HostedDependency - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 01_forward.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 02_reverse.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 03_forward_errs.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
HostedService - 01_forward.py: PASS
--------------------------------------------------------------------
HostedService - 02_reverse.py: PASS
--------------------------------------------------------------------
HostedService - 03_forward_errs.py: PASS
--------------------------------------------------------------------
HostedService - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
LogicalDisk - 01_disk.py: PASS
--------------------------------------------------------------------
LogicalDisk - 02_nodevs.py: SKIP
ERROR - System has defined domains; unable to run
--------------------------------------------------------------------
LogicalDisk - 03_ld_gi_errs.py: PASS
--------------------------------------------------------------------
Memory - 01_memory.py: PASS
--------------------------------------------------------------------
Memory - 02_defgetmem.py: PASS
--------------------------------------------------------------------
Memory - 03_mem_gi_errs.py: PASS
--------------------------------------------------------------------
NetworkPort - 01_netport.py: PASS
--------------------------------------------------------------------
NetworkPort - 02_np_gi_errors.py: PASS
--------------------------------------------------------------------
NetworkPort - 03_user_netport.py: PASS
--------------------------------------------------------------------
Processor - 01_processor.py: PASS
--------------------------------------------------------------------
Processor - 02_definesys_get_procs.py: PASS
--------------------------------------------------------------------
Processor - 03_proc_gi_errs.py: PASS
--------------------------------------------------------------------
Profile - 01_enum.py: PASS
--------------------------------------------------------------------
Profile - 02_profile_to_elec.py: PASS
--------------------------------------------------------------------
Profile - 03_rprofile_gi_errs.py: PASS
--------------------------------------------------------------------
RASD - 01_verify_rasd_fields.py: PASS
--------------------------------------------------------------------
RASD - 02_enum.py: PASS
--------------------------------------------------------------------
RASD - 03_rasd_errs.py: PASS
--------------------------------------------------------------------
RASD - 04_disk_rasd_size.py: PASS
--------------------------------------------------------------------
ReferencedProfile - 01_verify_refprof.py: PASS
--------------------------------------------------------------------
ReferencedProfile - 02_refprofile_errs.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 01_forward.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 02_reverse.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 03_forward_errs.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 05_RAPF_err.py: PASS
--------------------------------------------------------------------
ResourcePool - 01_enum.py: PASS
--------------------------------------------------------------------
ResourcePool - 02_rp_gi_errors.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 01_enum.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS
--------------------------------------------------------------------
SettingsDefine - 01_forward.py: PASS
--------------------------------------------------------------------
SettingsDefine - 02_reverse.py: PASS
--------------------------------------------------------------------
SettingsDefine - 03_sds_fwd_errs.py: PASS
--------------------------------------------------------------------
SettingsDefine - 04_sds_rev_errs.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 01_forward.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 03_forward_errs.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS
--------------------------------------------------------------------
SystemDevice - 01_forward.py: PASS
--------------------------------------------------------------------
SystemDevice - 02_reverse.py: PASS
--------------------------------------------------------------------
SystemDevice - 03_fwderrs.py: PASS
--------------------------------------------------------------------
VSSD - 01_enum.py: PASS
--------------------------------------------------------------------
VSSD - 02_bootldr.py: SKIP
--------------------------------------------------------------------
VSSD - 03_vssd_gi_errs.py: PASS
--------------------------------------------------------------------
VSSD - 04_vssd_to_rasd.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 01_definesystem_name.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 02_destroysystem.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 03_definesystem_ess.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 04_definesystem_ers.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 05_destroysystem_neg.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 06_addresource.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 07_addresource_neg.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 08_modifyresource.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 09_procrasd_persist.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 10_hv_version.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 11_define_memrasdunits.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 12_referenced_config.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 13_refconfig_additional_devs.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationService - 01_migratable_host.py: SKIP
--------------------------------------------------------------------
VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP
--------------------------------------------------------------------
VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP
--------------------------------------------------------------------
VirtualSystemMigrationSettingData - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 01_forward.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 02_reverse.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotService - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS
--------------------------------------------------------------------
Thanks and Regards,
Deepti.
16 years
[PATCH] [TEST] Modifying the log message in assoc.py
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1223276200 25200
# Node ID 58722293be09f1a91181a388dd3b073de0c8e10d
# Parent b710ecb26adf500caa6b801fdf10e4efbed3877e
[TEST] Modifying the log message in assoc.py
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r b710ecb26adf -r 58722293be09 suites/libvirt-cim/lib/XenKvmLib/assoc.py
--- a/suites/libvirt-cim/lib/XenKvmLib/assoc.py Fri Oct 03 06:34:29 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/assoc.py Sun Oct 05 23:56:40 2008 -0700
@@ -45,7 +45,7 @@
names = []
try:
- logger.error("DEBUG instanceref, is %s", instanceref)
+ logger.info("DEBUG instanceref, is %s", instanceref)
names = conn.AssociatorNames(instanceref, AssocClass=assoc_cn)
except pywbem.CIMError, arg:
print arg[1]
@@ -68,7 +68,7 @@
names = []
try:
- logger.error("DEBUG instanceref, is %s", instanceref)
+ logger.info("DEBUG instanceref, is %s", instanceref)
names = conn.Associators(instanceref, AssocClass=assoc_cn)
except pywbem.CIMError, arg:
print arg[1]
16 years
[PATCH] [TEST]#3 Fix HostedService.02, 03&04 to work with sblim base provider installed
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222482583 25200
# Node ID 145cde258442f326f9503bc261f9f3674e2fe82d
# Parent 0ecb3a22c3617eaa4298dfd9cd3b7b27b9846110
[TEST]#3 Fix HostedService.02,03&04 to work with sblim base provider installed
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 0ecb3a22c361 -r 145cde258442 suites/libvirt-cim/cimtest/HostedService/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Fri Sep 26 02:44:52 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Fri Sep 26 19:29:43 2008 -0700
@@ -25,6 +25,7 @@ from VirtLib import utils
from VirtLib import utils
from XenKvmLib import assoc
from XenKvmLib import enumclass
+from XenKvmLib.common_util import get_host_info
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from XenKvmLib.const import do_main
@@ -37,11 +38,11 @@ def main():
def main():
options = main.options
keys = ['Name', 'CreationClassName']
- try:
- host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
- except Exception:
- logger.error(Globals.CIM_ERROR_ENUMERATE % host_sys.CreationClassName)
+ status, host_name, host_ccn = get_host_info(options.ip, options.virt)
+ if status != PASS:
+ logger.error("Check sblim provider or enumerate hostsystem error")
return FAIL
+
servicelist = {"ResourcePoolConfigurationService" : "RPCS",
"VirtualSystemManagementService" : "Management Service",
"VirtualSystemMigrationService" : "MigrationService"}
@@ -54,8 +55,8 @@ def main():
options.virt,
Name = v,
CreationClassName = get_typed_class(options.virt, k),
- SystemCreationClassName = host_sys.CreationClassName,
- SystemName = host_sys.Name)
+ SystemCreationClassName = host_ccn,
+ SystemName = host_name)
except Exception:
logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % item)
return FAIL
@@ -67,10 +68,10 @@ def main():
ccn = assoc_host[0].keybindings['CreationClassName']
name = assoc_host[0].keybindings['Name']
- if ccn != get_typed_class(options.virt, "HostSystem"):
+ if ccn != host_ccn:
logger.error("CreationClassName Error")
return FAIL
- elif name != host_sys.Name:
+ elif name != host_name:
logger.error("CCN Error")
return FAIL
diff -r 0ecb3a22c361 -r 145cde258442 suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Fri Sep 26 02:44:52 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Fri Sep 26 19:29:43 2008 -0700
@@ -25,6 +25,7 @@ from pywbem.cim_obj import CIMInstanceNa
from pywbem.cim_obj import CIMInstanceName
from XenKvmLib import assoc
from XenKvmLib import enumclass
+from XenKvmLib.common_util import get_host_info
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_USER, \
CIM_PASS, CIM_NS
@@ -40,24 +41,22 @@ def main():
options = main.options
rc = -1
status = FAIL
- keys = ['Name', 'CreationClassName']
- try:
- host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
- except Exception:
- logger.error(CIM_ERROR_ENUMERATE % host_sys.name)
+ status, host_name, host_ccn = get_host_info(options.ip, options.virt)
+ if status != PASS:
+ logger.error("Error in calling get_host_info function")
return FAIL
-
-
+
conn = assoc.myWBEMConnection('http://%s' % options.ip,
(CIM_USER, CIM_PASS),
CIM_NS)
instanceref = CIMInstanceName(get_typed_class(options.virt, "HostSystem"),
- keybindings = {"Wrong" : "wrong", "CreationClassName" : host_sys.CreationClassName})
+ keybindings = {"Wrong" : "wrong", \
+ "CreationClassName" : host_ccn})
names = []
-
+ assoc_class = get_typed_class(options.virt, "HostedService")
try:
- names = conn.AssociatorNames(instanceref, AssocClass = get_typed_class(options.virt, "HostedService"))
+ names = conn.AssociatorNames(instanceref, AssocClass = assoc_class)
rc = 0
except pywbem.CIMError, (rc, desc):
if rc == exp_rc and desc.find(exp_desc) >= 0:
@@ -70,7 +69,8 @@ def main():
logger.error(details)
if rc == 0:
- logger.error("HostedService associator should NOT return excepted result with a wrong key name and value of HostSystem input")
+ logger.error("HostedService associator should NOT return excepted result\
+ with a wrong key name and value of HostSystem input")
status = FAIL
return status
diff -r 0ecb3a22c361 -r 145cde258442 suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py
--- a/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Fri Sep 26 02:44:52 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Fri Sep 26 19:29:43 2008 -0700
@@ -25,6 +25,7 @@ from pywbem.cim_obj import CIMInstanceNa
from pywbem.cim_obj import CIMInstanceName
from XenKvmLib import assoc
from XenKvmLib import enumclass
+from XenKvmLib.common_util import get_host_info
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_USER, \
CIM_PASS, CIM_NS
@@ -40,13 +41,10 @@ def main():
options = main.options
rc = -1
status = FAIL
- keys = ['Name', 'CreationClassName']
- try:
- host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
- except Exception:
- logger.error(CIM_ERROR_ENUMERATE % host_sys.name)
+ status, host_name, host_ccn = get_host_info(options.ip, options.virt)
+ if status != PASS:
+ logger.error("Error in calling get_host_info function")
return FAIL
-
servicelist = {get_typed_class(options.virt, "ResourcePoolConfigurationService") : "RPCS",
get_typed_class(options.virt, "VirtualSystemManagementService") : "Management Service",
@@ -60,12 +58,12 @@ def main():
instanceref = CIMInstanceName(k,
keybindings = {"Wrong" : v,
"CreationClassName" : "wrong",
- "SystemCreationClassName" : host_sys.CreationClassName,
- "SystemName" : host_sys.Name})
+ "SystemCreationClassName" : host_name,
+ "SystemName" : host_ccn})
names = []
-
+ assoc_class = get_typed_class(options.virt, "HostedService")
try:
- names = conn.AssociatorNames(instanceref, AssocClass = get_typed_class(options.virt, "HostedService"))
+ names = conn.AssociatorNames(instanceref, AssocClass = assoc_class)
rc = 0
except pywbem.CIMError, (rc, desc):
if rc == exp_rc and desc.find(exp_desc) >= 0:
@@ -78,7 +76,8 @@ def main():
logger.error(details)
if rc == 0:
- logger.error("HostedService associator should NOT return excepted result with a wrong key name and value of %s input" % k)
+ logger.error("HostedService associator should NOT return excepted result\
+ with a wrong key name and value of %s input" % k)
status = FAIL
return status
16 years
Xen on Pegasus Test Run Summary for Oct 06 2008
by Guo Lian Yun
=================================================
Xen on Pegasus Test Run Summary for Oct 06 2008
=================================================
Distro: Red Hat Enterprise Linux Server release 5.2 (Tikanga)
Kernel: 2.6.18-92.el5xen
libvirt: 0.3.3
Hypervisor: Xen 3.1.0
CIMOM: Pegasus 2.7.0
Libvirt-cim revision: 708+
Libvirt-cim changeset: 3ff9257bc87a+
=================================================
FAIL : 3
XFAIL : 0
SKIP : 3
PASS : 129
-----------------
Total : 135
=================================================
FAIL Test Summary:
HostSystem - 03_hs_to_settdefcap.py: FAIL
LogicalDisk - 03_ld_gi_errs.py: FAIL
SettingsDefineCapabilities - 01_forward.py: FAIL
=================================================
SKIP Test Summary:
ComputerSystem - 02_nosystems.py: SKIP
LogicalDisk - 02_nodevs.py: SKIP
NetworkPort - 03_user_netport.py: SKIP
=================================================
Full report:
--------------------------------------------------------------------
AllocationCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
AllocationCapabilities - 02_alloccap_gi_errs.py: PASS
--------------------------------------------------------------------
ComputerSystem - 01_enum.py: PASS
--------------------------------------------------------------------
ComputerSystem - 02_nosystems.py: SKIP
--------------------------------------------------------------------
ComputerSystem - 03_defineVS.py: PASS
--------------------------------------------------------------------
ComputerSystem - 04_defineStartVS.py: PASS
--------------------------------------------------------------------
ComputerSystem - 05_activate_defined_start.py: PASS
--------------------------------------------------------------------
ComputerSystem - 06_paused_active_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 22_define_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 23_suspend_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 27_define_suspend_errs.py: PASS
--------------------------------------------------------------------
ComputerSystem - 32_start_reboot.py: PASS
--------------------------------------------------------------------
ComputerSystem - 33_suspend_reboot.py: PASS
--------------------------------------------------------------------
ComputerSystem - 35_start_reset.py: PASS
--------------------------------------------------------------------
ComputerSystem - 40_RSC_start.py: PASS
--------------------------------------------------------------------
ComputerSystem - 41_cs_to_settingdefinestate.py: PASS
--------------------------------------------------------------------
ComputerSystem - 42_cs_gi_errs.py: PASS
--------------------------------------------------------------------
ComputerSystemIndication - 01_created_indication.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 01_forward.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 03_reverse_errs.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 04_forward_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 01_forward.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 03_forward_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 05_hostsystem_cap.py: PASS
--------------------------------------------------------------------
ElementConforms - 01_forward.py: PASS
--------------------------------------------------------------------
ElementConforms - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementConforms - 03_ectp_fwd_errs.py: PASS
--------------------------------------------------------------------
ElementConforms - 04_ectp_rev_errs.py: PASS
--------------------------------------------------------------------
ElementSettingData - 01_forward.py: PASS
--------------------------------------------------------------------
ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS
--------------------------------------------------------------------
EnabledLogicalElementCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS
--------------------------------------------------------------------
HostSystem - 01_enum.py: PASS
--------------------------------------------------------------------
HostSystem - 02_hostsystem_to_rasd.py: PASS
--------------------------------------------------------------------
HostSystem - 03_hs_to_settdefcap.py: FAIL
ERROR - DEBUG instanceref, is
Xen_HostSystem.CreationClassName="Xen_HostSystem",Name="elm3b217.beaverton.ibm.com"
ERROR - DEBUG instanceref, is
Xen_ProcessorPool.InstanceID="ProcessorPool/0"
ERROR - DEBUG instanceref, is
Xen_MemoryPool.InstanceID="MemoryPool/0"
ERROR - DEBUG instanceref, is
Xen_NetworkPool.InstanceID="NetworkPool/cimtest-networkpool"
ERROR - DEBUG instanceref, is
Xen_NetworkPool.InstanceID="NetworkPool/default"
ERROR - DEBUG instanceref, is
Xen_DiskPool.InstanceID="DiskPool/cimtest-diskpool"
ERROR - DEBUG instanceref, is
Xen_AllocationCapabilities.InstanceID="ProcessorPool/0"
ERROR - DEBUG instanceref, is
Xen_AllocationCapabilities.InstanceID="MemoryPool/0"
ERROR - DEBUG instanceref, is
Xen_AllocationCapabilities.InstanceID="NetworkPool/cimtest-networkpool"
ERROR - DEBUG instanceref, is
Xen_AllocationCapabilities.InstanceID="NetworkPool/default"
ERROR - DEBUG instanceref, is
Xen_AllocationCapabilities.InstanceID="DiskPool/cimtest-diskpool"
ERROR - SettingsDefineCapabilities returned 8 ResourcePool
objects instead of 4
CIM_ERR_INVALID_CLASS: Linux_ComputerSystem
--------------------------------------------------------------------
HostSystem - 04_hs_to_EAPF.py: PASS
--------------------------------------------------------------------
HostSystem - 05_hs_gi_errs.py: PASS
--------------------------------------------------------------------
HostSystem - 06_hs_to_vsms.py: PASS
--------------------------------------------------------------------
HostedDependency - 01_forward.py: PASS
--------------------------------------------------------------------
HostedDependency - 02_reverse.py: PASS
--------------------------------------------------------------------
HostedDependency - 03_enabledstate.py: PASS
--------------------------------------------------------------------
HostedDependency - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 01_forward.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 02_reverse.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 03_forward_errs.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
HostedService - 01_forward.py: PASS
--------------------------------------------------------------------
HostedService - 02_reverse.py: PASS
--------------------------------------------------------------------
HostedService - 03_forward_errs.py: PASS
--------------------------------------------------------------------
HostedService - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
LogicalDisk - 01_disk.py: PASS
--------------------------------------------------------------------
LogicalDisk - 02_nodevs.py: SKIP
ERROR - System has defined domains; unable to run
--------------------------------------------------------------------
LogicalDisk - 03_ld_gi_errs.py: FAIL
ERROR - Failed to get instance by the class of Xen_LogicalDisk
ERROR - Exception: (6, u'CIM_ERR_NOT_FOUND: No such instance
(no domain for hd_domain/xvda)')
--------------------------------------------------------------------
Memory - 01_memory.py: PASS
--------------------------------------------------------------------
Memory - 02_defgetmem.py: PASS
--------------------------------------------------------------------
Memory - 03_mem_gi_errs.py: PASS
--------------------------------------------------------------------
NetworkPort - 01_netport.py: PASS
--------------------------------------------------------------------
NetworkPort - 02_np_gi_errors.py: PASS
--------------------------------------------------------------------
NetworkPort - 03_user_netport.py: SKIP
--------------------------------------------------------------------
Processor - 01_processor.py: PASS
--------------------------------------------------------------------
Processor - 02_definesys_get_procs.py: PASS
--------------------------------------------------------------------
Processor - 03_proc_gi_errs.py: PASS
--------------------------------------------------------------------
Profile - 01_enum.py: PASS
--------------------------------------------------------------------
Profile - 02_profile_to_elec.py: PASS
--------------------------------------------------------------------
Profile - 03_rprofile_gi_errs.py: PASS
--------------------------------------------------------------------
RASD - 01_verify_rasd_fields.py: PASS
--------------------------------------------------------------------
RASD - 02_enum.py: PASS
--------------------------------------------------------------------
RASD - 03_rasd_errs.py: PASS
--------------------------------------------------------------------
RASD - 04_disk_rasd_size.py: PASS
--------------------------------------------------------------------
ReferencedProfile - 01_verify_refprof.py: PASS
--------------------------------------------------------------------
ReferencedProfile - 02_refprofile_errs.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 01_forward.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 02_reverse.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 03_forward_errs.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 05_RAPF_err.py: PASS
--------------------------------------------------------------------
ResourcePool - 01_enum.py: PASS
--------------------------------------------------------------------
ResourcePool - 02_rp_gi_errors.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 01_enum.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py:
PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS
--------------------------------------------------------------------
SettingsDefine - 01_forward.py: PASS
--------------------------------------------------------------------
SettingsDefine - 02_reverse.py: PASS
--------------------------------------------------------------------
SettingsDefine - 03_sds_fwd_errs.py: PASS
--------------------------------------------------------------------
SettingsDefine - 04_sds_rev_errs.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 01_forward.py: FAIL
ERROR - DEBUG instanceref, is
Xen_AllocationCapabilities.InstanceID="DiskPool/cimtest-diskpool"
ERROR - Xen_SettingsDefineCapabilities returned 8 ResourcePool
objectsinstead 4
--------------------------------------------------------------------
SettingsDefineCapabilities - 03_forward_errs.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS
--------------------------------------------------------------------
SystemDevice - 01_forward.py: PASS
--------------------------------------------------------------------
SystemDevice - 02_reverse.py: PASS
--------------------------------------------------------------------
SystemDevice - 03_fwderrs.py: PASS
--------------------------------------------------------------------
VSSD - 01_enum.py: PASS
--------------------------------------------------------------------
VSSD - 02_bootldr.py: PASS
--------------------------------------------------------------------
VSSD - 03_vssd_gi_errs.py: PASS
--------------------------------------------------------------------
VSSD - 04_vssd_to_rasd.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 01_definesystem_name.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 02_destroysystem.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 03_definesystem_ess.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 04_definesystem_ers.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 05_destroysystem_neg.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 06_addresource.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 07_addresource_neg.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 08_modifyresource.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 09_procrasd_persist.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 10_hv_version.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 11_define_memrasdunits.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 12_referenced_config.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 13_refconfig_additional_devs.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationService - 01_migratable_host.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationService - 02_host_migrate_type.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationService - 05_migratable_host_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationSettingData - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 01_forward.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 02_reverse.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotService - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py:
PASS
--------------------------------------------------------------------
16 years
Extra param in the provider query gives output.
by Deepti B Kalakeri
Hi,
I am able to get valid output when I query the providers with the fields
other than the key fields.
For ex:
wbemcli ai -ac Xen_SettingsDefineState
'http://root:P@localhost:5988/root/virt:Xen_Processor.CreationClassName="Xen_Processor",SystemName="Domain-0",DeviceID="Domain-0/0",SystemCreationClassName="Xen_ComputerSystem",*virtinvalid="Xen"*'
localhost:5988/root/virt:Xen_ProcResourceAllocationSettingData.InstanceID="Domain-0/proc"
-Caption
-Description
-InstanceID="Domain-0/proc"
-ElementName
-ConfigurationName
-ChangeableType
-ResourceType=3
-OtherResourceType
-ResourceSubType
-PoolID
-ConsumerVisibility
-HostResource
-AllocationUnits
-VirtualQuantity=16
-Reservation
-Limit=0
-Weight=0
-AutomaticAllocation
-AutomaticDeallocation
-Parent
-Connection
-Address
-MappingBehavior
In the above query I supplied invalid parameter *virtinvalid="Xen"
*which is not part of the key fields for querying the provider.
I think we should be checking our providers to take only the required
key fields.
Thanks and Regards,
Deepti.
16 years
[PATCH] (#2) Set additional properties of template RASDs
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1223059644 25200
# Node ID 860849c8b19a91e80b126e57fdc9ceddfa91566e
# Parent 7244474e5d2e118316e1636b06f99acb54062489
(#2) Set additional properties of template RASDs.
For Proc:
-Set Limit and Weight
For Mem:
-Set Limit - use same values set for VirtualQuantity
For Disk:
-Set VirtualDevice, Address, and Mountpoint properties
-For Xen, the default is xvda, which is accurate for paravirt, but not for full virt.
Updates:
-Don't expose a default MAC address - DefineSystem() will set one if its not supplied
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 7244474e5d2e -r 860849c8b19a src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Thu Oct 02 14:11:39 2008 -0700
+++ b/src/Virt_SettingsDefineCapabilities.c Fri Oct 03 11:47:24 2008 -0700
@@ -46,6 +46,7 @@
#include "Virt_RASD.h"
#include "Virt_VSMigrationCapabilities.h"
#include "Virt_VSMigrationSettingData.h"
+#include "Virt_VirtualSystemManagementService.h"
const static CMPIBroker *_BROKER;
@@ -249,12 +250,38 @@
return s;
}
+static CMPIInstance *sdc_rasd_inst(CMPIStatus *s,
+ const CMPIObjectPath *ref,
+ uint16_t resource_type)
+{
+ CMPIInstance *inst = NULL;
+ const char *base = NULL;
+
+ if (rasd_classname_from_type(resource_type, &base) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, s,
+ CMPI_RC_ERR_FAILED,
+ "Resource type not known");
+ goto out;
+ }
+
+ inst = get_typed_instance(_BROKER,
+ CLASSNAME(ref),
+ base,
+ NAMESPACE(ref));
+
+ CMSetProperty(inst, "ResourceType", &resource_type, CMPI_uint16);
+
+ out:
+ return inst;
+}
+
static CMPIStatus mem_template(const CMPIObjectPath *ref,
int template_type,
- CMPIInstance *inst)
+ struct inst_list *list)
{
uint64_t mem_size;
const char *id;
+ CMPIInstance *inst;
CMPIStatus s = {CMPI_RC_OK, NULL};
switch (template_type) {
@@ -281,11 +308,17 @@
goto out;
}
+ inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_MEM);
+
CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars);
CMSetProperty(inst, "AllocationUnits",
(CMPIValue *)"KiloBytes", CMPI_chars);
CMSetProperty(inst, "VirtualQuantity",
(CMPIValue *)&mem_size, CMPI_uint64);
+ CMSetProperty(inst, "Limit",
+ (CMPIValue *)&mem_size, CMPI_uint64);
+
+ inst_list_add(list, inst);
out:
return s;
@@ -316,30 +349,41 @@
static CMPIStatus proc_template(const CMPIObjectPath *ref,
int template_type,
- CMPIInstance *inst)
+ struct inst_list *list)
{
bool ret;
uint64_t num_procs;
+ uint64_t limit;
+ uint32_t weight;
const char *id;
+ CMPIInstance *inst;
CMPIStatus s = {CMPI_RC_OK, NULL};
switch (template_type) {
case SDC_RASD_MIN:
num_procs = 0;
+ limit = 1;
+ weight = MIN_XEN_WEIGHT;
id = "Minimum";
break;
case SDC_RASD_MAX:
ret = get_max_procs(ref, &num_procs, &s);
if (!ret)
goto out;
+ limit = 0;
+ weight = MAX_XEN_WEIGHT;
id = "Maximum";
break;
case SDC_RASD_INC:
num_procs = 1;
+ limit = 50;
+ weight = INC_XEN_WEIGHT;
id = "Increment";
break;
case SDC_RASD_DEF:
num_procs = 1;
+ limit = 0;
+ weight = DEFAULT_XEN_WEIGHT;
id = "Default";
break;
default:
@@ -349,11 +393,21 @@
goto out;
}
+ inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_PROC);
+
CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars);
CMSetProperty(inst, "AllocationUnits",
(CMPIValue *)"Processors", CMPI_chars);
CMSetProperty(inst, "VirtualQuantity",
(CMPIValue *)&num_procs, CMPI_uint64);
+
+ if (STARTS_WITH(CLASSNAME(ref), "Xen")) {
+ CMSetProperty(inst, "Limit", (CMPIValue *)&limit, CMPI_uint64);
+ CMSetProperty(inst, "Weight",
+ (CMPIValue *)&weight, CMPI_uint32);
+ }
+
+ inst_list_add(list, inst);
out:
return s;
@@ -438,11 +492,12 @@
static CMPIStatus net_template(const CMPIObjectPath *ref,
int template_type,
- CMPIInstance *inst)
+ struct inst_list *list)
{
bool ret;
uint64_t num_nics;
const char *id;
+ CMPIInstance *inst;
CMPIStatus s = {CMPI_RC_OK, NULL};
switch (template_type) {
@@ -471,9 +526,13 @@
goto out;
}
+ inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_NET);
+
CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars);
CMSetProperty(inst, "VirtualQuantity",
(CMPIValue *)&num_nics, CMPI_uint64);
+
+ inst_list_add(list, inst);
out:
return s;
@@ -525,13 +584,64 @@
return ret;
}
+static CMPIStatus set_disk_props(int type,
+ const CMPIObjectPath *ref,
+ const char *id,
+ uint64_t disk_size,
+ struct inst_list *list)
+{
+ const char *addr;
+ const char *dev;
+ CMPIInstance *inst;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ if (type == DOMAIN_LXC) {
+ addr = "/tmp";
+ dev = "/lxc_mnt/tmp";
+ }
+ else {
+ dev = "hda";
+ addr = "/dev/null";
+ }
+
+ inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_DISK);
+
+ CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars);
+ CMSetProperty(inst, "AllocationQuantity",
+ (CMPIValue *)"MegaBytes", CMPI_chars);
+ CMSetProperty(inst, "VirtualQuantity",
+ (CMPIValue *)&disk_size, CMPI_uint64);
+ CMSetProperty(inst, "Address", (CMPIValue *)addr, CMPI_chars);
+
+ if (type == DOMAIN_LXC)
+ CMSetProperty(inst, "MountPoint", (CMPIValue *)dev, CMPI_chars);
+ else {
+ if (type == DOMAIN_XENPV) {
+ dev = "xvda";
+ CMSetProperty(inst, "Caption",
+ (CMPIValue *)"PV disk", CMPI_chars);
+ } else if (type, DOMAIN_XENFV) {
+ CMSetProperty(inst, "Caption",
+ (CMPIValue *)"FV disk", CMPI_chars);
+ }
+
+ CMSetProperty(inst, "VirtualDevice",
+ (CMPIValue *)dev, CMPI_chars);
+ }
+
+ inst_list_add(list, inst);
+
+ return s;
+}
+
static CMPIStatus disk_template(const CMPIObjectPath *ref,
int template_type,
- CMPIInstance *inst)
+ struct inst_list *list)
{
bool ret;
+ char *pfx;
+ const char *id;
uint64_t disk_size;
- const char *id;
CMPIStatus s = {CMPI_RC_OK, NULL};
switch(template_type) {
@@ -560,57 +670,27 @@
goto out;
}
- CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars);
- CMSetProperty(inst, "AllocationQuantity",
- (CMPIValue *)"MegaBytes", CMPI_chars);
- CMSetProperty(inst, "VirtualQuantity",
- (CMPIValue *)&disk_size, CMPI_uint64);
+ pfx = class_prefix_name(CLASSNAME(ref));
+
+ if (STREQ(pfx, "Xen")) {
+ s = set_disk_props(DOMAIN_XENPV, ref, id, disk_size, list);
+
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ s = set_disk_props(DOMAIN_XENFV, ref, id, disk_size, list);
+ } else if (STREQ(pfx, "KVM")) {
+ s = set_disk_props(DOMAIN_KVM, ref, id, disk_size, list);
+ } else if (STREQ(pfx, "LXC")) {
+ s = set_disk_props(DOMAIN_LXC, ref, id, disk_size, list);
+ } else {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unsupported virtualization type");
+ }
out:
return s;
-}
-
-static CMPIInstance *sdc_rasd_inst(CMPIStatus *s,
- const CMPIObjectPath *ref,
- sdc_rasd_type type,
- uint16_t resource_type)
-{
- CMPIInstance *inst = NULL;
- const char *base = NULL;
-
- if (rasd_classname_from_type(resource_type, &base) != CMPI_RC_OK) {
- cu_statusf(_BROKER, s,
- CMPI_RC_ERR_FAILED,
- "Resource type not known");
- goto out;
- }
-
- inst = get_typed_instance(_BROKER,
- CLASSNAME(ref),
- base,
- NAMESPACE(ref));
-
- if (resource_type == CIM_RES_TYPE_MEM)
- *s = mem_template(ref, type, inst);
- else if (resource_type == CIM_RES_TYPE_PROC)
- *s = proc_template(ref, type, inst);
- else if (resource_type == CIM_RES_TYPE_NET)
- *s = net_template(ref, type, inst);
- else if (resource_type == CIM_RES_TYPE_DISK)
- *s = disk_template(ref, type, inst);
- else {
- cu_statusf(_BROKER, s,
- CMPI_RC_ERR_FAILED,
- "Unsupported resource type");
- }
-
- if (s->rc != CMPI_RC_OK)
- goto out;
-
- CMSetProperty(inst, "ResourceType", &resource_type, CMPI_uint16);
-
- out:
- return inst;
}
static CMPIStatus sdc_rasds_for_type(const CMPIObjectPath *ref,
@@ -618,21 +698,26 @@
uint16_t type)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
- CMPIInstance *inst;
int i;
for (i = SDC_RASD_MIN; i <= SDC_RASD_INC; i++) {
- inst = sdc_rasd_inst(&s, ref, i, type);
+ if (type == CIM_RES_TYPE_MEM)
+ s = mem_template(ref, i, list);
+ else if (type == CIM_RES_TYPE_PROC)
+ s = proc_template(ref, i, list);
+ else if (type == CIM_RES_TYPE_NET)
+ s = net_template(ref, i, list);
+ else if (type == CIM_RES_TYPE_DISK)
+ s = disk_template(ref, i, list);
+ else {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unsupported resource type");
+ }
+
if (s.rc != CMPI_RC_OK) {
- CU_DEBUG("Problem getting inst");
+ CU_DEBUG("Problem getting inst list");
goto out;
- }
- CU_DEBUG("Got inst");
- if ((s.rc == CMPI_RC_OK) && (inst != NULL)) {
- inst_list_add(list, inst);
- CU_DEBUG("Added inst");
- } else {
- CU_DEBUG("Inst is null, not added");
}
}
diff -r 7244474e5d2e -r 860849c8b19a src/Virt_VirtualSystemManagementService.h
--- a/src/Virt_VirtualSystemManagementService.h Thu Oct 02 14:11:39 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.h Fri Oct 03 11:47:24 2008 -0700
@@ -19,6 +19,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#define MIN_XEN_WEIGHT 1
+#define MAX_XEN_WEIGHT 65535
+#define INC_XEN_WEIGHT MAX_XEN_WEIGHT / 2
+#define DEFAULT_XEN_WEIGHT 1024
+
CMPIStatus get_vsms(const CMPIObjectPath *reference,
CMPIInstance **_inst,
const CMPIBroker *broker,
16 years
[PATCH] Set additional properties of template RASDs
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1223052389 25200
# Node ID 2952b0fb0fef8e77b34c04a779ac44b1d092876f
# Parent 7244474e5d2e118316e1636b06f99acb54062489
Set additional properties of template RASDs.
For Proc:
-Set Limit and Weight
For Mem:
-Set Limit - use same values set for VirtualQuantity
For Net:
-Set address - get a default mac address
For Disk:
-Set VirtualDevice, Address, and Mountpoint properties
-For Xen, the default is xvda, which is accurate for paravirt, but not for full virt.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 7244474e5d2e -r 2952b0fb0fef src/Makefile.am
--- a/src/Makefile.am Thu Oct 02 14:11:39 2008 -0700
+++ b/src/Makefile.am Fri Oct 03 09:46:29 2008 -0700
@@ -131,12 +131,13 @@
-lVirt_VSMigrationService \
-lVirt_DevicePool
-libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_VSMigrationCapabilities.la libVirt_VSMigrationSettingData.la
+libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_VSMigrationCapabilities.la libVirt_VSMigrationSettingData.la libVirt_VirtualSystemManagementService.la
libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c
libVirt_SettingsDefineCapabilities_la_LIBADD = -lVirt_RASD \
-lVirt_DevicePool \
-lVirt_VSMigrationCapabilities \
- -lVirt_VSMigrationSettingData
+ -lVirt_VSMigrationSettingData \
+ -lVirt_VirtualSystemManagementService
libVirt_RegisteredProfile_la_SOURCES = Virt_RegisteredProfile.c
diff -r 7244474e5d2e -r 2952b0fb0fef src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Thu Oct 02 14:11:39 2008 -0700
+++ b/src/Virt_SettingsDefineCapabilities.c Fri Oct 03 09:46:29 2008 -0700
@@ -46,6 +46,7 @@
#include "Virt_RASD.h"
#include "Virt_VSMigrationCapabilities.h"
#include "Virt_VSMigrationSettingData.h"
+#include "Virt_VirtualSystemManagementService.h"
const static CMPIBroker *_BROKER;
@@ -249,12 +250,38 @@
return s;
}
+static CMPIInstance *sdc_rasd_inst(CMPIStatus *s,
+ const CMPIObjectPath *ref,
+ uint16_t resource_type)
+{
+ CMPIInstance *inst = NULL;
+ const char *base = NULL;
+
+ if (rasd_classname_from_type(resource_type, &base) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, s,
+ CMPI_RC_ERR_FAILED,
+ "Resource type not known");
+ goto out;
+ }
+
+ inst = get_typed_instance(_BROKER,
+ CLASSNAME(ref),
+ base,
+ NAMESPACE(ref));
+
+ CMSetProperty(inst, "ResourceType", &resource_type, CMPI_uint16);
+
+ out:
+ return inst;
+}
+
static CMPIStatus mem_template(const CMPIObjectPath *ref,
int template_type,
- CMPIInstance *inst)
+ struct inst_list *list)
{
uint64_t mem_size;
const char *id;
+ CMPIInstance *inst;
CMPIStatus s = {CMPI_RC_OK, NULL};
switch (template_type) {
@@ -281,11 +308,17 @@
goto out;
}
+ inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_MEM);
+
CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars);
CMSetProperty(inst, "AllocationUnits",
(CMPIValue *)"KiloBytes", CMPI_chars);
CMSetProperty(inst, "VirtualQuantity",
(CMPIValue *)&mem_size, CMPI_uint64);
+ CMSetProperty(inst, "Limit",
+ (CMPIValue *)&mem_size, CMPI_uint64);
+
+ inst_list_add(list, inst);
out:
return s;
@@ -316,30 +349,41 @@
static CMPIStatus proc_template(const CMPIObjectPath *ref,
int template_type,
- CMPIInstance *inst)
+ struct inst_list *list)
{
bool ret;
uint64_t num_procs;
+ uint64_t limit;
+ uint32_t weight;
const char *id;
+ CMPIInstance *inst;
CMPIStatus s = {CMPI_RC_OK, NULL};
switch (template_type) {
case SDC_RASD_MIN:
num_procs = 0;
+ limit = 1;
+ weight = MIN_XEN_WEIGHT;
id = "Minimum";
break;
case SDC_RASD_MAX:
ret = get_max_procs(ref, &num_procs, &s);
if (!ret)
goto out;
+ limit = 0;
+ weight = MAX_XEN_WEIGHT;
id = "Maximum";
break;
case SDC_RASD_INC:
num_procs = 1;
+ limit = 50;
+ weight = INC_XEN_WEIGHT;
id = "Increment";
break;
case SDC_RASD_DEF:
num_procs = 1;
+ limit = 0;
+ weight = DEFAULT_XEN_WEIGHT;
id = "Default";
break;
default:
@@ -349,11 +393,21 @@
goto out;
}
+ inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_PROC);
+
CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars);
CMSetProperty(inst, "AllocationUnits",
(CMPIValue *)"Processors", CMPI_chars);
CMSetProperty(inst, "VirtualQuantity",
(CMPIValue *)&num_procs, CMPI_uint64);
+
+ if (STARTS_WITH(CLASSNAME(ref), "Xen")) {
+ CMSetProperty(inst, "Limit", (CMPIValue *)&limit, CMPI_uint64);
+ CMSetProperty(inst, "Weight",
+ (CMPIValue *)&weight, CMPI_uint32);
+ }
+
+ inst_list_add(list, inst);
out:
return s;
@@ -438,11 +492,13 @@
static CMPIStatus net_template(const CMPIObjectPath *ref,
int template_type,
- CMPIInstance *inst)
+ struct inst_list *list)
{
bool ret;
uint64_t num_nics;
const char *id;
+ const char *mac;
+ CMPIInstance *inst;
CMPIStatus s = {CMPI_RC_OK, NULL};
switch (template_type) {
@@ -471,9 +527,22 @@
goto out;
}
+ mac = _net_rand_mac(_BROKER);
+ if (mac == NULL) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to generate a MAC address");
+ goto out;
+ }
+
+ inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_NET);
+
CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars);
CMSetProperty(inst, "VirtualQuantity",
(CMPIValue *)&num_nics, CMPI_uint64);
+ CMSetProperty(inst, "Address", (CMPIValue *)mac, CMPI_chars);
+
+ inst_list_add(list, inst);
out:
return s;
@@ -525,13 +594,64 @@
return ret;
}
+static CMPIStatus set_disk_props(int type,
+ const CMPIObjectPath *ref,
+ const char *id,
+ uint64_t disk_size,
+ struct inst_list *list)
+{
+ const char *addr;
+ const char *dev;
+ CMPIInstance *inst;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ if (type == DOMAIN_LXC) {
+ addr = "/tmp";
+ dev = "/lxc_mnt/tmp";
+ }
+ else {
+ dev = "hda";
+ addr = "/dev/null";
+ }
+
+ inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_DISK);
+
+ CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars);
+ CMSetProperty(inst, "AllocationQuantity",
+ (CMPIValue *)"MegaBytes", CMPI_chars);
+ CMSetProperty(inst, "VirtualQuantity",
+ (CMPIValue *)&disk_size, CMPI_uint64);
+ CMSetProperty(inst, "Address", (CMPIValue *)addr, CMPI_chars);
+
+ if (type == DOMAIN_LXC)
+ CMSetProperty(inst, "MountPoint", (CMPIValue *)dev, CMPI_chars);
+ else {
+ if (type == DOMAIN_XENPV) {
+ dev = "xvda";
+ CMSetProperty(inst, "Caption",
+ (CMPIValue *)"PV disk", CMPI_chars);
+ } else if (type, DOMAIN_XENFV) {
+ CMSetProperty(inst, "Caption",
+ (CMPIValue *)"FV disk", CMPI_chars);
+ }
+
+ CMSetProperty(inst, "VirtualDevice",
+ (CMPIValue *)dev, CMPI_chars);
+ }
+
+ inst_list_add(list, inst);
+
+ return s;
+}
+
static CMPIStatus disk_template(const CMPIObjectPath *ref,
int template_type,
- CMPIInstance *inst)
+ struct inst_list *list)
{
bool ret;
+ char *pfx;
+ const char *id;
uint64_t disk_size;
- const char *id;
CMPIStatus s = {CMPI_RC_OK, NULL};
switch(template_type) {
@@ -560,57 +680,27 @@
goto out;
}
- CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars);
- CMSetProperty(inst, "AllocationQuantity",
- (CMPIValue *)"MegaBytes", CMPI_chars);
- CMSetProperty(inst, "VirtualQuantity",
- (CMPIValue *)&disk_size, CMPI_uint64);
+ pfx = class_prefix_name(CLASSNAME(ref));
+
+ if (STREQ(pfx, "Xen")) {
+ s = set_disk_props(DOMAIN_XENPV, ref, id, disk_size, list);
+
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ s = set_disk_props(DOMAIN_XENFV, ref, id, disk_size, list);
+ } else if (STREQ(pfx, "KVM")) {
+ s = set_disk_props(DOMAIN_KVM, ref, id, disk_size, list);
+ } else if (STREQ(pfx, "LXC")) {
+ s = set_disk_props(DOMAIN_LXC, ref, id, disk_size, list);
+ } else {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unsupported virtualization type");
+ }
out:
return s;
-}
-
-static CMPIInstance *sdc_rasd_inst(CMPIStatus *s,
- const CMPIObjectPath *ref,
- sdc_rasd_type type,
- uint16_t resource_type)
-{
- CMPIInstance *inst = NULL;
- const char *base = NULL;
-
- if (rasd_classname_from_type(resource_type, &base) != CMPI_RC_OK) {
- cu_statusf(_BROKER, s,
- CMPI_RC_ERR_FAILED,
- "Resource type not known");
- goto out;
- }
-
- inst = get_typed_instance(_BROKER,
- CLASSNAME(ref),
- base,
- NAMESPACE(ref));
-
- if (resource_type == CIM_RES_TYPE_MEM)
- *s = mem_template(ref, type, inst);
- else if (resource_type == CIM_RES_TYPE_PROC)
- *s = proc_template(ref, type, inst);
- else if (resource_type == CIM_RES_TYPE_NET)
- *s = net_template(ref, type, inst);
- else if (resource_type == CIM_RES_TYPE_DISK)
- *s = disk_template(ref, type, inst);
- else {
- cu_statusf(_BROKER, s,
- CMPI_RC_ERR_FAILED,
- "Unsupported resource type");
- }
-
- if (s->rc != CMPI_RC_OK)
- goto out;
-
- CMSetProperty(inst, "ResourceType", &resource_type, CMPI_uint16);
-
- out:
- return inst;
}
static CMPIStatus sdc_rasds_for_type(const CMPIObjectPath *ref,
@@ -618,21 +708,26 @@
uint16_t type)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
- CMPIInstance *inst;
int i;
for (i = SDC_RASD_MIN; i <= SDC_RASD_INC; i++) {
- inst = sdc_rasd_inst(&s, ref, i, type);
+ if (type == CIM_RES_TYPE_MEM)
+ s = mem_template(ref, i, list);
+ else if (type == CIM_RES_TYPE_PROC)
+ s = proc_template(ref, i, list);
+ else if (type == CIM_RES_TYPE_NET)
+ s = net_template(ref, i, list);
+ else if (type == CIM_RES_TYPE_DISK)
+ s = disk_template(ref, i, list);
+ else {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unsupported resource type");
+ }
+
if (s.rc != CMPI_RC_OK) {
- CU_DEBUG("Problem getting inst");
+ CU_DEBUG("Problem getting inst list");
goto out;
- }
- CU_DEBUG("Got inst");
- if ((s.rc == CMPI_RC_OK) && (inst != NULL)) {
- inst_list_add(list, inst);
- CU_DEBUG("Added inst");
- } else {
- CU_DEBUG("Inst is null, not added");
}
}
diff -r 7244474e5d2e -r 2952b0fb0fef src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Thu Oct 02 14:11:39 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Fri Oct 03 09:46:29 2008 -0700
@@ -321,7 +321,7 @@
return poolid;
}
-static const char *_net_rand_mac(void)
+const char *_net_rand_mac(const CMPIBroker *broker)
{
int r;
int ret;
@@ -344,7 +344,7 @@
if (ret == -1)
goto out;
- str = CMNewString(_BROKER, mac, &status);
+ str = CMNewString(broker, mac, &status);
if ((str == NULL) || (status.rc != CMPI_RC_OK)) {
str = NULL;
CU_DEBUG("Failed to create string");
@@ -369,7 +369,7 @@
const char *msg = NULL;
if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) {
- val = _net_rand_mac();
+ val = _net_rand_mac(_BROKER);
if (val == NULL) {
msg = "Unable to generate a MAC address";
goto out;
diff -r 7244474e5d2e -r 2952b0fb0fef src/Virt_VirtualSystemManagementService.h
--- a/src/Virt_VirtualSystemManagementService.h Thu Oct 02 14:11:39 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.h Fri Oct 03 09:46:29 2008 -0700
@@ -19,8 +19,15 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#define MIN_XEN_WEIGHT 1
+#define MAX_XEN_WEIGHT 65535
+#define INC_XEN_WEIGHT MAX_XEN_WEIGHT / 2
+#define DEFAULT_XEN_WEIGHT 1024
+
CMPIStatus get_vsms(const CMPIObjectPath *reference,
CMPIInstance **_inst,
const CMPIBroker *broker,
const CMPIContext *context,
bool is_get_inst);
+
+const char *_net_rand_mac(const CMPIBroker *broker);
16 years