Advice needed using multiple VMs

Dec 20, 2011 at 4:13 PM

Hi All

I’ve been using RemoteInstall for a project to automate some server and client installs based on a daily build.  This has worked well since the server and client installs have been fairly simple and didn’t interoperate.
 
However, I now have a new task where the server and client installs are more complicated. When our build process generates a new ISO image (daily), I need to automatically mount the ISO images and chain to together a series of installs, unit tests and uninstalls.
 
I’m hoping that RemoteInstall can help me with this. I’ve tried using the dependent VMs feature on the snapshots, but it’s not working the way I wanted. Can you offer some advice on how to do this?  I'm also reading up on how to execute tasks, which maybe what I need.

Here's what I’m trying to do:
 
My test environment:
VM1 - Domain Controller
VM2 - SQL DB
VM3 - Exchange Server
VM4 - Application Server
VM5 - Client Desktop
 
If new ISO image
 
  Turn on VM1, VM2 and VM3 (these need to be ready for VM4 and VM5)
  Turn on VM4 and VM5  (when VM1, VM2 and VM3 ready)
 
  Perform server install on VM4
  Perform client install on VM5
  Collect install results

  Run some tests on VM4
  Run some tests on VM5
  Collect test results

  Perform uninstall on VM4
  Perform uninstall on VM5
  Collect uninstall results
 
  Revert to snapshots
 
End

Dec 21, 2011 at 4:16 PM

Hi All

I'm still having some problems getting RI to do what I want.   I have two problems:

1. <Installers> Node

I have two installers that I want to run - a server installer and a client installer.  If I define the two installers within the <RemoteInstallConfig>, then RI attempts to run both installers against every virtual machine I have configured.  Whereas, I want to run the server installer on VM4 and the client installer on VM5.

From what I've read in the docs, I don't think it's possible to do this.  Can someone confirm this?

2. <dependencies> Node

To avoid the issue outline  in point 1, I tried setting up <snapshots> with dependencies.   VM4 and VM5 are dependent on VM1-VM3.

I configured my VM4 machine to be dependent on VM1, VM2 and VM3.

I configured by VM5 machine to be dependent on VM1, VM2, VM3 and VM4

Unfortunately, it starts up VM4 and the dependent machines, runs the two installers on VM4 and shuts down. It then starts up VM5 and its depenendent machine, run the two installers on VM4 and shuts down.

Can someone suggest a better alternative? 

Regards

David

Dec 21, 2011 at 5:35 PM

Here's an edited copy of my XML config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <section name="RemoteInstallConfig" type="RemoteInstall.RemoteInstallConfig, RemoteInstall"    />
    </configSections>
    <RemoteInstallConfig>
        <timeouts logout="60" />
        <!-- the installer will be copied to the destpath location on the remote vm -->
        <installers destpath="C:\">
            <!-- the installer file definition supports * that is replaced by the latest directory in the list of subdirectories -->
            <installer file="C:\Working\server_installer.msi" name="Server Installer" copymethod="network" />
            <installer file="C:\Working\client_installer.msi" name="Client Installer" copymethod="network" />
        </installers>
        <virtualmachines>
            <!-- VM4 = application server - dependent on VM1 to VM3 -->
            <virtualmachine
                name="VM4"
                type="ESX"
                host="my-esx-server" 
                file="[my-esx-server-iSCSI01] VM4/VM4.vmx"
                username="my-esx-username"
                password="my-esx-password"
                powerDelay="10">
                <snapshots>
                    <snapshot name="BASE" username="domain1\administrator" password="mypassword">
                        <dependencies>
                            <!-- dependent virtual machine with one snapshot that needs to be up -->
                            <!-- VM1 = Domain Controller -->
                            <virtualmachine
                                name="VM1"
                                type="ESX"
                                host="my-esx-server"
                                file="[my-esx-server-iSCSI01] VM1/VM1.vmx"
                                username="my-esx-username"
                                password="my-esx-password">
                                <snapshots>
                                    <!-- name = * is reserved for current snapshot -->
                                    <snapshot name="BASE" username="domain1\administrator" password="mypassword" />
                                </snapshots>
                            </virtualmachine>
                            <!-- VM2 = SQL Server -->
                            <virtualmachine
                                name="VM2"
                                type="ESX"
                                host="my-esx-server"
                                file="[my-esx-server-iSCSI01] VM2/VM2.vmx"
                                username="my-esx-username"
                                password="my-esx-password">
                                <snapshots>
                                    <!-- name = * is reserved for current snapshot -->
                                    <snapshot name="BASE" username="domain1\administrator" password="mypassword" />
                                </snapshots>
                            </virtualmachine>
                            <!-- VM3 = Exchange Server -->
                            <virtualmachine
                                name="VM3"
                                type="ESX"
                                host="my-esx-server"
                                file="[my-esx-server-iSCSI01] VM3/VM3.vmx"
                                username="my-esx-username"
                                password="my-esx-password">
                                <snapshots>
                                    <!-- name = * is reserved for current snapshot -->
                                    <snapshot name="BASE" username="domain1\administrator" password="mypassword" />
                                </snapshots>
                            </virtualmachine>
                        </dependencies>
                    </snapshot>
                </snapshots>
            </virtualmachine>
            <!-- VM5 = client desktopn - dependent on VM1 to VM4 -->
            <virtualmachine
                name="VM5"
                type="ESX"
                host="my-esx-server" 
                file="[my-esx-server-iSCSI01] VM5/VM5.vmx"
                username="my-esx-username"
                password="my-esx-password"
                powerDelay="10">
                <snapshots>
                    <snapshot name="BASE" username="domain1\administrator" password="mypassword">
                        <dependencies>
                            <!-- dependent virtual machine with one snapshot that needs to be up -->
                            <!-- VM1 = Domain Controller -->
                            <virtualmachine
                                name="VM1"
                                type="ESX"
                                host="my-esx-server"
                                file="[my-esx-server-iSCSI01] VM1/VM1.vmx"
                                username="my-esx-username"
                                password="my-esx-password">
                                <snapshots>
                                    <!-- name = * is reserved for current snapshot -->
                                    <snapshot name="BASE" username="domain1\administrator" password="mypassword" />
                                </snapshots>
                            </virtualmachine>
                            <!-- VM2 = SQL Server -->
                            <virtualmachine
                                name="VM2"
                                type="ESX"
                                host="my-esx-server"
                                file="[my-esx-server-iSCSI01] VM2/VM2.vmx"
                                username="my-esx-username"
                                password="my-esx-password">
                                <snapshots>
                                    <!-- name = * is reserved for current snapshot -->
                                    <snapshot name="BASE" username="domain1\administrator" password="mypassword" />
                                </snapshots>
                            </virtualmachine>
                            <!-- VM3 = Exchange Server -->
                            <virtualmachine
                                name="VM3"
                                type="ESX"
                                host="my-esx-server"
                                file="[my-esx-server-iSCSI01] VM3/VM3.vmx"
                                username="my-esx-username"
                                password="my-esx-password">
                                <snapshots>
                                    <!-- name = * is reserved for current snapshot -->
                                    <snapshot name="BASE" username="domain1\administrator" password="mypassword" />
                                </snapshots>
                            </virtualmachine>
                            <!-- VM4 = Application Server -->
                            <virtualmachine
                                name="VM4"
                                type="ESX"
                                host="my-esx-server"
                                file="[my-esx-server-iSCSI01] VM4/VM4.vmx"
                                username="my-esx-username"
                                password="my-esx-password">
                                <snapshots>
                                    <!-- name = * is reserved for current snapshot -->
                                    <snapshot name="BASE" username="domain1\administrator" password="mypassword" />
                                </snapshots>
                            </virtualmachine>
                        </dependencies>
                    </snapshot>
                </snapshots>
            </virtualmachine>
        </virtualmachines>
    </RemoteInstallConfig>
</configuration>
Jan 3, 2012 at 1:02 PM

So you have two sets of dependent VMs. Why not run RI twice, first for the first set, 1-3, then 4-5?

Jan 3, 2012 at 1:51 PM

Hi dblock

I could do that, run RI twice for both sets of VMs, I'll give that a go shortly and see what happens.  Can I intergrate the results of the two RI runs into a single CruiseControl test report?

Ideally, I'd like to perform this in a single run of RI (if possible).  I'd like to start all of the VMs, but only run the server and client installers on their respective machines (vm4 and vm5). Once the installers have installed the client and server applications, my next step would be to run a simple test to ensure the client can communicate with the server. 

Once the test is successful, I can revert the VMs to their snapshots and wait for the cycle to repeat.

David

Jan 3, 2012 at 3:04 PM

Yes you can. Ri supports /appendOutput+ which you can use and send output to the same XML file. 

Frankly, running RI once or twice makes no difference. In my experience large RI configurations become quickly unruly.