Tim Golden wrote:
> Thanks for posting. Nothing's jumping out at me I'm afraid.

I've had another chance to look at this today and have found a workaround using 
win32com.client but still cannot figure why it exempts when using the WMI 
module.

Using WMI module
HD =  
c.Msvm_ResourceAllocationSettingData(InstanceID='Microsoft:Definition\\353B3BE8-310C-4CF4-839E-4E1B14616136\\Default')[0]
HD.Address = 30

Results in the error;
wmi.x_wmi: <x_wmi: Unexpected COM Error (-2147352567, 'Exception occurred.', (0,
 u'SWbemObjectEx', u'Provider is not capable of the attempted operation ', None,
 0, -2147217372), None)>

Using win32com.client and rewrapping it using wmi._wmi_object() after setting 
properties works correctly.
HDobj = win32com.client.Dispatch("WbemScripting.SWbemLocator")\
    .ConnectServer("avs-cnode-06","root/virtualization")\
    
.Get("Msvm_ResourceAllocationSettingData.InstanceID='Microsoft:Definition\\353B3BE8-310C-4CF4-839E-4E1B14616136\\Default'")
HDobj.Address = 30
HD = wmi._wmi_object(HDobj)

Any ideas? The win32com.client is a really ugly hack.


Graham Bloice wrote:
> In the Python call to AddVirtualSystemResources() you've reversed the order 
> of the parameters.

Additionally the method signature for AddVirtualSystemResources() returns
<function AddVirtualSystemResources (ResourceSettingData[], TargetSystem) => 
(Job, NewResources[], ReturnValue)>
Which is backwards to the previously demonstrated powershell example.

Thanks

Matt




Warwickshire Schools Email System

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed.  If 
you have received this email in error please forward to: 
postmas...@we-learn.com.

If the content of this email is considered to be inappropriate or offensive 
please report by forwarding to: reportab...@we-learn.com
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to