1

I am setting a two guests one DEV and one TEST, what i want to do is each month have a script run that will clone(Copy) the DEV guest over top the TEST guest replacing the TEST Guest. I will need it to change the server name, the ip address and the MAC address ( the MAC needs to stay the same as the old TEST guest).

Can this be done and how would I go about doing this? I am new to scripting so I need a little help.

Thanks!!

3 Answers3

1

You could do this with GhettoVCB. Look at the section about cron, and just set it to monthly rather than nightly.

Dentrasi
  • 3,672
  • 23
  • 19
  • Unless I'm missing something at that link, it will not do any of what the OP asked for. GhettoVCB does the same thing as VCB - takes snapshots and backs-up the snapshots. It does not make copies, let alone do deployments. Again, unless I missed something after a quick perusal of the Features list and some text-searching. – mfinni Feb 15 '10 at 19:57
0

Quick question - are you sure that you want this automated? What if someone had something important running against the TEST instance when the automated job blows it away?

Aside from that, I don't have a direct answer for you. My first stab at an outline would be to 1. Make a Template from the DEV instance, probably with a fixed name, overwriting the existing one in subsequent runs 2. Make a new machine for TEST, overwriting the existing one, from the Template from the previous step. 3. Set the IP and name of the TEST machine as desired.

If you have Windows in your environment, you could write this in PowerShell using PowerCLI, and run it as a scheduled task. This FAQ has details on some of these steps that you could use to build this script.

mfinni
  • 35,711
  • 3
  • 50
  • 86
0

Did you mention which virtual environment you're using here? Everyone's assuming VMWare so....

You should be able to achieve this with the VirtualCenter/vSphere Convertor plugin. It has options for scheduling and re-occuring conversion jobs, and you can specify both the source and the target as the same VirtualCenter or ESX host.

You'll need to enable guest customization on your vCenter, and you can set up a scheduled task in vCenter to delete the Test VM a few hours before the conversion job is due to run.

Edit: hmm, no delete vm option in ESX scheduled tasks. Bugger. Could look at doing this from the console with vmware-cmd.

Chris Thorpe
  • 9,903
  • 22
  • 32