3 Replies Latest reply on Jun 21, 2019 6:27 AM by drfooser

    Optimize-VMwarePKS: A PowerShell Script for All Your VMware PKS Deployment Needs

    daphnissov Guru
    Community WarriorsvExpert

      Glad to kick this community off with a helpful PowerShell script designed to assist PKS customers by providing organization of their deployments in their vSphere environment with ease.

       

      Optimize-VMwarePKS: A PowerShell Script for All Your VMware PKS Deployment Needs

        • 1. Re: Optimize-VMwarePKS: A PowerShell Script for All Your VMware PKS Deployment Needs
          drfooser Lurker

          Hello Daphnissov,

          My team has deployed Pivotal Container Service/BOSH over VMware and could really use this script. I am a little hesitant though since it looks as if it runs against every SDDC in the vCenter.

          Is there a way to limit the scope of the script to run against a single SDDC?

           

          Since our PKS lab SDDC is on the same vCenter as our production environment I'm also interested in connecting with anyone who can speak to the risks, if any, of running the script.

          • 2. Re: Optimize-VMwarePKS: A PowerShell Script for All Your VMware PKS Deployment Needs
            daphnissov Guru
            Community WarriorsvExpert

            Hello drfooser

            When you say

             

            Is there a way to limit the scope of the script to run against a single SDDC?

            are you talking about limiting the scope to a Datacenter object within vCenter? I gather you have two separate Enterprise PKS installations pointed to the same vCenter but under different datacenter objects. If that's the case, I could take this as a feature enhancement to add to my backlog. Alternatively, you're welcome to clone my repo and submit a pull request.

             

            As to the safety of running this, it is in use by many different customers at this point (including VMware and Pivotal internally) and I have not heard of a single issue thus far. This script makes no alterations to VMs themselves other than setting tags (if you request it to do so). As far as removal of items, it only does this on parent objects which you define and doesn't scour your vCenter to remove anything else. Again, that functionality is entirely optional and can be enabled on a per item basis. Lastly and obviously, the code is available for review on my repo as linked above, so you are welcome to inspect every last line. Alternatively, you could bring up one of the two (at this time of writing) PKS Hands-On-Labs and paste in the code to run it in their sandboxed environment first. There you can play with the various switches to determine its efficacy and safety.

            1 person found this helpful
            • 3. Re: Optimize-VMwarePKS: A PowerShell Script for All Your VMware PKS Deployment Needs
              drfooser Lurker

              are you talking about limiting the scope to a Datacenter object within vCenter? I gather you have two separate Enterprise PKS installations pointed to the same vCenter but under different datacenter objects.

              I am indeed talking about limiting the scope to a single Datacenter object within vCenter. Our single vCenter deployment controls two Datacenter objects and each of those has a single vSAN/cluster of hosts. One datacenter/cluster is our production environment, the other is our lab environment. Since we are currently learnign and getting familiar with PKS/BOSH/K8S/Docker environment, that lab cluster is where our PKS deployment puts all our PKS clusters. Once we deploy another container environment in production we'll have a need to manage the twp environments separately and keep the vm's in different folders in vCenter.

               

              That said, I did test and run your excellent script with the "ProcessFolders" option against our vCenter - with perfect result. Thank you for your time and effort. I expect to test and run it soon using the other options.