4

I am interested in deploying several RHEL 4 Update 8 virtual machines for creation of a test environment.

Here are the steps I am taking:

  • In off hours, P2V/V2V the production machines and convert them to templates
  • Deploy the virtual machines with a customization specification that changes hostname, IP address

I am interested in how these processes are done and if there are any options for further customization.

  • Are the machines brought on the network when they are powered on, before they are reconfigured? Is there a potential IP address conflict?

  • Is there an option to run additional scripts which reside on the guest as a part of the reconfiguration? For example, restoring an Oracle Database. This is an option with Windows guests and sysprep, but I have been unable to locate anything showing a RHEL equivalent.

I am dealing with a multi tier application. The main issue I am attempting to mitigate is that the application servers reference database servers by hostname and in tnsnames files. I am interested in scripting the reconfiguration of the application in the deployment so that the app/db servers are pointing to the test environment.

I am OK with placing the 'cleanup' script on the source and executing it after the machine has been brought up. I am interested in the automation of the script's execution post clone/boot, as well as if there could be an IP address conflict.

(cross posted to VMTN's ESX 4 community)

andyhky
  • 2,652
  • 1
  • 25
  • 26

1 Answers1

1

My experience is mostly with Windows, but the process is pretty much the same:

Are the machines brought on the network when they are powered on, before they are reconfigured?

The machines are powered on, and the setup scripts to change the configuration are run before the network and rest of the system is brought online. The machine then reboots if required, and the 2nd time around it boots fully, with the new configuration.

Is there a potential IP address conflict?

Regarding the network and duplicate IP addresses, you should be safe, however if you're really concerned, create a 2nd network and don't bind any NICs to it. After the customisation wizard you can choose not to boot the machine immediately. If you make sure it doesn't boot, you then have the option of changing the network the VM is attached to to the dummy network. After you've booted it up and the configuration script has run, double-check the IP settings of the network to make sure they're not conflicting (you'll have to do the check manually, of course) and then just flick the network over to the live network.

Is there an option to run additional scripts which reside on the guest as a part of the reconfiguration?

Can't help with this one I'm afraid.

Mark Henderson
  • 68,316
  • 31
  • 175
  • 255
  • 1
    This is correct but one detail to point out is that the in-OS work is done by vmware-tools so that needs to be working before you start. I don't see an option in the GUI but there is an API call documented in the VIX API (libraries available for perl and PowerShell) that can run a remote command through vmware-tools. – mtinberg Jul 19 '10 at 20:00
  • @mtinberg : This led me in the right direction and I've found Invoke-VMScript which will help me get what I need done. – andyhky Jul 25 '10 at 20:10