[PATCH] [TEST] Add CodyingSystem and SubmittingPatches files
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1232145843 28800
# Node ID d94576542b4d6479ad04da466406c0cdb391f6e8
# Parent 684561f21975c7420cb7e15affc1eec4a8ed35ae
[TEST] Add CodyingSystem and SubmittingPatches files
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 684561f21975 -r d94576542b4d doc/CodingStyle
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/CodingStyle Fri Jan 16 14:44:03 2009 -0800
@@ -0,0 +1,41 @@
+
+The CodingStyle for cimtest (and libcmpiutil) mostly mirrors that of
+libvirt-cim but with the following "clarifications":
+
+- Four-space indents
+
+- 80-char width limit. Break long function calls by:
+ a) putting *every* parameter of the call on its own line
+ -or-
+ b) putting as many params in a line as will fit in the 80-char limit;
+ overflow params are placed on the subsequent line
+
+- Split lines should aligned like the following:
+
+ VirtCIM.__init__(self, 'Xen', test_dom, disk, disk_file_path,
+ ntype, net_name, mac, vcpus, mem, mem_allocunits,
+ emu_type)
+
+- Identifiers should be named with underbars_and_lowercase.
+
+- When passing parameters to logger.error() and logger.info(), use
+ commas:
+
+ logger.error("%s is not a valid network type", net_type)
+
+ Not percent signs:
+
+ logger.error('Got CIM error %s with return code %s' % (desc, rc))
+
+- When passing parameters to Exception(), use percents:
+
+ raise Exception("Unable to define %s" % test_dom)
+
+ Not commas:
+
+ raise Exception("Unable to define %s", test_dom)
+
+- Except for special cases, import the needed functions from a module. Do not
+ import the entire module:
+
+ from XenKvmLib.classes import virt_types
diff -r 684561f21975 -r d94576542b4d doc/SubmittingPatches
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/SubmittingPatches Fri Jan 16 14:44:03 2009 -0800
@@ -0,0 +1,117 @@
+To submit patches to libvirt-cim, you must follow the DCO process, outlined
+below.
+
+Developer's Certificate of Origin 1.1
+ By making a contribution to this project, I certify that:
+
+ (a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+ (b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+ (c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+ (d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
+
+then you just add a line saying
+
+ Signed-off-by: Random J Developer <random(a)developer.example.org>
+
+using your real name (sorry, no pseudonyms or anonymous contributions.)
+
+
+
+Guidelines for Submitting Patches.
+
+ Patches should be submitted using Mercurial's patchbomb extension,
+ and we recommend using the queues extension as well. On top of that,
+ we have some guidelines you should follow when submitting patches.
+ This makes reviewing patches easier, which in turns improves the
+ chances of your patch being accepted in a timely fashion.
+
+Single Patches:
+
+ (a) When you add a patch to the queue you have an idea of where you're
+ going with it, and the commit message should reflect that. Be
+ specific. Avoid just saying something like, "Various fixes to
+ AllocationCapabilities." Add a list of what was actually fixed,
+ like, "Add EnumInstanceNames support," and, "Eliminate duplicate
+ instances."
+
+ (b) The first line of your commit message will be the subject of the
+ patch email when you send it out, so write it like a subject. Keep
+ it short and to the point, then start a new line and feel free to be
+ as verbose as you need to be. The entire commit message will be
+ included in the patch.
+
+ (c) Stay on task with a patch. If you notice other problems while you
+ are working on patch, and they are not most definitely specific to
+ your patch, they should be another patch. The same goes for
+ nitpicking. While it might be only a line or two here and there
+ that is off track, this is actually one of the easiest ways to make
+ a patch difficult to review. All the trivial changes hide what is
+ really going on. Make the unrelated changes a new patch or don't
+ make them at all.
+
+ (d) Before you email, export. If you have a patch called "alloc_fixes",
+ which would be emailed with "hg email alloc_fixes", you should first
+ run "hg export alloc_fixes". This lets you review your patch. Does
+ it have any typos in the comments? Did you accidentally include an
+ irrelevant change? Is your commit message still accurate and useful?
+ This is the single biggest step in ensuring you have a good patch.
+
+ (e) If your patch needs to be reworked and resent, prepend a "version
+ number" to the first line of the commit message. For example, "Add
+ EnumInstance to RASD," becomes "(#2) Add EnumInstance to RASD."
+ This helps mail readers thread discussions correctly and helps
+ maintainers know they are applying the right version of your patch.
+ At the end of the commit message, explain what is different from one
+ version to the next. Nobody likes having to diff a diff.
+
+ (f) If your patch depends on a patch that exists on the mailing list but
+ not in the tree, it is okay to send your patch to the list as long
+ as your commit message mentions the dependency. It is also a good
+ idea to import the patch into your tree before you make your patch.
+ For example, a new patch called "cu_statusf API change" is on the
+ list, and your patch needs the new API. Save the email (no need to
+ trim headers) as api_change.eml, then do "hg qimport api_change.eml"
+ and "hg qpush" so that the patch is applied to your tree. Now write
+ your patch on top of it. You should still indicate the dependency
+ in your commit message.
+
+
+Patchsets:
+
+ (a) When you send a group of patches, Mercurial's email extension will
+ create a "header" email. Make the subject and body of that email
+ meaningful, so we know how the patches relate. It's easy to say,
+ "Each patch has a commit message, it's obvious how they work
+ together," but the rest of the list usually won't agree with that.
+ If the commit messages for each patch are good, you shouldn't need
+ more than a sentence or two to tie them all together, but you do
+ need it.
+
+ (b) If any of your patches are rejected and you rework them, resend the
+ entire set. This prevents things like, "So use patch 1 of 4 from
+ the set I sent yesterday, 2 and 3 of 4 from the patch I sent an hour
+ later, and patch 4 of 4 from today."
+
+ (c) If you resend a patchset, apply part (e) of the Single Patches
+ guidelines to your "Patch [0 of 3]" header email, for all the same
+ reasons.
+
+Questions/Comments on the Guidelines should be directed to:
+ Kaitlin Rupert<kaitlin(a)linux.vnet.ibm.com>
15 years, 10 months
Test Run Summary (Jan 19 2009): KVM on Fedora release 9.90.1 (Rawhide) with sfcb
by Guo Lian Yun
=================================================
Test Run Summary (Jan 19 2009): KVM on Fedora release 9.90.1 (Rawhide)
with sfcb
=================================================
Distro: Fedora release 9.90.1 (Rawhide)
Kernel: 2.6.27-0.323.rc6.fc10.x86_64
libvirt: 0.4.5
Hypervisor: QEMU 0.9.1
CIMOM: sfcb sfcbd 1.3.3preview
Libvirt-cim revision: 800
Libvirt-cim changeset: 611757263edd
Cimtest revision: 598
Cimtest changeset: 32645e444b32
=================================================
FAIL : 1
XFAIL : 2
SKIP : 4
PASS : 134
-----------------
Total : 141
=================================================
FAIL Test Summary:
ElementConforms - 01_forward.py: FAIL
=================================================
XFAIL Test Summary:
ComputerSystem - 32_start_reboot.py: XFAIL
ComputerSystem - 33_suspend_reboot.py: XFAIL
=================================================
SKIP Test Summary:
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: PASS
--------------------------------------------------------------------
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_pause_pause.py: PASS
--------------------------------------------------------------------
ComputerSystem - 27_define_pause_errs.py: PASS
--------------------------------------------------------------------
ComputerSystem - 32_start_reboot.py: XFAIL
ERROR - In fn cim_state_change()
ERROR - Failed to change state of the domain 'cs_test_domain'
ERROR - Exception: (1, u'Unable to reboot domain: this function
is not supported by the hypervisor: virDomainReboot')
ERROR - Exception: Unable reboot dom 'cs_test_domain'
InvokeMethod(RequestStateChange): Unable to reboot domain: this function
is not supported by the hypervisor: virDomainReboot
Bug:<00005>
--------------------------------------------------------------------
ComputerSystem - 33_suspend_reboot.py: XFAIL
ERROR - In fn cim_state_change()
ERROR - Failed to change state of the domain 'test_domain'
ERROR - Exception: (7, u'State not supported')
ERROR - Exception: Unable Suspend dom 'test_domain'
InvokeMethod(RequestStateChange): State not supported
Bug:<00012>
--------------------------------------------------------------------
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: FAIL
ERROR - verify_fields() exception:
u'KVM_AllocationCapabilities'
ERROR - Exception: Failed to verify instance
Class not found
--------------------------------------------------------------------
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: PASS
--------------------------------------------------------------------
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
--------------------------------------------------------------------
RASD - 05_disk_rasd_emu_type.py: PASS
--------------------------------------------------------------------
RedirectionService - 01_enum_crs.py: PASS
--------------------------------------------------------------------
RedirectionService - 02_enum_crscap.py: PASS
--------------------------------------------------------------------
RedirectionService - 03_RedirectionSAP_errs.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
--------------------------------------------------------------------
VirtualSystemManagementService - 14_define_sys_disk.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 15_mod_system_settings.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
--------------------------------------------------------------------
15 years, 10 months
[PATCH] Add a migration_tester.py tool
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1232519221 28800
# Node ID 6fa1f52dc8298b4d643fc94bb3f91715cc40dd58
# Parent e4f4e7c64325395494355516d4c111977f5b451a
Add a migration_tester.py tool.
This can be used to drive migration between two different hosts.
How to call the tester:
python tools/migrate_tester.py -u user -p pass -s fqdn:port -t fqdn guest_name
Ex:
python tools/migrate_tester.py -u root -p mypass -s my_host.my_domain.com:5988 -t my_target.my_domain.com my_guest
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r e4f4e7c64325 -r 6fa1f52dc829 tools/migration_tester.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/migration_tester.py Tue Jan 20 22:27:01 2009 -0800
@@ -0,0 +1,301 @@
+#!/usr/bin/python
+#
+# Copyright IBM Corp. 2009
+#
+# Authors:
+# Kaitlin Rupert <karupert(a)us.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser 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
+#
+
+import sys
+import time
+from optparse import OptionParser
+from pywbem import WBEMConnection, CIMInstanceName, CIMInstance, CIMError
+
+CIM_MIGRATE_OTHER=1
+CIM_MIGRATE_LIVE=2
+CIM_MIGRATE_RESUME=3
+CIM_MIGRATE_RESTART=4
+
+CIM_MIGRATE_URI_OTHER=1
+CIM_MIGRATE_URI_SSH=2
+CIM_MIGRATE_URI_TLS=3
+CIM_MIGRATE_URI_TLS_STRICT=4
+CIM_MIGRATE_URI_TCP=5
+CIM_MIGRATE_URI_UNIX=6
+
+CIM_JOBSTATE_COMPLETE=7
+
+class CIMClassMOF:
+
+ __supported_types = [int, str, bool]
+
+ def __init__(self, attrs = None):
+ """attrs should be dict
+ """
+
+ if attrs != None:
+ self.__dict__.update(attrs)
+
+ def mof(self):
+ """mof()
+
+ Return value is a string, containing the mof representation of the
+ object.
+
+ Attribute types supported are : int, str, bool.
+
+ Attributes with unsupported types will be silently ignored when
+ converting to mof representation.
+ """
+
+ mof_str = "instance of " + self.__class__.__name__ + " {\n"
+ for key, value in self.__dict__.items():
+ value_type = type(value)
+ if value_type not in self.__supported_types:
+ continue
+
+ mof_str += "%s = " % key
+ if value_type == int:
+ mof_str += "%d" % value
+ elif value_type == bool:
+ mof_str += str(value).lower()
+ else:
+ mof_str += '"%s"' % value
+ mof_str += ";\n"
+
+ mof_str += "};"
+ return mof_str
+
+ def __str__(self):
+ return self.mof()
+
+class CIM_VirtualSystemMigrationSettingData(CIMClassMOF):
+ def __init__(self, type, priority):
+ self.InstanceID = 'MigrationSettingData'
+ self.CreationClassName = self.__class__.__name__
+ self.MigrationType = type
+ self.Priority = priority
+
+class Xen_VirtualSystemMigrationSettingData(CIM_VirtualSystemMigrationSettingData):
+ def __init__(self, type, priority):
+ CIM_VirtualSystemMigrationSettingData.__init__(self, type, priority)
+
+class KVM_VirtualSystemMigrationSettingData(CIM_VirtualSystemMigrationSettingData):
+ def __init__(self, type, priority):
+ CIM_VirtualSystemMigrationSettingData.__init__(self, type, priority)
+
+def get_guest_ref(guest, virt):
+ guest_cn = "%s_ComputerSystem" % virt
+
+ keys = { 'Name' : guest,
+ 'CreationClassName' : guest_cn
+ }
+
+ try:
+ cs_ref = CIMInstanceName(guest_cn, keybindings=keys)
+
+ except CIMError, (err_no, desc):
+ print err_no, desc
+ return None
+
+ return cs_ref
+
+def get_msd(mtype, virt):
+ if mtype == "live":
+ mtype = CIM_MIGRATE_LIVE
+ elif mtype == "resume":
+ mtype = CIM_MIGRATE_RESUME
+ elif mtype == "restart":
+ mtype = CIM_MIGRATE_RESTART
+ else:
+ mtype = CIM_MIGRATE_OTHER
+
+ try:
+ vsmsd_cn_base = "_VirtualSystemMigrationSettingData"
+ msd = eval(virt + vsmsd_cn_base)(type=mtype, priority=0)
+
+ except CIMError, (err_no, desc):
+ print err_no, desc
+ return None
+
+ return msd.mof()
+
+def check_migrate(s_conn, cs_ref, ip, msd, virt):
+ vsms_cn = "%s_VirtualSystemMigrationService" % virt
+ try:
+ if msd == None:
+ res = s_conn.InvokeMethod("CheckVirtualSystemIsMigratableToHost",
+ vsms_cn,
+ ComputerSystem=cs_ref,
+ DestinationHost=ip)
+ else:
+ res = s_conn.InvokeMethod("CheckVirtualSystemIsMigratableToHost",
+ vsms_cn,
+ ComputerSystem=cs_ref,
+ DestinationHost=ip,
+ MigrationSettingData=msd)
+
+ if res == None or res[1]['IsMigratable'] != True:
+ print "Migration check failed."
+ return 1
+
+ except CIMError, (err_no, desc):
+ print err_no, desc
+ return 1
+
+ return 0
+
+def get_job_inst(s_conn, job_ref):
+ try:
+ inst = s_conn.GetInstance(job_ref)
+
+ except CIMError, (err_no, desc):
+ print err_no, desc
+ return None
+
+ return inst
+
+def poll_for_job_status(s_conn, job_ref):
+
+ job_inst = get_job_inst(s_conn, job_ref)
+ if not job_inst:
+ print "Unable to get job instance"
+ return 1
+
+ try:
+ while job_inst['JobState'] != CIM_JOBSTATE_COMPLETE:
+ time.sleep(3)
+ job_inst = get_job_inst(s_conn, job_ref)
+ if not job_inst:
+ print "Unable to get job instance"
+ return 1
+
+ if job_inst['Status'] != "Completed":
+ print "Migrate job failed: %s" % job_inst['Status']
+ return 1
+ except KeyboardInterrupt:
+ print "Migrate job took too long"
+ return 1
+
+ print "Migrate job succeeded: %s" % job_inst['Status']
+ return 0
+
+def migrate_host(s_conn, cs_ref, dest, msd, virt):
+ vsms_cn = "%s_VirtualSystemMigrationService" % virt
+
+ try:
+ if msd == None:
+ job = s_conn.InvokeMethod("MigrateVirtualSystemToHost",
+ vsms_cn,
+ ComputerSystem=cs_ref,
+ DestinationHost=dest)
+ else:
+ job = s_conn.InvokeMethod("MigrateVirtualSystemToHost",
+ vsms_cn,
+ ComputerSystem=cs_ref,
+ DestinationHost=dest,
+ MigrationSettingData=msd)
+
+ if len(job) < 1:
+ print "No job returned from migrate call"
+ return 1
+
+ status = poll_for_job_status(s_conn, job[1]['Job'])
+
+ except CIMError, (err_no, desc):
+ print err_no, desc
+ return 1
+
+ return 0
+
+def main():
+ usage = "usage: %prog [options] <target system>\nex: %prog my.target.com"
+ parser = OptionParser(usage)
+
+ parser.add_option("-s", "--src-url", dest="s_url", default="localhost:5988",
+ help="URL of CIMOM to connect to (host:port)")
+ parser.add_option("-t", "--target-url", dest="t_url",
+ default="localhost:5988",
+ help="URL of CIMOM to connect to (host:port)")
+ parser.add_option("-N", "--ns", dest="ns", default="root/virt",
+ help="Namespace (default is root/virt)")
+ parser.add_option("-u", "--user", dest="username", default=None,
+ help="HTTP Auth username")
+ parser.add_option("-p", "--pass", dest="password", default=None,
+ help="HTTP Auth password")
+ parser.add_option("-v", "--virt-type", dest="virt", default=None,
+ help="Virtualization type [ Xen | KVM ]")
+ parser.add_option("--migration-type", dest="type", default=None,
+ help="Migration type: [ live | resume | restart ]")
+ parser.add_option("--disable-check", dest="disable_ck", action="store_true",
+ help="Disable migration pre-check")
+
+ (options, args) = parser.parse_args()
+
+ if len(args) == 0:
+ print "Fatal: no guest specified."
+ sys.exit(1)
+
+ guest_name = args[0]
+
+ if ":" in options.s_url:
+ (sysname, port) = options.s_url.split(":")
+ else:
+ sysname = options.s_url
+
+ if ":" in options.t_url:
+ (t_sysname, port) = options.t_url.split(":")
+ else:
+ t_sysname = options.t_url
+
+ src_conn = WBEMConnection('http://%s' % sysname,
+ (options.username, options.password), options.ns)
+
+ guest_ref = get_guest_ref(guest_name, options.virt)
+ if guest_ref == None:
+ return 1
+
+ if options.virt == None:
+ print "Must specify virtualization type"
+ return 1
+
+ if options.virt != "Xen":
+ print "Only Xen migration is currently supported"
+ return 1
+
+ if options.type != None:
+ msd = get_msd(options.type, options.virt)
+ if msd == None:
+ return 1
+ else:
+ print "Using default MigrationSettingData"
+ msd = None
+
+ if not options.disable_ck:
+ status = check_migrate(src_conn, guest_ref, t_sysname, msd,
+ options.virt)
+ if status == 1:
+ return 1
+
+ print "Migrating %s.. this will take some time." % guest_name
+ status = migrate_host(src_conn, guest_ref, t_sysname, msd, options.virt)
+ return status
+
+if __name__=="__main__":
+ sys.exit(main())
+
+
15 years, 10 months
[PATCH] [TEST] #2 Update VSMS 11_define_memrasdunits.py to use cim_define()
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1233350611 28800
# Node ID d1443d4847e3f9711b2db016d20676ca35f57243
# Parent fd464f0d24d0f4173cefd9d7ee8d27e6fc48ac55
[TEST] #2 Update VSMS 11_define_memrasdunits.py to use cim_define()
Use template RASD when defining guest. Some minor changes so that the test
fits with the style conventions of other test cases.
Removed some extraneous debug from assoc.py
Updates:
-Only undefine the guest if hasn't been done so already
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r fd464f0d24d0 -r d1443d4847e3 suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Thu Jan 29 08:37:46 2009 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Fri Jan 30 13:23:31 2009 -0800
@@ -21,17 +21,14 @@
#
import sys
-import pywbem
-from VirtLib import live
-from XenKvmLib import vsms
-from XenKvmLib.test_doms import undefine_test_domain
-from XenKvmLib.common_util import create_using_definesystem
-from XenKvmLib import rasd
-from XenKvmLib.classes import get_typed_class
+from pywbem.cim_types import Uint64
+from XenKvmLib.classes import get_typed_class, inst_to_mof
from XenKvmLib import enumclass
from XenKvmLib.const import do_main
from CimTest.Globals import logger
from CimTest.ReturnCodes import FAIL, PASS
+from XenKvmLib.vxml import get_class
+from XenKvmLib.rasd import get_default_rasds
sup_types = ['Xen', 'XenFV', 'KVM']
default_dom = "memrasd_test"
@@ -45,30 +42,38 @@
("GigaBytes", 30),
]
-def try_define(options, vssd, units, value):
- mrasd_class = vsms.get_masd_class(options.virt)
- mrasd = mrasd_class(megabytes=value, mallocunits=units,
- name=default_dom)
+def try_define(options, units, value, cxml):
+ mrasd_cn = get_typed_class(options.virt, "MemResourceAllocationSettingData")
- params = {
- "vssd" : vssd,
- "rasd" : [mrasd.mof()],
- }
+ rasds = get_default_rasds(options.ip, options.virt)
- logger.info("Defining with %s = %i" % (units, value))
- rc = create_using_definesystem(default_dom,
- options.ip,
- params=params,
- virt=options.virt)
-
- if rc != PASS:
- logger.error("DefineSystem (%s) failed" % units)
- return False
+ rasd_list = {}
- return True
+ for rasd in rasds:
+ if rasd.classname == mrasd_cn:
+ rasd['VirtualQuantity'] = Uint64(value)
+ rasd['AllocationUnits'] = units
+ rasd_list[mrasd_cn] = inst_to_mof(rasd)
+ else:
+ rasd_list[rasd.classname] = None
+
+ if rasd_list[mrasd_cn] is None:
+ logger.error("Unable to get template MemRASD")
+ return FAIL
+
+ cxml.set_res_settings(rasd_list)
+
+ logger.info("Defining with %s = %i", units, value)
+
+ ret = cxml.cim_define(options.ip)
+ if not ret:
+ logger.error("DefineSystem with (%s) units failed" % units)
+ return FAIL
+
+ return PASS
def check_value(options):
- mrasd_cn = get_typed_class(options.virt, rasd.masd_cn)
+ mrasd_cn = get_typed_class(options.virt, "MemResourceAllocationSettingData")
rasds = enumclass.EnumInstances(options.ip, mrasd_cn, ret_cim_inst=True)
the_rasd = None
@@ -80,46 +85,50 @@
if not the_rasd:
logger.error("Did not find test RASD on server")
- return False
+ return FAIL
if the_rasd["AllocationUnits"] != "KiloBytes":
logger.error("MRASD units are not kilobytes?")
- return False
+ return FAIL
cim_kb = int(the_rasd["VirtualQuantity"])
if cim_kb != mem_kb:
logger.error("CIM reports %i KB instead of %i KB" % (cim_kb, mem_kb))
- return False
+ return FAIL
logger.info("Verified %i KB" % mem_kb)
- return True
+ return PASS
@do_main(sup_types)
def main():
options = main.options
- vssd = vsms.get_vssd_mof(options.virt, default_dom)
+ cxml = get_class(options.virt)(default_dom)
- status = PASS
+ status = FAIL
+ guest_is_undefined = None
for units, shift in values:
+ guest_is_undefined = False
+
value = mem_bytes >> shift
- if not try_define(options, vssd, units, value):
- status = FAIL
+ status = try_define(options, units, value, cxml)
+ if status != PASS:
break
- if not check_value(options):
- status = FAIL
+ status = check_value(options)
+ if status != PASS:
break
- undefine_test_domain(default_dom, options.ip, virt=options.virt)
+ cxml.undefine(options.ip)
+ guest_is_undefined = True
- undefine_test_domain(default_dom, options.ip, virt=options.virt)
-
+ if guest_is_undefined != True:
+ cxml.undefine(options.ip)
return status
diff -r fd464f0d24d0 -r d1443d4847e3 suites/libvirt-cim/lib/XenKvmLib/assoc.py
--- a/suites/libvirt-cim/lib/XenKvmLib/assoc.py Thu Jan 29 08:37:46 2009 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/assoc.py Fri Jan 30 13:23:31 2009 -0800
@@ -49,7 +49,6 @@
names = []
try:
- logger.info("DEBUG instanceref, is %s", instanceref)
names = conn.AssociatorNames(instanceref, AssocClass=assoc_cn)
except pywbem.CIMError, arg:
print arg[1]
@@ -79,7 +78,6 @@
names = []
try:
- logger.info("DEBUG instanceref, is %s", instanceref)
names = conn.Associators(instanceref, AssocClass=assoc_cn)
except pywbem.CIMError, arg:
print arg[1]
15 years, 10 months
[PATCH] [TEST] Add compare functions to CIM_Instance class
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1233349527 28800
# Node ID 0612bccec10e0221328decb12d435d0c611e732b
# Parent d86fcc1592a36d5a1c246009dbcb472e35cf87ba
[TEST] Add compare functions to CIM_Instance class.
These functions allow you to compare a CIM_Instance class object in the
following ways:
rasd_inst == None
rasd_inst != None
The following aren't supported: <, >, <=, >=.
Also, return a mof version of the CIM_Instance class when printing. This
allows the caller to print the return values from EnumInstances() (etc) without
encountering an error.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r d86fcc1592a3 -r 0612bccec10e suites/libvirt-cim/lib/XenKvmLib/enumclass.py
--- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Fri Jan 30 13:02:15 2009 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Fri Jan 30 13:05:27 2009 -0800
@@ -34,12 +34,47 @@
def __init__(self, inst):
self.inst = inst
+ def __eq__(self, other):
+ if self is other:
+ return True
+ else:
+ return False
+
+ def __ne__(self, other):
+ if self is other:
+ return False
+ else:
+ return True
+
+ def __coerce__(self, other):
+ logger.error("__coerce__ function not implemented")
+ return NotImplemented
+
+ def __cmp__(self, other):
+ logger.error("__cmp__ function not implemented")
+ return NotImplemented
+
+ def __gt__(self, other):
+ logger.error("__gt__ function not implemented")
+ return NotImplemented
+
+ def __lt__(self, other):
+ logger.error("__gt__ function not implemented")
+ return NotImplemented
+
+ def __ge__(self, other):
+ logger.error("__gt__ function not implemented")
+ return NotImplemented
+
+ def __le__(self, other):
+ logger.error("__gt__ function not implemented")
+ return NotImplemented
def __getattr__(self, attr):
return self.inst[attr]
def __str__(self):
- print self.inst.items()
+ return self.inst.tomof()
class CIM_CimtestClass(CIM_Instance):
def __init__(self, host, ref):
15 years, 10 months
[PATCH] [TEST] Update VSMS 11_define_memrasdunits.py to use cim_define()
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1233247097 28800
# Node ID 5c3e489b2d299655682443c263a2f74ec84561f2
# Parent fd464f0d24d0f4173cefd9d7ee8d27e6fc48ac55
[TEST] Update VSMS 11_define_memrasdunits.py to use cim_define()
Use template RASD when defining guest. Some minor changes so that the test
fits with the style conventions of other test cases.
Removed some extraneous debug from assoc.py
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r fd464f0d24d0 -r 5c3e489b2d29 suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Thu Jan 29 08:37:46 2009 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Thu Jan 29 08:38:17 2009 -0800
@@ -21,17 +21,14 @@
#
import sys
-import pywbem
-from VirtLib import live
-from XenKvmLib import vsms
-from XenKvmLib.test_doms import undefine_test_domain
-from XenKvmLib.common_util import create_using_definesystem
-from XenKvmLib import rasd
-from XenKvmLib.classes import get_typed_class
+from pywbem.cim_types import Uint64
+from XenKvmLib.classes import get_typed_class, inst_to_mof
from XenKvmLib import enumclass
from XenKvmLib.const import do_main
from CimTest.Globals import logger
from CimTest.ReturnCodes import FAIL, PASS
+from XenKvmLib.vxml import get_class
+from XenKvmLib.rasd import get_default_rasds
sup_types = ['Xen', 'XenFV', 'KVM']
default_dom = "memrasd_test"
@@ -45,30 +42,38 @@
("GigaBytes", 30),
]
-def try_define(options, vssd, units, value):
- mrasd_class = vsms.get_masd_class(options.virt)
- mrasd = mrasd_class(megabytes=value, mallocunits=units,
- name=default_dom)
+def try_define(options, units, value, cxml):
+ mrasd_cn = get_typed_class(options.virt, "MemResourceAllocationSettingData")
- params = {
- "vssd" : vssd,
- "rasd" : [mrasd.mof()],
- }
+ rasds = get_default_rasds(options.ip, options.virt)
- logger.info("Defining with %s = %i" % (units, value))
- rc = create_using_definesystem(default_dom,
- options.ip,
- params=params,
- virt=options.virt)
-
- if rc != PASS:
- logger.error("DefineSystem (%s) failed" % units)
- return False
+ rasd_list = {}
- return True
+ for rasd in rasds:
+ if rasd.classname == mrasd_cn:
+ rasd['VirtualQuantity'] = Uint64(value)
+ rasd['AllocationUnits'] = units
+ rasd_list[mrasd_cn] = inst_to_mof(rasd)
+ else:
+ rasd_list[rasd.classname] = None
+
+ if rasd_list[mrasd_cn] is None:
+ logger.error("Unable to get template MemRASD")
+ return FAIL
+
+ cxml.set_res_settings(rasd_list)
+
+ logger.info("Defining with %s = %i", units, value)
+
+ ret = cxml.cim_define(options.ip)
+ if not ret:
+ logger.error("DefineSystem with (%s) units failed" % units)
+ return FAIL
+
+ return PASS
def check_value(options):
- mrasd_cn = get_typed_class(options.virt, rasd.masd_cn)
+ mrasd_cn = get_typed_class(options.virt, "MemResourceAllocationSettingData")
rasds = enumclass.EnumInstances(options.ip, mrasd_cn, ret_cim_inst=True)
the_rasd = None
@@ -80,46 +85,45 @@
if not the_rasd:
logger.error("Did not find test RASD on server")
- return False
+ return FAIL
if the_rasd["AllocationUnits"] != "KiloBytes":
logger.error("MRASD units are not kilobytes?")
- return False
+ return FAIL
cim_kb = int(the_rasd["VirtualQuantity"])
if cim_kb != mem_kb:
logger.error("CIM reports %i KB instead of %i KB" % (cim_kb, mem_kb))
- return False
+ return FAIL
logger.info("Verified %i KB" % mem_kb)
- return True
+ return PASS
@do_main(sup_types)
def main():
options = main.options
- vssd = vsms.get_vssd_mof(options.virt, default_dom)
+ cxml = get_class(options.virt)(default_dom)
- status = PASS
+ status = FAIL
for units, shift in values:
value = mem_bytes >> shift
- if not try_define(options, vssd, units, value):
- status = FAIL
+ status = try_define(options, units, value, cxml)
+ if status != PASS:
break
- if not check_value(options):
- status = FAIL
+ status = check_value(options)
+ if status != PASS:
break
- undefine_test_domain(default_dom, options.ip, virt=options.virt)
+ cxml.undefine(options.ip)
- undefine_test_domain(default_dom, options.ip, virt=options.virt)
-
+ cxml.undefine(options.ip)
return status
diff -r fd464f0d24d0 -r 5c3e489b2d29 suites/libvirt-cim/lib/XenKvmLib/assoc.py
--- a/suites/libvirt-cim/lib/XenKvmLib/assoc.py Thu Jan 29 08:37:46 2009 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/assoc.py Thu Jan 29 08:38:17 2009 -0800
@@ -49,7 +49,6 @@
names = []
try:
- logger.info("DEBUG instanceref, is %s", instanceref)
names = conn.AssociatorNames(instanceref, AssocClass=assoc_cn)
except pywbem.CIMError, arg:
print arg[1]
@@ -79,7 +78,6 @@
names = []
try:
- logger.info("DEBUG instanceref, is %s", instanceref)
names = conn.Associators(instanceref, AssocClass=assoc_cn)
except pywbem.CIMError, arg:
print arg[1]
15 years, 10 months
[PATCH] [TEST] Don't pass graphics RASD for older provider versions
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1233247066 28800
# Node ID fd464f0d24d0f4173cefd9d7ee8d27e6fc48ac55
# Parent 86b52969f91d69a1460f13326b05ca3357ad0599
[TEST] Don't pass graphics RASD for older provider versions.
GraphicsRASD support was added in provider version 763.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 86b52969f91d -r fd464f0d24d0 suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Jan 27 00:41:21 2009 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Thu Jan 29 08:37:46 2009 -0800
@@ -47,6 +47,9 @@
from CimTest.ReturnCodes import SKIP, PASS, FAIL
from XenKvmLib.classes import virt_types, get_typed_class
from XenKvmLib.enumclass import GetInstance
+from XenKvmLib.const import get_provider_version
+
+vsms_graphics_sup = 763
class XMLClass:
xml_string = ""
@@ -508,8 +511,11 @@
pass
else:
res_settings.append(str(self.nasd))
- if self.gasd is not None:
- res_settings.append(str(self.gasd))
+
+ curr_cim_rev, changeset = get_provider_version(self.virt, ip)
+ if curr_cim_rev >= vsms_graphics_sup:
+ if self.gasd is not None:
+ res_settings.append(str(self.gasd))
if ref_conf is None:
ref_conf = ' '
15 years, 10 months
Difference in the value assigned to port field for Xen, KVM, LXC
by Deepti B Kalakeri
Hi,
I am trying to verify the KVMRedirectionSAP. I am seeing difference in
the way the port value is getting assigned.
I am trying to create a guest using DefineSystem(). Here is the Details
of the GraphicsRASD I am passing as part of the ResourceSetting Parameter.
KVM_GraphicsResourceAllocationSettingData {
InstanceID = "test_redsap_dom/graphics";
ResourceType = 24;
KeyMap = "en-us";
ResourceSubType = "vnc";
Address = "127.0.0.1:5931";
};
My intention is to create a guest whose vnc port has a specific value,
ex: 5931 in the above case.
Though the guest is getting created, the dumpxml of the guest shows that
the port value is getting assigned to -1.
Hence the port part of the Address field in GraphicsRASD is set to -1.
Hence the port value in the ElementName/Name is supplied as -1.
PS: I have used values between 5900 - 5999 for the port field in the
graphics part.
Here is the Xen XML details obtained from the debug statement.
<domain type="xen">
<name>test_redsap_dom</name>
<on_poweroff>destroy</on_poweroff>
<on_crash>destroy</on_crash>
<uuid>125f39c4-e0f0-4b2d-bb84-891700639af0</uuid>
<os>
<type>linux</type>
<kernel>/tmp/default-xen-kernel</kernel>
<initrd>/tmp/default-xen-initrd</initrd>
<cmdline/>
</os>
<currentMemory>131072</currentMemory>
<memory>131072</memory>
<vcpu>1</vcpu>
<devices>
<disk type="file" device="disk">
<source file="/tmp/default-xen-dimage"/>
<target dev="xvda"/>
</disk>
<interface type="network">
<mac address="11:22:33:aa:bb:cc"/>
<source network="cimtest-networkpool"/>
</interface>
<input type="mouse" bus="xen"/>
<graphics type="vnc" port="5931" listen="127.0.0.1" keymap="en-us"/>
</devices>
</domain>
But I am able to create a guest with a port of my desired value for KVM.
For KVM I am able to get appropriate value for the port in the Address
and the ElementName/Name field of the GraphicsRASD/KVMRedirectionSAP.
Here is the XML used for creating KVM guest.
<domain type="kvm">
<name>test_redsap_dom</name>
<on_poweroff>destroy</on_poweroff>
<on_crash>destroy</on_crash>
<uuid>c1c5c50b-52ce-4ba3-868e-dee42708063a</uuid>
<os>
<type>hvm</type>
<boot dev="hd"/>
</os>
<currentMemory>131072</currentMemory>
<memory>131072</memory>
<vcpu>1</vcpu>
<devices>
<disk type="file" device="disk">
<source file="/tmp/default-kvm-dimage"/>
<target dev="hda"/>
</disk>
<interface type="network">
<mac address="11:22:33:aa:bb:cc"/>
<source network="cimtest-networkpool"/>
</interface>
<input type="mouse" bus="ps2"/>
<graphics type="vnc" port="5948" listen="127.0.0.1" keymap="en-us"/>
</devices>
</domain>
In case of LXC I am able to assign port value of choice and able to get
the desired value in the Address and the ElementName/Name fields for the
defined guest.
But the problem with the LXC is that value of the rport in the
ElementName/Name and Address is getting set to -1 even when guest is
started.
Also, though the virsh shows the guest as running the EnabledState value
for Xen and LXC guest is still set to 3 instead of setting a value of 6.
LXC:
<domain type='lxc'>
<name>test_redsap_dom</name>
<uuid>05e67d5e-7702-46c4-a90b-2f416001f95b</uuid>
<memory>131072</memory>
<currentMemory>131072</currentMemory>
<vcpu>0</vcpu>
<os>
<type arch='x86_64'>exe</type>
<init>/tmp/cimtest_lxc_init</init>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<filesystem type='mount'>
<source dir='/tmp/lxc_files'/>
<target dir='/tmp'/>
</filesystem>
<console type='pty' tty='/dev/pts/3'>
<source path='/dev/pts/3'/>
<target port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='5914' autoport='no' listen='127.0.0.1'
keymap='en-us'/>
</devices>
</domain>
Please let me know if there is something which I have missed.
--
Thanks and Regards,
Deepti B. Kalakeri
IBM Linux Technology Center
deeptik(a)linux.vnet.ibm.com
15 years, 10 months