SRM: Bulk IP Customization Part 1 – Create the Customization File

After a few Site Recovery Manager installations I’m seeing that the planning for a deployment is not only infinitely more challenging than the relatively easy installation but is also the most overlooked.  I imagine many of us would concur that this behavior is not unique in the industry, it just so happens that my passion is disaster recovery and working with Site Recovery Manager.

More to the point, we’re talking about modifying network properties in a virtual machine during execution of a Recovery Plan.  We’re talking about modifying networking because it’s just one of the impacts of a design decision (or lack thereof) in disaster recovery planning.  The unique component of Site Recovery Manager is that it allows the potential to test recovery planning without disrupting a production environment.  The keyword I add in there that VMware doesn’t is “potential”, and that’s a whole different rant^H^H^H^H blog post…or maybe there’s a book in that somewhere.

Even more to the point, I hope.  One method of designing for site recovery is to reassign IP addresses and deploy a new DNS zone.  This frees the network administrator to do whatever else s/he sees as more important that DR.  Please don’t get the impression that this method of recovery is undesirable, it’s just one method of reaching the desired result.  I’d never do it by choice, there’s a book in that one too.

VMware has recognized the need and initially allowed the administrator to use the familiar concept of Customization Specifications to change the IP address.  The problem was that this method required a Customization Specification to be created for each virtual machine.  If I have my facts correctly it was with 1.0 U1 that VMware released a tool for bulk customization of virtual machines, the tool is ‘dr-ip-customizer.exe’ and is located in the bin sub-directory of the Site Recovery Manager program installation path.  I’d love to say that this tool is one of the most amazing things I’ve seen, but I won’t.  Where was that point again?  Right, I’m in it, hang in there.  The tools allows for the exporting of a list of currently running virtual machines and import data in the form of a CSV file with the required networking information.

To get the process started ‘dr-ip-customizer.exe’ must be run from the recovery site SRM server, this will produce a CSV for you to work with.  Please note here that this is one item that is incorrect in the SRM Administrators Guide, this must be performed from the recovery site server.

Execute the script with the generate command to produce your output file, demonstrated below as “c:tmpexample.csv”.

‘cd C:Program FilesVMwareVMware vCenter Site Recovery Managerbin’

‘dr-ip-customizer.exe -cfg ..configvmware-dr.xml -csv c:tmpexample.csv -cmd generate’

Output will look a lot like the following, including the column names.  The third column list an adapter ID for each virtual machine, this ID will always be 0 and does not refer to the first NIC ID but to global IP properties that are not specific to any adapter.  The first NIC would be identified as ID 1 but that information is not provided.

VM ID,VM Name,Adapter ID,MAC Address,DNS Domain,Net BIOS,Primary WINS,Secondary WINS,IP Address,Subnet Mask,Gateway(s),DNS Server(s),DNS Suffix(es)
shadow-vm-22797,myvmp001,0,,,,,,,,,,
shadow-vm-22798,myvmp002,0,,,,,,,,,,
shadow-vm-22800,myvmp003,0,,,,,,,,,,
shadow-vm-22801,myvmp004,0,,,,,,,,,,
shadow-vm-8342,myvmp005,0,,,,,,,,,,
shadow-vm-8343,myvmp006,0,,,,,,,,,,

This output will not be represented in blog output very well, I’m going to do my best to get real files attached in here but wish to just get this post complete.

There are a few things to know when starting to edit this document.

  • The first column is an ID for the virtual machine assigned by SRM and cannot be changed
  • The VM Name column is for reference only, changes will be ignored
  • Each line modifies one or more properties of a network property
  • The only fields for adapter ID 0 that may be modified are DNS Server(s) and DNS Suffix(es).  These fields, if populated, will be inherited by any following adapters.
  • No field may contain a comma (it is a CSV file after all…)
  • Additional lines for the same adapter ID may be added to supply additional properties.  DNS Server(s) is the primary usage for additional adapter ID.

Some Linux specific things, none of which are in the admin guide.

  • DNS Suffix(es) can only be set on adapter ID 0
    • Guessing that means it’s DNS Suffix, singular
  • Linux vms cannot set a DNS Domain on a non-zero adapter
  • Linux vms cannot specify a DNS Server on a non-zero adapter
    • Again, single DNS Server only for a Linux vm?

To update the adapter in the first virtual PCI slot for the vm myvmpoo1 we would need to add a line and insert some basic information.

VM ID,VM Name,Adapter ID,MAC Address,DNS Domain,Net BIOS,Primary WINS,Secondary WINS,IP Address,Subnet Mask,Gateway(s),DNS Server(s),DNS Suffix(es)
shadow-vm-22797,myvmp001,0,,,,,,,,10.8.8.10,ipcustomizer.lan,
shadow-vm-22797,myvmp001,0,,,,,10.8.8.101,255.255.255.0,10.8.8.1,,,

To take the same example one step further, let’s get that second DNS Server in place

VM ID,VM Name,Adapter ID,MAC Address,DNS Domain,Net BIOS,Primary WINS,Secondary WINS,IP Address,Subnet Mask,Gateway(s),DNS Server(s),DNS Suffix(es)
shadow-vm-22797,myvmp001,0,,,,,,,,10.8.8.10,ipcustomizer.lan,
shadow-vm-22797,myvmp001,0,,,,,10.8.8.101,255.255.255.0,10.8.8.1,,,
shadow-vm-22797,myvmp001,0,,,,,,,,,10.8.9.10,

You’ll spend days putting this file together so I’ll just leave you to it for now.  Next we’ll put together a slightly more complex customization file, work through the creation, recreation and dropping of the customization specs on the SRM Server follow by a review of what’s really going on behind the scenes with the vStorage API.