8 Replies Latest reply on Jan 27, 2016 11:16 AM by Daniel Suen

    Migrate package from Opsware to Bladelogic Server Automation

    Daniel Suen

      I need to quickly migrate a couple software packages from Opsware to Bladelogic. On the Opsware side, the package itself is a zip file, with some installation script that I can retrieved from the console. I am not sure if I am doing this correctly:


      1. Create a FILE object that points to this ZIP file (uploaded from the LOCAL computer),

      2. Create an empty BLPackage to import this FILE object,

      3. Create an external command, the content of which is the installation script from the Opsware side.


      The script itself is a bash script.


      Now the problem is, how do I know the working directory to unzip the zip file? If I want this directory to be depending on which type of host the software is to be deployed (linux, solaris, aix, ...), how do I do this? By default, what is the full path of the working directory if I don't specify where to unzip the file?


      I know that the alternative way would be to dissect the scripts to specify the end state of the installation in BLPackage, but given the logic to do all that is complicated in my case (the package may create LVM depending on some other factors), I would prefer stick closely to how it was run via Opsware as close as possible.


      Also, if the software package contains a bunch of zip files, and I will deploy different zip files based on the OS and architecture of the target machine, how is it implemented in BL?


      Am I on the right track in implementing this?



        • 1. Re: Migrate package from Opsware to Bladelogic Server Automation
          Bill Robinson

          what os are you deploying to here?  you say bash so i'm assuming unix ?


          why not just add the zip file and script into the blpacakge directly?  what's the point of creating the depot file ?


          you can put in whatever path you want for the zip location and i'm assuming your script can be altered to handle that ?


          for the different os handling, just put in a conditional check and use whatever zip you want in the install.

          • 2. Re: Migrate package from Opsware to Bladelogic Server Automation
            Daniel Suen

            We will deploy the package to all Unix variants. The package would contain a set of zip files, and Opsware has software policy to deploy a subset of zip files based on the OS/architecture.


            If I try to add the file in BLPackage by right-clicking on it, I don't see a way to pick a file local on my computer. That's why I created a depot file.


            For different OS/architecture handling, I put in conditions like TARGET.OS_PLATFORM = "x86_64", TARGET.OS_RELEASE =~ /el5/? How do I create such condition in the Client GUI? Where can I find out the syntax for these things?




            • 3. Re: Migrate package from Opsware to Bladelogic Server Automation
              Bill Robinson

              content for a blpackage needs to be added from a host w/ a rscd on it.


              there's a lot of different options here:


              1 - create a depot software object w/ all the zips.  in the install cmd put in your conditional:


              if ??TARGET.OS?? = something


              ./somescript zip1.zip

              elif ??TARGET.OS?? = somethingelse


              ./somescript zip2.zip



              at that point you are just writing shell commands because the install command executes in the default shell of the mapped user on the target.


              2 - same thing but w/ a blpackage.  put the conditional in the 'external command'.


              3 - create a single blpackage per os/arch or whatever, use the compliance auto-remediation to figure out what to deploy to the target and drive this via a compliance job


              4 - write a nsh script job to do this, put the zips somewhere nsh-accessible.


              5 - file deploy job.  you can't use properties here, but the 'post-install' command executes in the default shell on the target so use uname instead of the TARGET.OS property.  (you could do that for #1 and 2 also)


              6 - do what you are doing w/ the depot file and linking to the blpackage plus the same as the above w/ the if/then.

              • 4. Re: Migrate package from Opsware to Bladelogic Server Automation
                Daniel Suen

                So, is it possible to create a package per OS/architecture, and have another master package that does conditional check to deploy the appropriate package?


                I don't want to have all the zip files in a package, and when deployed, all get copied to the target host. For example, I want to deploy on a linux host, so does not make sense to include a zip file for AIX or Solaris.


                So that's option 3 above, right? I want someone to actually deploy the package rather than deployed automatically, does compliance auto-remediation other the option to manually deploy the package?



                • 5. Re: Migrate package from Opsware to Bladelogic Server Automation
                  Bill Robinson

                  it would be 3 or 4.


                  w/ 3 you create a blpackage (or depot software linked into a blpackage) per os/arch/version, then you create a component template.  setup the discovery rules and the compliance rules.  on the compliance rules you have the rule fail when you need to install your stuff, and then have auto-remediation setup and associated w/ the blpackage for that os/version/arch.


                  for 4, it's just a script, so you'd leave the zips somewhere - like the bsa file server - and then the script can do whatever you want.


                  there's been 'ideas' created (enhancement requests) to have the conditional deploy logic brought right into the blpackage but that isn't there right now so the template/compliance job is the way to do that now.

                  • 6. Re: Migrate package from Opsware to Bladelogic Server Automation
                    Daniel Suen

                    Thanks. I am trying the compliance/remediation option.


                    I created a component template for Solaris/Sparc for instance. So in the discovery, I put in filtering for these critieria (using TARGET/OS_*), and then I right-click to run a discovery job. It creates those components (matched servers, as I could see them underneath the component template and also somewhere under the Components section). I don't quite understand why the discovery job would emit warnings where it is saying in the log:


                    "No valid components for server blahblahblah.mynet.com"


                    "Signature condition [whatever I put for ??TARGET.OS_*?? (basically a bunch of conditions "ANDed" together)]" {FAIL}


                    I understand that if my conditions fail, the component will not get created, there is really no need to issue me a warning....as to the first message, no idea what it means. So my discovery job always has a warning sign on it...while I would say, these are not really warnings that I care about.


                    Then, I put in a compliance rule, where I include a file system path as a "part", and then the compliance rule checks if a certain directory exists.


                    When I right-click the component template and run "Compliance", why is it I have to pick the target server(s) or their parent folders? I suppose compliance should automatically run against components discovered through the component template?


                    Appreciate if you can shed some light on it. Thanks.



                    • 7. Re: Migrate package from Opsware to Bladelogic Server Automation
                      Bill Robinson

                      when you ran the discovery job, did you run it against all your servers or just the ones you know will pass the criteria in the template discovery condition?  in the case of the later you should not have gotten any messages about discovery conditions failing.


                      you can leave the targets blank for the compliance job and it will run against all of the components (valid or not) created for the template.  you can also create a component smart group filtering on 'is_valid = true' and the template.

                      • 8. Re: Migrate package from Opsware to Bladelogic Server Automation
                        Daniel Suen

                        When I add a file in the BLPackage, I can select the target server where the file is located (but not the local file system). I load in the contents of the file as well. But it seems to me that by doing this, I just cannot look at or edit the contents through the GUI. So, if I do some updates, I need to reload the content from the target file. While with a FILE depot object, you at least can edit the contents...


                        Is that right? Or I am missing something? I am trying to create a BLPackage by including some zip files, and a bunch of shell scripts that I include in the BLPackage itself (loading the contents), and then I have an external command object that invoke all these scripts in some order in the staging directory (all my files uploaded to BLPackage are in /tmp, so I suppose /tmp is the staging directory)


                        so the external script would be,

                        cd /tmp; ./a.sh

                        cd /tmp; ./b.sh



                        Is it the right approach?