Commit Graph

237 Commits

Author SHA1 Message Date
Rom Walton 10ed915bcc VBOX: If 'vboxmanage --version' successfully executes we can assume that VirtualBox is installed on all supported platforms. 2013-03-04 17:39:24 +01:00
Rom Walton 56974bff70 VBOX: If Detection of VirtualBox fails, declare it a temporary failure and reschedule after 24-hours.
6.10 and older do not detect if VirtualBox has been installed.  If a VM job is assigned to a host running on an old client and the wrapper detects VirtualBox is not installed reschedule the job for execution at a later date.  This prevents the client from requesting excessive amounts of work which will all fail.  Eventually the job will error out when it passes its deadline.
2013-03-04 17:39:23 +01:00
Rom Walton 6c716f918f - VBOX: Clean up VirtualBox version information for all platforms. 2013-03-04 17:35:35 +01:00
Rom Walton f57f32fd0b - VBOX: Clean up version string. 2013-03-04 17:24:19 +01:00
Rom Walton 78ed97fd84 Fix build break 2013-03-04 17:24:19 +01:00
Rom Walton 2cb28a822c - VBOX: On *nix systems, if the vboxdrv kernel module isn't loaded declare
it a temp error and reschedule execution at a later date.
2013-03-04 17:24:19 +01:00
Rom Walton cfca0d215e - VBOX: Record what version of VirtualBox was used, as well as whether
anonymous platform was specified for the project.
2013-03-04 17:24:19 +01:00
Rom Walton d1d200b280 - VBOX: On *nix systems, force the wrapper into sandbox mode if the
HOME environment variable is missing.  Without the HOME environment
        variable VirtualBox attempts to write log files and other state
        information in root's home directory.
2013-03-04 17:24:19 +01:00
Rom Walton 1915da2e64 - VBOX: Initialize the PATH variable before attempting to check to see if
the system is ready.
2013-03-04 17:21:32 +01:00
Rom Walton 27557feae1 - VBOX: Perform a quick check that the wrapper can communicate with
vboxsvc via vboxmanage before attempting anything else.  If it
        fails, get BOINC to reschedule task execution in 5 minutes.
2013-03-04 17:19:40 +01:00
David Anderson afdc69a8a8 More Line Ending Changes 2013-03-04 17:19:38 +01:00
Rom Walton 6b7190c0eb Line ending changes 2013-03-04 17:12:12 +01:00
Rom Walton 474b9a4f37 - VBOX: Fix build break introduced by the previous vbox commit. 2013-03-04 15:23:39 +01:00
Rom Walton e693e2df09 - VBOX: Add the ability to read a fraction done file from the shared
directory.  Use the same semantics as the regular wrapper.
2013-03-04 15:23:38 +01:00
Rom Walton 43c55fd34b - VBOX: Add the ability to specify both the type and model of disk
controller to use.  It can be specified by adding the following
        tags to vbox_job.xml:

        <vm_disk_controller_type></vm_disk_controller_type>
        <vm_disk_controller_model></vm_disk_controller_model>

      Executing vboxmanage --help will list the available options in the
        storeagectl section.
2013-03-04 14:59:23 +01:00
Rom Walton 3eaaea887a - VBOX: Ugh, if sleep_time is greater than zero, increment elapsed_time by the poll interval. 2013-03-01 16:23:13 +01:00
Rom Walton edfa1deae1 - VBOX: Do not count the sleep time as part of the elapsed time when the VM is supposed to be suspended. 2013-03-01 16:23:13 +01:00
Rom Walton 7621fd21fe - VBOX: Make adjustments to the clean-up procedure for Vbox 4.2. 2013-03-01 16:17:19 +01:00
Rom Walton ba7a0b5945 - VBOX: Cleanup all the snapshots before unregistering the VM. 2013-03-01 16:17:19 +01:00
Rom Walton dd8c025c37 - VBOX: Cleanup log a little bit 2013-03-01 16:17:19 +01:00
Rom Walton dc47fe956d - VBOX: Remove extra arguments to the enumerate snapshot command.
Copy and paste was not my friend.
2013-03-01 16:17:19 +01:00
Rom Walton 527cf846b8 - VBOX: Make deleting a snapshot a non-terminal event.
Deleting stale snapshots now consists of enumerating the existing
        snapshots and deleting all but the most recent snapshot.  This fixes
        the problem where, for one reason or another, a snapshot could not
        be deleted at one point in time.  The wrapper would just continue to
        create new ones and was unable to successfully deal with the older
        ones.  Disk space would eventually run out.
2013-03-01 16:08:53 +01:00
Rom Walton 4b57572a87 - VBOX: Don't report any error messages when unregistering the VM.
VirtualBox 4.2 no longer requires certain commands to be executed
        to unregister a VM while older versions do.  Just ignore any error
        codes, if it becomes a problem we can always make it conditional
        on what version of VirtualBox is installed.
2013-03-01 16:08:52 +01:00
Rom Walton 243db13d3a - VBOX: Remove timeouts for creating and deleting snapshots. 2013-03-01 16:08:52 +01:00
Rom Walton db00158cb0 - VBOX: Increase elapsed_time if we were forced to sleep after executing the main loop 2013-03-01 16:08:52 +01:00
Rom Walton 14948c99f6 VBOX: Change the way elapsed_time is calculated in vboxwrapper.
Previously: elapsed_time was just incremented with the value of the polling
          period each iteraction through the main loop.  This introduced issues
          when vboxmanage lagged for whatever reason.  This lag could go as high as 5
          seconds.  Over the timespan of a day this could increase the wall clock time
          of a task a great deal.

        Now: elapsed_time is incremented with the time it took to execute the main
          loop.
2013-03-01 16:05:09 +01:00
Rom Walton e613459377 - VBOX: Do not perform the hardware virtualization check when the
guest VM is 64-bit.  64-bit guest vms require hardware virtualization
        and should fail without it.
    - VBOX: Implement the <copy_to_shared/> directive in the vbox_job.xml file.
        if <copy_to_shared>init_data.xml</copy_to_shared> is set, the wrapper will
        copy the init_data.xml file to the shared directory before the VM is launched.

svn path=/trunk/boinc/; revision=25973
2012-08-03 16:24:12 +00:00
Charlie Fenton d059de100f Mac: update sample code to allow building with Xcode 4.4 GM seed under OS 10.8 GM seed
svn path=/trunk/boinc/; revision=25866
2012-07-12 11:51:21 +00:00
Charlie Fenton 72007821b7 Mac: update sample code to allow building with Xcode 4.3 and to eliminate compiler warnings
svn path=/trunk/boinc/; revision=25862
2012-07-11 10:32:09 +00:00
Charlie Fenton cc3942131e VBOX: Fix Mac compiler warnings
svn path=/trunk/boinc/; revision=25698
2012-05-19 01:12:33 +00:00
David Anderson c8c85f4a75 - vboxwrapper: don't run headful if client is sandboxed (it won't work).
svn path=/trunk/boinc/; revision=25695
2012-05-18 18:24:58 +00:00
David Anderson b2a4cd4d91 svn path=/trunk/boinc/; revision=25691 2012-05-18 17:38:16 +00:00
Rom Walton 63483b5bb7 - VBOX: When the system confirms our port number request or assigns us a
new port number to work with convert it from network byte order 
        (big endian) to the host byte order (little endian on x86/x64 processors).

    samples/vboxwrapper/
        vbox.cpp

svn path=/trunk/boinc/; revision=25671
2012-05-11 18:53:36 +00:00
David Anderson f022b566de - Win compile fixes
svn path=/trunk/boinc/; revision=25665
2012-05-09 20:06:54 +00:00
Rom Walton d2155c4488 - VBOX: Do not treat the timeout error as a fatal error when attempting
to delete stale snapshots.  Slower machines can take longer than
        45 seconds to complete the deletion of old snapshots.

    samples/vboxwrapper/
        vbox.cpp

svn path=/trunk/boinc/; revision=25474
2012-03-22 19:00:37 +00:00
Rom Walton fc818a027f - VBOX: Detect another form of out of memory error from VirtualBox.
Reschedule the job for some time in the future when there might
        be enough memory.
    - VBOX: Resume the VM's execution after the creation of the snapshot
        but before we attempt to delete the previous, now stale, snapshot.
    - VBOX: Treat the 'livesnapshotting', 'deletingsnapshotlive', and
        'deletingsnapshotlivepaused' states as online states.
        
    samples/vboxwrapper/
        vbox.cpp
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25473
2012-03-22 18:10:42 +00:00
Rom Walton 97fe7c2667 - VBOX: Before attempting to take the snapshot for a VM, pause it first.
This changes the snapshot type from a live snapshot to an online
        snapshot.  Presumably difference might make it easier to do and
        prevent the VM from asserting.
        
    samples/vboxwrapper/
        vbox.cpp, .h

svn path=/trunk/boinc/; revision=25472
2012-03-21 23:17:07 +00:00
Rom Walton 7710c0cfc8 - VBOX: We don't need to display the state of the VM before startup.
- VBOX: Change the snapshot naming scheme by removing the quotes and
        prefixing the checkpoint time with 'boinc_'.  Hopefully this will
        prevent the VM from asserting during the snapshot process.

    samples/vboxwrapper/
        vbox.cpp, .h

svn path=/trunk/boinc/; revision=25471
2012-03-21 22:13:06 +00:00
Rom Walton f7e7a065de - VBOX: Introduce the use of VM snapshots as a form of checkpoint.
- Perform snapshots at most once every ten minutes.
        - Client suspend/resume messages behave the same.
        - Client no heartbeat/quit messages cause the wrapper to just
          poweroff the VM.
        
        On startup check to see if the last checkpoint time is greater than 0,
        if so, start from the most recent snapshot.
    - VBOX: If we receieve the status message of no heartbeat or quit, set
        the temporary delay to 5 minutes.  If the wrapper is terminated during
        the middle of a snapshot, hopefully this will give VirtualBox enough
        time to complete the snapshot.  Restarting the BOINC job should then
        poweroff the VM and restore from the last snapshot.
    
    samples/vboxwrapper/
        vbox.cpp, .h
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25469
2012-03-21 20:03:47 +00:00
Rom Walton 7bbdb288ed Quick Updates
svn path=/trunk/boinc/; revision=25464
2012-03-20 18:25:43 +00:00
Rom Walton 5972bf2c8f - VBOX: On successful completion, create the same output file that
the CernVMWrapper would.  This allows both wrapppers to work with
        the same BOINC job generation system.

    samples/vboxwrapper/
        vbox.cpp

svn path=/trunk/boinc/; revision=25463
2012-03-20 18:19:56 +00:00
Rom Walton 64bdde4745 - VBOX: Make it explicily clear what the result of a start/stop
request was.  Hopefully this will give us insight into whether
        the core client is terminating the wrapper or something else is
        going on.
    - VBOX: Shorten the command execution timeout to 45 seconds.
    - VBOX: Don't attempt to re-execute the close/savestate commands.

    samples/vboxwrapper/
        vbox.cpp

svn path=/trunk/boinc/; revision=25462
2012-03-20 17:55:56 +00:00
Rom Walton 25142dda02 - VBOX: Give the VM process a short priority boost when responding
to a quit request.  On older XP machines it might speed up the memory
        dump to disk.
    - client: Increase the quit request timeout from 10 seconds to 60 seconds for
        machines running VMs and slow disk drives.  It should give the VM enough
        time to gracefully shutdown and not give boinc reason to kill the wrapper.

    client/
        app.h
    samples/vboxwrapper/
        vbox.cpp, .h
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25433
2012-03-16 01:04:43 +00:00
Rom Walton a52651bf56 - VBOX: Use the boinc_temporary_exit API properly. Wait for 5 minutes
before allowing another attempt to start the VM when the hypervisor
       cannot allocate enough memory.
    - VBOX: Print out a trace statement about the suspend/resume directive
       from the vboxwrapper perspective.  This in conjuction with the
       BOINC API trace statements should provide a better idea with
       what is going on.
       
    samples/vboxwrapper
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25424
2012-03-14 18:54:03 +00:00
Charlie Fenton e46189a816 VBOX: Fix typo in Mac wrapper name (1686 -> i686)
svn path=/trunk/boinc/; revision=25412
2012-03-13 02:07:32 +00:00
Rom Walton f52ce7153e - VBOX: If a VM fails to start because the machine is low on memory,
temporarily exit so BOINC can reschedule it for a later time.
        If the problem doesn't go away it'll just time out eventually anyway.
        
    samples/vboxsamples/
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25404
2012-03-12 17:16:51 +00:00
Rom Walton 85fce1d29a - VBOX: Only attempt to reset throttle values if the VM is in
a running state, otherwise controlvm throws an error.
        
    samples/vboxsamples/
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25403
2012-03-12 15:45:09 +00:00
Rom Walton 8f8caec6e7 - VBOX: Allow the CPU execution cap to be set back to 100% after it had
alreadly been set lower.

    samples/vboxwrapper/
        vbox.cpp
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25399
2012-03-09 22:56:19 +00:00
Rom Walton f2f9ec8dc3 - VBOX: Setting the CPU Execution Cap should be done with the controlvm
command after the VM has entered a running state instead of using
        modifyvm.
        
    samples/vboxwrapper/
        vbox.cpp

svn path=/trunk/boinc/; revision=25397
2012-03-09 19:53:34 +00:00
David Anderson dfacf7d1c1 - API: remove BOINC_STATUS::suspend_request;
it's an implementation thing, not intended for export.
    Fix a related bug.


svn path=/trunk/boinc/; revision=25396
2012-03-09 19:46:49 +00:00