1 2 Previous Next 18 Replies Latest reply on Aug 7, 2012 10:25 AM by Bill Robinson

    How to use blcli to provision a server



      Does anybody know which commands, parameters and order should I follow in order to execute a server provision ?


      Thanks in advance.



        • 1. Re: How to use blcli to provision a server

          Look at Provision provisionDevice in the blcli help. You need to create a properties sheet and then specify its location.

          1 of 1 people found this helpful
          • 2. Re: How to use blcli to provision a server

            [This post has been created by Rodrigo.  He is provisioning servers via BAO]

            • 3. Re: How to use blcli to provision a server
              Alan Weston

              I'm also curious to see an example of how this works using blcli. I tried to set something up using the examples in the blcli documentation, butI get the following error:


              blcli  Provision reProvisionDevice 4139-1 00-50-56-95-50-6E 8 file:///c:/propfile.txt
              Unknown command : name space = 'Provision', command = 'reProvisionDevice'.com.bladelogic.cli.factory.CommandNotFoundException: Found
              command 'Provision.reProvisionDevice' but with mismatching arguments.


              What does the mismatching arguments message indicate?


              According to the docs Provision reProvisionDevice takes the following parameters: systemPackageId macAddress aclTemplateID propsFileURL. I think I have the right parameters here, but it doesn't like the format.


              With BL8 I'm wondering if this changed? Since provisioning jobs now require a path for storing the resultant job, shouldn't this be an additional parameter?

              • 4. Re: How to use blcli to provision a server

                I think your first parameter passed to the blcli is wrong.


                I don't remember seeing a systempackageid with that kind of value, not sure though..


                Can you use the blcli "blcli SystemPackage listSystemPackageFolderContents 1000006" to check your system package id ??

                • 5. Re: How to use blcli to provision a server
                  Alan Weston

                  Thanks....I had the incorrect systempackageid because I was trying to get it using "Provision listSystemPackages" rather than "SystemPackage listSystemPackageFolderContents." It should have been 4139, not 4139-1.


                  Here's what I'm getting now:


                  SYSPKG_GROUP=`blcli SystemPackageGroup groupNameToId "/PROD - Depot/System Packages/Windows/Windows 2008/x32/VM"`

                  blcli SystemPackage listSystemPackageFolderContents $SYSPKG_GROUP

                  sp, WIndows 2008 Enterprise SP1 x32, 2759
                  sp, Windows 2008 Standard SP1 x32, 2760
                  sp, Windows 2008 Standard SP2 x86, 4139


                  Now I can get a little further running:

                  blcli  Provision reProvisionDevice 4139 00-50-56-95-50-6E 8 file:///c:/propfile.txt


                  I'm getting a CLI Error: Failed to get command. Caused by : null


                  Trying to figure out this error now.

                  • 6. Re: How to use blcli to provision a server

                    Two suggestions:


                    1. The systemPackageId (in your case, you've set 4139) looks awfully low.The "listSystemPackageFolderContents" call returns a folderID, not a systemPackageID. Try leveraging the "listSystemPackages" command under the "Provision" namespace feeding in the return value you get from the "listSystemPackageFolderContents" call. This should give you a usable systemPackageID.
                    2. Until you get it behaving, you may want to consider using "0" as the AclTemplateID (instead of 8). It'll help you eliminate it as a potential source of the problem.



                    Hope this helps.



                    • 7. Re: How to use blcli to provision a server

                      I'm seeing this same issue:


                      BL-OPMAN% blcli Provision reProvisionDevice 19 00-0C-29-FD-A3-AA 0 file:///c:/propfile.txt

                      CLI Error : Failed to get command. Caused by : null


                      It seems my System Package IDs that I'm getting are also really low:


                      BL-OPMAN% blcli Provision listSystemPackages 2000100

                      [Id = DBKey:SSystemPackageKeyImpl:1-1;Name = RHAS5;Desc = , Id = DBKey:SSystemPackageKeyImpl:4-1;Name = Windows 2k8;Desc = , Id = DBKey:SSystemPackageKeyImpl:12-1;Name = Windows 2k3;Desc = , Id = DBKey:SSystemPackageKeyImpl:19-1;Name = RH5;Desc = ]



                      BL-OPMAN% blcli SystemPackage listSystemPackageFolderContents 2000100
                      sp, RHAS5, 1
                      sp, Windows 2k8, 4
                      sp, Windows 2k3, 12
                      sp, RH5, 19


                      Do I have the right SP ID's?  Also does anyone have an example propfile.txt file?


                      Another question - if this re-provision kicks off, where is the name of the job specified, and where will the job get created?

                      • 8. Re: How to use blcli to provision a server

                        It turns out that was the correct System Package ID.  The issue was with my propfile.txt.  The BLCLI documentation doesn't refer to setting a JOB_FOLDER_ID or JOB_NAME in the Provision:reProvisionDevice API notes (hence my question about where these get set).  Here's what I ended up using in the file:




                        Note: The above assumes you have a Local Property defined in your System Package called HOSTNAME, and you have referenced it in the Computer Name field.

                        1 of 1 people found this helpful
                        • 9. Re: How to use blcli to provision a server
                          Valerian Jone

                          So I'm now trying to fill in the properties file to provision a server through blcli as well. Is there any documentation that specifies how to specify everything in the properties file so that we can customize the provisioning job? Basically anything that is presented in the provisioning wizard when creating a provisioning job, is there documentation on how to specify that in a properties file?


                          Just to start off, I'm having difficulties setting the server name (hostname). I tried Greg's line:




                          and this line as well:




                          but neither seems to work.


                          This is BL 8.0 SP1 on Windows 2008.

                          • 10. Re: How to use blcli to provision a server
                            Valerian Jone

                            Nevermind, I just understood what I have to do. I have to create properties on the system package and then reference them ala ??PROP?? in all the fields in the system package. duh, sorry for the spam.

                            • 11. Re: How to use blcli to provision a server

                              Hahah. Wow. I was looking up the command to reference for you, I didn't realize I posted the same answer to this same forum post earlier this year. Your Properties sheet references the properties names you see on the properties tab of your system package. you point the fields of the system package to those properties.

                              • 12. Re: How to use blcli to provision a server

                                Hey Valerian,


                                I have a few threads on this subject in the forums, dating back to 2008.  I generate these entries via a web app, and then I kick off 'Provision provisionDevice' to run the provisioning job.


                                Using a web app is very powerful, because it gives you the flexibility of scaling BladeLogic sideways.  Lots and lots and lots of app servers, geographically distributed.




                                [johnv@bladelogicappserver99]# cat 00-1A-64-AE-38-F6.provision
                                SystemPackage.LocalProperty.DATA_STORE=Class://SystemObject/DataStore/Pxe DataStore/San Francisco (sfo1234567)

                                • 13. Re: How to use blcli to provision a server
                                  S Crawford

                                  We ran into the same error and then found out we had to add the JOB_FOLDER_ID and JOB_NAME properties to the input file.  The first time we ran this it was fine but now when we try to run it again we get this:





                                  Info Mar 3, 2011 8:48:15 AM DEBUG: com.bladelogic.mfw.util.BlException: An instance named 'AIX_6.1_TL05' already exists in class Class://SystemObject/Server/PROVSERVER


                                  It sounds like the JOB_NAME needs to be different everytime we run the provisioning job.  Is this really true?

                                  • 14. Re: How to use blcli to provision a server
                                    Aryan Anantwar



                                    yes. its necessary to change Job.Provision.JOB_NAME=value.  everytime.


                                    beacuse the blcli command to provision system creates new provision job with the name specified in properties file.


                                    thats why u have seen the eeror that


                                    An instance named 'AIX_6.1_TL05' already exists






                                    Dnyaneshwar Anantwar.

                                    1 2 Previous Next