Problem with PowerOff of snapshot?

Jul 15, 2010 at 10:49 AM


I'm trying out the remoteInstall test framework and so far I think it seems to be a usefull tool that have a big potential.

I've created a simple configuration file with one installer (sample.msi) and one virtualmachine (current snapshot). I've got it running and remoteinstall powers on the virtual machine, copies the sample.msi to the virtual machine. The installation and the uninstallation works fine, and the log is collected from the virtual machine and transferred to the computer. RemoteInstall finishes and everything looks fine...

.. but the virtual machine wasn't powered off...

I've tried to explicitly set powerOff="true" on snapshot and snapshots, but that didn't help. I've tried creating a task that explicitly issues a shutdown on the virtual machine, that powers off the virtual machine but hinders the collection of the log files...

I'm thinking of a workaround where I call remoteinstall twice, the first call runs the tests and the second uses a configuration file that just power off the virtual machine.

Do you have some other ide on how to get this working? I would like to just use one configuration file. My impression was that it should automatically have been powered off, is that correct?

I'm using vmware server 2, that only has one snapshot for each virtual machine if that has anything to do with it ...

thankful for any ideas..

Jul 15, 2010 at 12:18 PM

Can you please post your config and command-line output?

Also, make sure you're using 1.2. I recently fixed a bug where poweroff had no effect in lifo and fifo sequences.



Jul 15, 2010 at 12:46 PM


thanks for the quick reply. I've pasted a copy of the configuration file, and the output.



The configuration file:

<?xml version="1.0" encoding="utf-8"?>
          type="RemoteInstall.RemoteInstallConfig, RemoteInstall"
    <!-- the installer will be copied to the destpath location on the remote vm -->
    <installers destpath="c:\install">
      <!-- the installer file definition supports * that is replaced by the latest directory in the list of subdirectories -->
        name="Sample Installer" > 
    <virtualmachines >
      <!-- a virtual machine without snapshots: this simply runs the tests on a previously powered vm -->
 <virtualmachine name="xptest" type="ESX" 
   host="buildserver:8333" file="[Store] InstallationTestXpVM/Windows XP.vmx"
   username="administrator" password="xx" >
   <snapshots >
     <snapshot name="*" username="user" password="xy" />


The output:

"C:\Documents and Settings\user\Desktop\RemoteInstall\bin\RemoteInstaller.exe" /config:installationtest.config /outputDir:tests\testlogs /outputXml:testlog.xml
RemoteInstaller 1.2.8669.0: Product Test Driver

Loading installationtest.config ...
Results will be written to 'C:\Documents and Settings\user\Desktop\RemoteInstall
Starting 1 parallel installation(s) (1 max) ...
Loading 'xptest'
Connecting to 'buildserver:8333' (ESX)
Opening '[Store] InstallationTestXpVM/Windows XP.vmx
' (ESX)
Preparing 'xptest:Current Snapshot'
 Powering on 'Remote:xptest'
 Waiting for 'Remote:xptest'
 Logging on to 'Remote:xptest' as 'user'
Copying 'Sample Installer' to 'xptest:Current Snapshot'
 'Samples\Sample.msi' => Remote:'c:\installSample.msi'
Running 'Remote:Sample Installer', 'c:\installSample.msi'
Saving logs in 'tests\testlogs\unknown\Sample Installer\xptest\Current Snapshot'

Installing 'Remote:Sample Installer', 'c:\installSample.msi'
 Executing 'Remote:msiexec.exe /qn /i "c:\installSample.msi" /l*v "c:\installSam
ple.msii.log" '
Uninstalling 'Remote:Sample Installer', 'c:\installSample.msi'
 Executing 'Remote:msiexec.exe /qn /x "c:\installSample.msi" /l*v "c:\installSam
ple.msix.log" '
Done after '00:00:40.9399461'
Collecting 'Remote:c:\installSample.msii.log' => 'tests\testlogs\unknown\Sample
Installer\xptest\Current Snapshot\installSample.msii.log'
 'Remote:c:\installSample.msii.log' => 'tests\testlogs\unknown\Sample Installer\
xptest\Current Snapshot\installSample.msii.log'
Collecting 'Remote:c:\installSample.msix.log' => 'tests\testlogs\unknown\Sample
Installer\xptest\Current Snapshot\installSample.msix.log'
 'Remote:c:\installSample.msix.log' => 'tests\testlogs\unknown\Sample Installer\
xptest\Current Snapshot\installSample.msix.log'
Closing '[Store] InstallationTestXpVM/Windows XP.vmx
' (ESX)
Disconnecting from 'buildserver:8333' (ESX)
Finished installation(s) with 1 result(s)
Writing tests\testlogs\testlog.xml





Jul 15, 2010 at 12:56 PM

This one is easy. You're using the * snapshot (current). It is never powered off (usually creates a frustrating experience in testing when it took you 5 minutes to power on a machine, then you run a test and it powers off).

Add powerOff="true" on the <snapshots ...> node (default is not to power off a snapshot because it's just wasting time when you're going to revert to one for the next test) and change the snapshot to be something with a name. It will revert that snapshot, run the tests and power it off.

You can run RI with /simulationOnly+ to see what would happen.

Restoring snapshot 'xptest:test snapshot'
 Powering on 'Remote:xptest'
 Waiting for 'Remote:xptest'
 Logging on to 'Remote:xptest' as 'user'
Copying 'Sample Installer' to 'xptest:test snapshot'
Running 'Remote:Sample Installer', 'c:\installSample.msi'
Creating directory 'C:\Users\dblock\Source\CodePlex\remoteinstall\trunk\unknown\Sample Installer\xptest\test snapshot'
Saving logs in 'C:\Users\dblock\Source\CodePlex\remoteinstall\trunk\unknown\Sample Installer\xptest\test snapshot'
Installing 'Remote:Sample Installer', 'c:\installSample.msi'
Uninstalling 'Remote:Sample Installer', 'c:\installSample.msi'
Done after '00:00:00.0030001'
 Powering off 'Remote:xptest'
Closing '[Store] InstallationTestXpVM/Windows XP.vmx' (ESX)
Disconnecting from 'buildserver:8333' (ESX)
Finished installation(s) with 1 result(s)

Jul 15, 2010 at 2:23 PM


thanks again for the quick reply. Specifying a name for the snapshot and setting poweroff="true" fixed it.

I'm not sure on when I'll be powering off the virtual machines, I'll look into that after I've tested to run a few tests on the installation. I'm not yet sure on how it all works. I did however feel that I would want to have control over when it's running or not.

I'm currently using Vmware server 2 (since ESX wasn't free when I set up the server some year ago) and it appears like that I cannot name my snapshots or chose which snapshot to revert to, through the web interface. And when I create a new snapshot it prompts me that it will overwrite the existing snapshot. So that's why I just told it to use the latest.

It does however appear like it's creating new snapshots on disk and giving them names like snapshot1, snapshot2 and so on; and that maybe 'overwrite the existing snapshot' only means that a new snapshot will be the latest, which is the only one available from the gui. So maybe it's possible to use it together with remoteinstaller to revert to a specific named snapshot...

Have you had any experience of using Vmware server 2 and remoteinstaller?



Jul 17, 2010 at 5:32 PM

VMWare Server doesn't support multiple snapshots, as far as I know, but it's free. RI works fine against it, but it's naturally limited in capabilities. We use ESX (requires a license to do automation against). It was worth the money, I got this one project that runs 150+ tests (150 snapshots) nightly to verify that the newest database version will upgrade every version out there. With RI we just need to create a new snapshot for every new release to test it. I guess I am trying to say that we mostly rely on snapshots, something that VMWare Server refuses to do.