Commit Graph

110 Commits

Author SHA1 Message Date
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 78ed97fd84 Fix build break 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 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
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 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 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 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
David Anderson f022b566de - Win compile fixes
svn path=/trunk/boinc/; revision=25665
2012-05-09 20:06:54 +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 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 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
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
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
Rom Walton 702c78d8c8 - VBOX: Parse the vboxmanage error code for *nix as well.
- VBOX: Switch to using status.suspend_request instead of status.suspend
        when determining when to suspend/resume a VM.  status.suspended is
        now only changed when direct_process_action is set to true.

    samples/vboxwrapper/
        vboxwrapper.cpp
        vbox.cpp

svn path=/trunk/boinc/; revision=25394
2012-03-09 03:05:48 +00:00
Rom Walton 594ab7a80d - Vbox: Include date component in log messages to ease debugging long
running VM tasks.
        
    samples/vboxwrapper/
        vbox.cpp
        vboxwrapper.cpp, .h

svn path=/trunk/boinc/; revision=25308
2012-02-21 22:31:50 +00:00
Rom Walton 8397db8a9e - VBOX: Remove the renaming of the vm disk image code. It isn't needed
and it complicates things in the CC.
        
    samples/vboxwrapper/
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25220
2012-02-08 20:31:03 +00:00
Charlie Fenton 94b6094a35 VBOX: Fix compiler warnings on Mac
svn path=/trunk/boinc/; revision=25146
2012-01-25 09:09:35 +00:00
Rom Walton bd1d4e5fe8 - VBOX: Demote the priority level of the VM process to try and prevent
latency issues for volunteers.
    - VBOX: If the port forwarding preferred port isn't usable, try asking
        the OS for one.
    - VBOX: On a failure, get the VM process exit code and report it with
        the rest of the stderr spew.

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

svn path=/trunk/boinc/; revision=25133
2012-01-24 04:13:00 +00:00
Rom Walton 5eb81e7311 - VBOX: Enable the wrapper to handle fractional CPU usage. If
the server specifies 1.1 CPUs used, allocate 2 CPUs to be used
        in VirtualBox.
        
    samples/vboxwrapper
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25119
2012-01-21 17:57:50 +00:00
Rom Walton 346eff699c - VBOX: Add User ID and Host ID to the CERN data format.
samples/vboxwrapper
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25068
2012-01-15 07:08:27 +00:00
Rom Walton 0c33c456ec - VBOX: Fix regression where the vm_name wasn't reset back to the
current wu name after deregistering a stale VM.

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

svn path=/trunk/boinc/; revision=25067
2012-01-15 04:35:13 +00:00
Rom Walton 5e0fbe8dc7 Quick Updates
svn path=/trunk/boinc/; revision=25047
2012-01-13 19:33:27 +00:00
David Anderson 81b29b0cc9 - API: fix queueing problem for graphics-related messages
(web graphics URL and remote desktop addr)
- GUI RPC and API:
    change "remote_desktop_connection" to "remote_desktop_addr" everywhere.
    It's an address, not a connection.
- vboxwrapper: log message cleanup


svn path=/trunk/boinc/; revision=25044
2012-01-13 19:00:16 +00:00
Rom Walton fda0d55ac2 Quick Updates
svn path=/trunk/boinc/; revision=25043
2012-01-13 16:03:23 +00:00
Rom Walton 97bdbee73e - VBOX: It helps to remove the older send msg routines. Oooops.
samples/vboxwrapper
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25042
2012-01-13 15:56:40 +00:00
Rom Walton ce4650ecbb - VBOX: Cleanup a few messages stating port numbers in the stderr spew.
- VBOX: Send configuration settings in one message instead of piece meal.
    
    api/
        boinc_api.cpp, .h
    samples/vboxwrapper
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25041
2012-01-13 15:21:00 +00:00
Rom Walton 4538282220 - VBOX: Make sure the configured port numbers persist across
restarts of the client software.  Remote desktop stopped
        working if the client software was restarted.

    samples/vboxwrapper
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25037
2012-01-13 03:12:00 +00:00
Rom Walton 2c54c9735a - VBOX: Report the remote desktop connection information to the
core client.  Next commit will create an extra "VM Console"
        button in the manager when detected.  Volunteers will just have
        to click the button to see what is going on with the VM.

    api/
        boinc_api.cpp, .h
    samples/vboxwrapper
        vbox.cpp, .h
        vboxwrapper.cpp, .h

svn path=/trunk/boinc/; revision=25035
2012-01-12 20:57:23 +00:00
Rom Walton fea602b6e6 - VBOX: Enable remote desktop functionality for a VM that has
<enable_remotedesktop/> specified in its vbox_job.xml file.
        
      NOTE: It does require the VirtualBox extension pack, but that
        is freely available on the VirtualBox download page.
        
    samples/vboxwrapper
        vbox.cpp, .h
        vboxwrapper.cpp, .h

svn path=/trunk/boinc/; revision=25034
2012-01-12 15:54:28 +00:00
David Anderson 125ad03a54 - vboxwrapper: add <pf_host_port> element to config file.
Specifies host port # for port forwarding.
    If absent or zero, assign a port.


svn path=/trunk/boinc/; revision=25030
2012-01-11 23:21:17 +00:00
Rom Walton 6d731ccc6d - VBOX: Fix regression where the ERR_CPU_VM_EXTENSIONS_DISABLED error
message wasn't being written to stderr when the VM extensions
        were disabled via the BIOS.
        
    samples/vboxwrapper/
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25010
2012-01-08 20:18:14 +00:00
Rom Walton ba1169107e - VBOX: Sleep for the remainder of the polling period and not the
whole poll period.

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

svn path=/trunk/boinc/; revision=25008
2012-01-07 20:36:48 +00:00
Rom Walton f9a0ba4759 - VBOX: Extract the various logs before attempting to cleanup if the
registration process fails.
        
    samples/vboxwrapper/
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=24996
2012-01-05 06:34:22 +00:00
Rom Walton ea726d4985 - VBOX: Use strtol instead of atol to parse Vbox error codes from
stderr/stdout output.
    - VBOX: Undo my reorg yesterday with regards to report_vm_pid and
        report_net_usage.
    - VBOX: Only report network usage in the status report if
        aid.global_prefs.daily_xfer_limit_mb is non-zero
    - VBOX: Add the VM log to the list of things reported on a start
        failure.  Hypervisor log suggests that it launched the VM but
        it failed unexpectedly.  So there might be cases where it
        actually exists.

    samples/vboxwrapper/
        vbox.cpp
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=24992
2012-01-04 18:21:40 +00:00