How To: Bulk upgrade VM hardware to v7

Posted: April 6, 2011 in How-to, VMware

The following scripts were written to bulk upgrade VMware virtual machines’ hardware from v4 to v7.

After the upgrade of a specific virtual machine, the first NIC adapter is also changed to use the new VMXNET3 adapter. And finally some of the changes are done to the virtual machine configuration to gain maximum performance (disable VM logging, set unlimited CPU and memory reservations)

Download the script collection from here.

The script collection includes three scripts.

1) – (Normal Perl script) The main script. This coordinates other sub-scripts, catches the errors from the sub-scripts and throw to STDOUT. The script ‘forks’ 10 child processes to do 10 vm upgrades parallelly which greatly reduce the time to finish the full upgrade process.
2) – (vSphere Perl SDK script) A sub-script which creates the list of UUIDs
3) – (vSphere Perl SDK script) A sub-script which actually does the job. All upgrade related processes happen here. is written to talk to vCenter and make a UUID list for vms under specific folder. Go through the main configuration parameters in script and make the necessary changes first. And finally run

############# User configurable variables ####

# vCenter server
my $v_auth_server = ‘<your_vcenter_host>’;
# Username
my $v_auth_username = ‘<vcenter_username>’;
# Password
my $v_auth_passwd = ‘<user_password>’;
# Under which directory the scripts located
my $v_script_base = ‘”<where_are_this_script_located>”‘;
# Under which directory you want to have logs
my $v_log_base = ‘”<where_you_want_to_have_logs>”‘;
# Under which folder your vms located
my $v_manager_args_folder = ‘<vcenter_folder>’;

Acknowledgment: Some of the sub-routines were originally written by William Lam.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s