PowerCLI script to migrate clusters to new vCenter

Written April 30th, 2014 by
Categories: Scripts, Virtualization

Hey scripters! I recently had a task of migrating an entire virtual datacenter from one vCenter to another. It sounds like a pretty simple task, but manually recreating the cluster(s) could cause some human errors. I decided to write a script that would look at a specific vDatacenter and get all it’s clusters, then recreate that tree in the new vCenter. It’s pretty simple, really, it pulls all the clusters, then creates new clusters with the same attributes. When moving over the hosts, it first disconnects them from the original vCenter, then removes them from inventory.

I thought about disabling HA & DRS on the source vCenter cluster right before hand, but manually disconnecting & removing shouldn’t be an issue. If you add the host to the new vCenter without first removing from the old vCenter, that’s when you’ll get some HA weirdness because the old vCenter doesn’t know what just happened.

What does it do?

Read the rest of this entry »

Reader Request: Scripted VM Conversion to Thick from input CSV file using PowerShell PowerCLI

Written August 14th, 2013 by
Categories: Scripts, Virtualization
No Comments »

A few days ago I received a comment on This Post requesting a custom script to take a list of VMs from a file and convert them to thick. I quickly slapped something together and sent it to him for testing.

**REMEMBER** When converting thin to thick (or vice versa), you have to actually migrate the VM to a different datastore.

I’m posting this because it can be coupled with another post I have about Exporting VMs with Thin Disks to a CSV file, which would work perfectly for this. Run this one first to get a CSV with all your thin provisioned VMs.

In the Export Thin script, you will need to change the VM header in the CSV file to Name, since that’s what the migrate script looks for (or change the migrate script, up to you), add in a Destination header for the destination datastore in the CSV file after it’s exported. You could then plan it all out so your VMs are moved to specific datastores. Read the rest of this entry »

VMware Site Recovery Manager 5.1 Connection & Session Limits – Updated

SRM Connection or Session Limit Reached
***Scroll down for the Update***

Have you ran into one of these errors before:

     [exec] AxisFault
     [exec]  faultCode: ServerFaultCode
     [exec]  faultSubcode: 
     [exec]  faultString: fault.drextapi.fault.ConnectionLimitReached.summary
     [exec]  faultActor: 
     [exec]  faultNode: 
     [exec]  faultDetail: 
     [exec]     {urn:srm0}SrmFaultConnectionLimitReachedFault:<connectionlimit>10</connectionlimit>
     [exec] fault.drextapi.fault.ConnectionLimitReached.summary


     [exec] AxisFault
     [exec]  faultCode: ServerFaultCode
     [exec]  faultSubcode: 
     [exec]  faultString: dr.fault.SessionLimitExceeded
     [exec]  faultActor: 
     [exec]  faultNode: 
     [exec]  faultDetail: 
     [exec] 	{urn:srm0}MethodFaultFault:<vim25:reason>Invalid fault</vim25:reason>
     [exec] dr.fault.SessionLimitExceeded
     [exec] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     [exec] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(
     [exec] 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(

Or in the GUI:Lost connection to remote SRM server. Unable to login. The maximum number of SRM users has been reached.RJ, from, & I had been plagued by these messages for weeks, maybe even months. Well, we finally got it all figured out!

Keep reading for the fix!

Read the rest of this entry »

VMware Site Recovery Manager & Active Directory – Part 2 – Domain Controllers in test environment

On May 25th, I published this post covering some scenarios on how to use Site Recovery Manager & Active Directory.  Michael White from VMware responded with some good info.  He had an awesome suggestion of using a script to cold clone a DC daily to use for testing.

Let’s take a look at some ways we can get this done:
Read the rest of this entry »

VMware Site Recovery Manager & Active Directory – Part 1 – Testing Recovery Plans with Active Directory

To include Active Directory or not to include Active Directory, that is the question.

I’ve been reading a lot around VMware’s Site Recovery Manager and considerations surrounding Active Directory. Most of what you will read says ‘NEVER’ protect AD with SRM, only use native AD replication, especially since SRM & vCenter at your Recovery Site require AD to be running anyway.

But what if you have multiple domains for different uses? This is where the lines become blurred. Think about this for a second:

  • One AD environment (single forest/domain, no trusts) where vCenter & SRM live, call it infrastructure AD
  • A second AD environment (also single forest/domain, no trusts) for your application servers, call it application AD
  • You have infrastructure AD at both sites, SRM & vCenter authenticate accordingly
  • Protected site has application AD
  • Recovery site has nothing

Now here is where I say ‘why wouldn’t you protect AD with SRM?’  In a true disaster, the protected site is gone, no AD exists anywhere, so using SRM to bring them up on the recovery site makes sense. Is my logic flawed?

However, if I had my application AD living at both sites, using native replication, I agree 100% in not including your Domain Controllers in your SRM Recovery Plan. This leads to my concern…

Testing vs Planned vs Unplanned

This post will cover testing only. I’ll write a follow-up covering planned & unplanned failovers later.

To me, the only way to really test your DR plan (in this instance, your SRM Recovery Plan) is to not have anything different between them.
Read the rest of this entry »

How often should I conduct a disaster recovery test? – contribution

Written April 23rd, 2013 by
Categories: Server Management, Virtualization

I recently became a contributor on by answering the common question: How often should I conduct a disaster recovery test?

Feel free to swing on over to and read what I have to say, here’s a link:

Thanks, and happy scripting!

Site Recovery Manager 5.1 installation fails connecting to database – dbmanager could not initialize vdb connection

Written March 29th, 2013 by
Categories: Virtualization

I recently ran into an issue when installing SRM and thought I’d share. I didn’t get a screenshot, but the error was something like this:

Failed to Initialize – dbmanager could not initialize vdb connection – odbc error

If you click skip from there, it’ll fail to create the tables, and eventually get to the point where you’ll have to roll back.

As it turns out, it was due to a c0mp73x”P@s$w0rd! that caused the problem. I’m not sure what characters killed it, but going to a less complex pAs5w0rd worked fine. ODBC worked fine, user & permissions were set up properly, it just came down to SRM not being able to handle the special characters. What’s strange is a similarly complex password works for vCenter.

Hope this helps, have fun out there!

vMotion fails at 10% with error 0xbad010d on VMware ESXi

Written February 14th, 2013 by
Categories: Virtualization
No Comments »

I recently had this problem, but forgot to take a screenshot for the blog, sorry guys.

I was patching an HA/DRS cluster using VUM and none of the VMs would migrate off one specific host. The error it gave was “A general system error occured: Failed to start migration pre-copy Error 0xbad010d. The Esx host failed connect over the VMotion network”.

Read the rest of this entry »

Scripting it old school! Bash shell script to apply ESX 3.5 Update 5a

Written December 14th, 2012 by
Categories: Scripts, Virtualization
No Comments »

So you’re still using ESX 3.5 and need to patch it manually? Bummer, I know, I’m in that boat right now, or was.  I ran “esxupdate -a query” to find out the latest patch and saw, “ESX Server 3.5.0 Update 4”.  Then went to VMware’s downloads site to download Update 5a, and when it prompted me to download all dependencies, I did.

What did that give me? Nineteen (19) bundles/depots/zip files, one of which was ‘’ Read the rest of this entry »

vShield Manager Upgrade Bundle errors with Invalid File – Misnamed at download

Written September 14th, 2012 by
Categories: Virtualization

While upgrading my vShield Manager to 5.1, I ran into a little issue, it told me the file was invalid.  I know it’s not, I checked the md5sum and it’s right, how dare you tell me it’s wrong, BAH! :-P

The file name listed on VMware’s site is correct:

But when it downloads, it’s named incorrectly:

Just rename it to .tar.gz and you’ll be good to go!

Happy upgrading!

Designed by ThepHuck
Wordpress Themes
Scroll to Top