Setting boolean variables doesn't work with vboxwebsrv

Discussion about using the VirtualBox API, Tutorials, Samples.
Post Reply
YuriyT
Posts: 3
Joined: 26. Nov 2014, 11:42

Setting boolean variables doesn't work with vboxwebsrv

Post by YuriyT »

Hi folks!
I have a trouble setting boolean values via SOAP for VBOX.
Actually, I need to set IMachine_setHPETEnabled to True programmatically, but IMachine_setCPUHotPlugEnabled also doesn't work.
Trying to set these parameters always follows with Machine is not mutable error. But setting of memory like in SDK example works fine.
What I'm actually do. I using suds SOAP client library for Python.

This is part of a vbox web server wrapper's code:

Code: Select all

def __init__(self, wsdlFileName, hostString, username = '', password = '', SessionId = None, VboxID=None):
 wsdlFile = urllib.parse.urljoin('file:', urllib.request.pathname2url(path + "\\" + wsdlFileName))
 self.client = Client(wsdlFile, location = hostString)
 self.VboxID = self.client.service.IWebsessionManager_logon(username, password)
 self.SessionId = self.client.service.IWebsessionManager_getSessionObject(self.VboxID)

 def RestoreSnapshot(self, machineName, SnapshotName):
        self.MachineName = machineName
        self.MachineUID = self.client.service.IVirtualBox_findMachine(self.VboxID, machineName)
        snapShotId = self.client.service.IMachine_findSnapshot(self.MachineUID, SnapshotName)
        writableMachineUID = self.__lockMachineGetWritableUID__(self.MachineUID, self.SessionId)
        consoleId = self.client.service.ISession_getConsole(self.SessionId)
         self.client.service.IConsole_restoreSnapshot(consoleId, snapShotId)
        self.__unlockMachine__(writableMachineUID, self.SessionId)
        return snapShotId

def SetHpet(self,state):
        writableMachineUID = self.__lockMachineGetWritableUID__(self.MachineUID, self.SessionId)
        try:
            self.client.service.IMachine_setHPETEnabled(writableMachineUID,True)<< Machine is not mutable error here
            #self.client.service.IMachine_setMemorySize(writableMachineUID,1024) <<this is works here!!!
        finally:
            self.__unlockMachine__(self, writableMachineUID, self.SessionId)


Code that uses mentioned lib:
wsdfl_file_name='vboxwebService-4.2.wsdl'
vbWebCtrl1=VBoxWebControl(wsdfl_file_name,'localhost_url:18083/')
vbWebCtrl1.RestoreSnapshot('Win7x64_1','TestSnapshot')
vbWebCtrl1.SetHpet(True)<< here I use true and 'true' and 'True' - nothing was changed- same error
vbWebCtrl1.StartVM()

Setting of HPET works perfectly via commandline. Please, let me know what I'm doing wrong or fix this.

VBOX info:
VM VirtualBox web service Version 4.3.12
VirtualBox web service 4.3.12 r93733
Webserver
Python
Win7x64
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Setting boolean variables doesn't work with vboxwebsrv

Post by noteirak »

Any reason why you're not using the glue API instead of usnig direct SOAP calls?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
YuriyT
Posts: 3
Joined: 26. Nov 2014, 11:42

Re: Setting boolean variables doesn't work with vboxwebsrv

Post by YuriyT »

noteirak wrote:Any reason why you're not using the glue API instead of usnig direct SOAP calls?
One of case is that I need to use vbox manager remotely. Also we already has codebase that working fine for us and we don't want to change it.
In other words: rewrite isn't a good way for us, we need to be able to work via SOAP
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Setting boolean variables doesn't work with vboxwebsrv

Post by noteirak »

Then it's a specific questions for the devs. If you want a fast answer, I can only suggest to use the dev mailing list or the dev IRC channel.
Or you hope they read this thread and answer :) Usually it's only me on this part of the forum.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
YuriyT
Posts: 3
Joined: 26. Nov 2014, 11:42

Re: Setting boolean variables doesn't work with vboxwebsrv

Post by YuriyT »

noteirak wrote:Then it's a specific questions for the devs. If you want a fast answer, I can only suggest to use
Or you hope they read this thread and answer :) Usually it's only me on this part of the forum.
Thank you for your suggestion!
do you know why I'm getting rejected mail like:
You are not allowed to post to this mailing list, and your message has
been automatically rejected. If you think that your messages are
being rejected in error, contact the mailing list owner at
vbox-dev-owner @ virtualbox . org.

What may be wrong?
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Setting boolean variables doesn't work with vboxwebsrv

Post by noteirak »

You first need to register on the mailing list (this is to prevent any kind of spam). See the "subscribing to..." section on the list page - Page for dev mailing list
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply