Hi,
I'm automating some storage testing involving an ESXi 5 cluster, vCenter, and an iSCSI storage array. At the end of each test run, the ESXi cluster and the storage array are fairly messy -- tons of datastores, VMs, snapshots, etc, all as a result of the testing.
When I want to start the round of tests again, I'd like to be able to restore the systems (both ESX and the storage array) to a pristine state. I can handle that on the array -- I can wipe it out and get it back into it's "pre-test state" fairly easily. But I'm struggling with figuring out the best sequence of steps on how to properly clean the ESXi host(s) and vCenter. The pre-test state also has the IP addresses of the iSCSI targets & CHAP already configured on the hosts, but no datastores there yet. I'd like to be able to 'reset' back into that state.
I'd like to avoid retracing my steps one-by-one-- i.e. I don't want to remove each datastore sequentially, though I suppose I could do that if there is no other option.
What I'd like to do, is have some sort of reliable "reset/wipe" procedure that will restore the ESXi cluster (2 hosts) and vCenter such that all the datastores are gone. Not present and greyed out, but gone as-if-they-were-never-there.
Bonus: I'm using vijava for most of the testing, and would love to be able to reset/wipe the cluster via java, but I'm open to other ways....
The things I've tried so far ended up with the ESX hosts getting upset that the datastores were no longer reachable, etc. Tons of timeouts, greyed-out datastores, etc.