DavideD
Enthusiast
Enthusiast

How to change vmx entries from script

I'm working on a little Disaster Recovery project. You can view the VMware environment in this picture:

(also attached to this post)

Vdisk0 and Vdisk1 are mirrored by Symantec Volume Manager.

To have the DR procedure working, I need to:

1) copy vmx files from Storage_A to Storage_B. I have a shell script to do this.

2) Remove any reference to scsi0:0 into the vmx file and rename scsi0:1 to sc0:0, in order to boot the VM from

alternate disk.

3) Unregister VM from ESX_1 server. I have a script

4) Register VM to ESX_2 server. I have a script.

My dubts are about the point 2). Which lines refeencing scsi0:0 can I securely remove from vmx ?

Are there any available scripts to do this ? I've tried with sed command but have some trouble.

Thanks in advance

regards

Davide Depaoli

Skype: davide_depaoli - Linkedin: http://it.linkedin.com/in/davidedepaoli
0 Kudos
2 Replies
Ken_Cline
Champion
Champion

2) Remove any reference to scsi0:0 into the vmx file and rename scsi0:1 to sc0:0, in order to boot the VM from alternate disk.

I assume you meant rename scsi0:1 to scsi0:0...

The sed commands you could use are:

s/scsi0:0/#scsi0:DR/g

s/scsi0:1/scsi0:0/g

You need to change the existing scsi0:0 to something else (in this case, I just commented out the line & changed it to scsi0:DR - something you could find later to change it back:

s/scsi0:0/scsi0:1/g

s/#scsi0:DR/scsi0:0/g

Ken Cline

Technical Director, Virtualization

Wells Landers

TVAR Solutions, A Wells Landers Group Company

VMware Communities User Moderator

Ken Cline VMware vExpert 2009 VMware Communities User Moderator Blogging at: http://KensVirtualReality.wordpress.com/
0 Kudos
DavideD
Enthusiast
Enthusiast

Thank you very much, Ken.

regards

Davide

Skype: davide_depaoli - Linkedin: http://it.linkedin.com/in/davidedepaoli
0 Kudos