2011-11-06

New version of pseudo Lab Manager scripts (aka NLclonePodsofVapp.ps1)

[UPDATE NOTE: The work creating, providing and supporting scripts for ESX/ESXi/vCenter has been discontinued. Apologies for the inconvenience.]

I have done some improvements on usability and features based on my needs.

To see a video of the version 3 click here. Click here to read more information about these scripts.



CHANGELOG

------ version 4

  • Promiscuous Mode at the vSwitch level is now enabled automatically (this is needed if you have any ESX/ESXi in a VM).
  • The vSwitch has now 1016 Ports by default as opposed to the standard number which is 56.
  • The limitation of <15 characters for the common name for the Pods has been changed to <23 characters.


------ version 5

  • Program detects if VMs in source vApp are not in the same host (this is a requirement).
  • Ability to define the cluster as workspace.
  • Affinity rules are created for every Pod if DRS is enabled in the cluster (it it exists), independently of whether you select one/multiple hosts or a cluster.





EXAMPLES:

You can define the hosts it will work on manually
.\NLclonePodsofVapp.ps1 -source_vapp SRM-Parent-Pod -cloneName SRM-Test -endN 1 -startN 1 -hosts_list ("10.10.10.20","10.10.10.30")


You can define the hosts it will work on using the cluster the vApp is in
.\NLclonePodsofVapp.ps1 -source_vapp SRM-Parent-Pod -cloneName SRM-Test -endN 2 -startN 2 -use_cluster $true


Or you can just use the host the vApp is in (no need to specify anything)
.\NLclonePodsofVapp.ps1 -source_vapp SRM-Parent-Pod -cloneName SRM-Test -endN 3 -startN 3


You can create N Pods in these two ways (same result)
.\NLclonePodsofVapp.ps1 -source_vapp View-Parent-Pod -cloneName View-Test -endN 8
.\NLclonePodsofVapp.ps1 -source_vapp View-Parent-Pod -cloneName View-Test 8


If later on you want more Pods with the same root name you have to specify the starting point. This creates Pod09, Pod10,..., Pod15
.\NLclonePodsofVapp.ps1 -source_vapp View-Parent-Pod -cloneName View-Test -endN 15 -startN 9


If start and end is the same number, only one Pod with that number is created
.\NLclonePodsofVapp.ps1 -source_vapp VSA-Parent-Pod -cloneName VSA-Test -endN 7 -startN 7


The affinity rules are created automatically whenever it is possible. You don't need to request it.

This means now that if DRS is enabled, you can create multiple Pods that at power on will be distributed across the hosts by DRS and the affinity rules will keep the VMs in each Pod in the same host.



As VMware vCenter Lab Manager will not see further major releases, users have no option but to move to vCloud Director. But as Mike clearly says, vCD is not designed to be a replacement for Lab Manager. For those who see vCD as 'too big for what I need' this scripted solution comes handy.

10 comments:

  1. Hi Ruben, My question after reading your article on Snapshots was to delete a snapshot WITHOUT committing its contents to the parent. I wish to simply delete it completely. I am doing something along the same lines as you creating a lab environment but in my version it automatically creates a snapshot for each link clone. Doing so when I delete the snapshot it seems to commit the changes made in the link clone back to the parent. Or at least that what it seems. I want to simply delete one or all of the snapshots from a parent and leave the parent completely intact as it was before the snapshot was made. Doing it in power shell would be best.

    Tim

    ReplyDelete
  2. Tim,

    In VMware snapshot manager terminology:

    Delete = Commit snapshot
    Go to / Revert = Go back to a previous snapshot

    In PowerCLI, the "Go To" operation is illustrated in this link
    http://communities.vmware.com/message/1685805


    The Go To is always to an snapshot, so you need more than one taken to be able to move/revert. Once you are on the oldest snapshot (the first on the chain) you do 'Delete all' or 'Delete' to stop running on snapshots.

    I recommend you test this all with the vSphere Client until the concept gets clear, before trying to do the same with PowerCli.

    ReplyDelete
  3. Oh I see, so that is why you must create your initial snapshot. So when you create a snapshot of the clean machine. It is also clean. Then building from that snapshot you create your link clones with other snapshots. Reverting to the original snapshot (which is the same as the clean machine gives you the original again.)

    So If I were to delete this snapshot then since it contained nothing it commits nothing. So I imagine if I needed to make changes to the clean machine to redeploy I would have to revert or "goTo" to the clean snapshot. Then make my changes then create another clean snapshot then deploy again. Correct?

    ReplyDelete
  4. You can do the same thing in different ways.

    a) Commit, do changes, take snapshot.
    or
    b) Do changes, commit, take snapshot.

    -------
    There is something I am not sure if you have clear. You have a VM. You take an snapshot and make 30 linked clones from that VM. That VM has still ONE snapshot. You cannot "Go to" as there is only one.
    --------
    The snapshot is taken to ensure the VM doesn't write on the parent disk as it will be read by the linked-clones.

    At any time you can power on the Parent VM, the linked-clones won't know it, as it will be writing 'on the snapshot' that was taken before creating the clones.

    ReplyDelete
  5. Anonymous27 June, 2012

    Ruben, I love your blog content and know you're not a designer but could you please change your blog banner and title colour? It's awful! You have text overlaying other text and light green on white oh god it's like a 1998 geocities site.

    Much love.

    :)

    ReplyDelete
  6. Where can I find these scripts? I don't see links anywhere.

    ReplyDelete
  7. I removed the scripts from the web a few days ago.

    I am in the process of re-validating them with PowerCLI 5.5 and then I will make them accessible again.

    ReplyDelete
    Replies
    1. awesome Ruben. Could you please put a post here when you uploaded the new version? Thanks! Cant wait for it! :)

      Delete
    2. Hi there,

      How can I get in contact to get some customisation done on these scripts?
      Many thanks,
      Matt

      Delete
  8. Hi Matt,
    You can reach me on mr.ruben.garciaXX@gmail.com ( remove the XX )

    ReplyDelete