7 Replies Latest reply on Feb 17, 2015 2:06 PM by Raja Mohan

    VGJ from VGP



      I've just created VGP. I have VGP in xml file.

      Next stage is VGJ, so there are two commands:


      Virtualization createVirtualGuestFromPackage "VGP.xml"

      Virtualization createVirtualGuest "VGP.xml"


      But where can I set such parameters:





              <VirtualGuestDestination>2000000 VMwareClusteromainc22</VirtualGuestDestination>





        • 1. Re: VGJ from VGP
          Raja Mohan

          hi Robert Dołęga you need to set those inside the VGP.XML file you are passing as parameter to create virtual guest cli

          • 2. Re: VGJ from VGP
            Steffen Kreis

            For your two highlighted fields this would be


                    Get the JobFolderID


            The get the ID for the Folder that the VGJ should be created in


            blcli JobGroup groupNameToId /myFolderInTheJobWorkspace



            blcli JobGroup groupNameToId "/Operating System Build/Virtual Guest Deployment"



            The result in this example would be : 2002800

            Get the VirtualGuestDestination


            First we need to get the VCenter ID

            blcli Virtualization listVirtualEntityManagers VMWareVirtualCenter



            blcli Virtualization listVirtualEntityManagers VMWareVirtualCenter



            2000900 is the Vcenter ID we are looking for

            • If the destination is a cluster, use VMwareCluster.
            • If the destination is an ESX host, use VMwareESXServer
            • If the destination is a resource pool, use VMwareResourcePool



            blcli Virtualization listVirtualEntitiesByEntityManagerServerIdAndEntityType [VCenterID] [VMwareResourcePool|VMwareCluster|VMwareESXServer]


            The Docs can be found here: https://docs.bmc.com/docs/display/bsa86/The+VGJ+file


            Let me know if you need more details on further fields.



            • 3. Re: Re: VGJ from VGP

              I am familiar with these command and I'm using them. I'm looking for command where as parameters I put:

              VGP.xml JobName JobFolderID VirtualGuestDestination ExecuteNow

              Something like:

              Virtualization createVGJ "VGP.xml" "win2k8_job_4" 2000100 "2000000 VMwareClusteromainc22" true


              Now I take the VGJ.xml from

              Sample VGJ XML files - BMC Server Automation 8.6 - BMC Documentation

              and I customize VirtualGuestPackage & VirtualGuestJob nodes by replacing strings. So I have to fight with xml validation part.

              • 4. Re: Re: VGJ from VGP
                Raja Mohan

                hi Robert Dołęga I am not sure I follow you completely, you will need a NSH script to take parameters and substitute them inside the script to the command.



                parm1 VGP.xml

                parm2 JobName

                parm3 JobFolderID

                parm4 VirtualGuestDestination

                parm5 ExecuteNow

                inside the script

                Virtualization createVGJ "$1" "$2" "$3" "$4" "$5"

                • 5. Re: Re: VGJ from VGP



                  More or less, but unfortunately there is no such blcli function as createVGJ.

                  I want to create a lot of VGJ base on one VGP which is base in VMware Template.

                  And in the middle of creation I just customize these jobs/packages.


                  I've created whole process using NSH script which manage pure XML (replace.merge etc) and it's works pretty well, but mentioned blcli function would simplify process/scripts.

                  • 6. Re: Re: VGJ from VGP
                    Raja Mohan

                    Robert Dołęga We dynamically build the XML using NSH scripts and then use it to create the VGJ.


                    Then execute the newly created VGJ to build the VM. Once the VM guest is built, we interrogate and find out the device then set them up for provisioning. In our current setup we go ahead do bare metal provisioning after the guest is created, since we wanted to keep our physical and virtual builds similar.

                    • 7. Re: Re: VGJ from VGP
                      Raja Mohan

                      by the way we do all this in a single script.


                      I found an undocumented command that will wait for the VGJ to complete. If you search the community I posted them when I had issue figuring it out, I posted the URL see if you can get to it.


                      Re: wait for a VGJ job