[vbox-dev] SOLVED: VirtualBox Teleporting and SOAP API "waitForCompletion"

Joseph Smith joseph1962smith at yahoo.com
Sun Sep 19 17:15:18 GMT 2010


Hi Bird,

Thank you very much for the feedback.  Though I did read (and re-read many 
times) the sections you have identified, I think because I incorrectly called 
IProgress::waitForCompletion (-1) hoping it would come back when all was 
'good-to-go' ... and it never came back ... I misunderstood what was being 
stated.

>From your comments, if I understand correctly, I believe the correct way in a 
teleport scenario then is to monitor the IProgress object to ensure that the 
result of (IProgress::operationCount - IProgress::operation) is less-than or 
equal to 2 before initiating the IConsole::teleport command on the source.

Is that correct?  If you agree ... I'll modify my approach as noted above.

That said ... It seems I've been getting 'lucky' as I've not yet had a case 
where a teleport has failed (since changing to the approach I described in my 
earlier note).  It appears that the preparation to teleport must attain 
penultimate state rather quickly.


Thanks,
Joe




________________________________
From: Knut Osmundsen <knut.osmundsen at oracle.com>
To: Joseph Smith <joseph1962smith at yahoo.com>
Cc: vbox-dev at virtualbox.org
Sent: Sun, September 19, 2010 9:55:19 AM
Subject: Re: [vbox-dev] SOLVED: VirtualBox Teleporting and SOAP API 
"waitForCompletion"



On Sep 19, 2010, at 3:18 AM, Joseph Smith wrote:

Hi All,
>
>I had the chance to follow-up and do some very extensive testing and with 
>Klaus's insight via our discussion on IRC, have found the error of my ways ... 
>Thanks Klaus.  Your feedback was instrumental in helping me find the problem!!!
>
>For anyone else that might be interested, I'll describe the mistake I made and 
>outline the steps that through testing I have confirmed works every time.
>
>First:  What am I trying to do and why:
>On occasion, though not often, I need to take a live host off-line (to upgrade 
>memory, replace/change internal hardware, etc).  These live hosts can have 
>anywhere from 9 - 15 VMs running at a time.  To take this host offline without 
>powering-down the VMs, the VirtualBox teleport feature is ideal.  My goal then 
>was to teleport each of the VMs from the existing host to another host (must be 
>on the same network and have access to the same networked storage subsystem 
>where the virtual drives are).  VBoxManage does provide a command line option to 
>initiate the teleport request but does require coordinating the execution on 
>both the source and target hosts.  As I have control of all the VirtualBox hosts 
>via the SOAP Webservice APIs, I decided to automate the entire process.
>
>What I was doing wrong:
>The steps I outline in the original message (see below) are actually correct 
>except for Step #7.  The call to power-up the VM with a new Session via the 
>IConsole object returnes a progressRef object and I assumed it was necessary to 
>wait for completion before moving forward.  THIS IS WRONG!  In reality, the 
>correct way to determine the VM is ready for the teleport-in step is to watch 
>the state of the target VM and wait for the state to change to 'TELEPORTINGIN'.  
>Once in this state, the teleport step on the source VM can be done.
>

If you are using IVirtualBox::openRemoteSession (renamed on trunk) it's NOT the 
right way either. Take a look at 
what http://www.virtualbox.org/sdkref/interface_i_virtual_box.html#915f7609a00e888a15cbf74aef743bcc
 and http://www.virtualbox.org/sdkref/interface_i_console.html#0191f0ffb739504065c05f6e33a65a7c
c says about teleportation. Before attempting call IConsole::teleport() you 
should wait for the progress object to reach the penultimate operation 
(IProgress::OperationCount - 2).

-- 

Kind regards / Mit freundlichen Gruessen / Vennlig hilsen,
 bird

--

ORACLE Deutschland B.V. & Co. KG  Knut St. Osmundsen
Werkstrasse 24                    Senior Staff Engineer, VirtualBox
71384 Weinstadt, Germany          mailto:bird at sun.com

Hauptverwaltung: Riesstr. 25, D-80992 Muenchen
Registergericht: Amtsgericht Muenchen, HRA 95603

Komplementaerin: ORACLE Deutschland Verwaltung B.V.
Rijnzathe 6, 3454PV De Meern, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschaeftsfuehrer: J. Kunz, M. van de Molen, A. van der Ven 



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20100919/130c3afc/attachment.html>


More information about the vbox-dev mailing list