8 Replies Latest reply on Aug 21, 2012 4:33 PM by John Van Ommen

    Provisioning with the BLCLI

      Does anyone have a working property file to use with the BLCLI command provisionDevice?

       

      Andrew's doc (BladeLogic Automated Provisioning) has helped a lot, but the property values in there seem to be based on version six? I'm using version 7.4.1 and BLCLI is complaining about my properties.

       

      Here's what my BLCLI looks like:

       

      BLCLI> Provision provisionDevice 54 00-1A-4B-EE-0B-54 0 file:///c:/propfile2.txt

      Command execution failed. com.bladelogic.model.typesystem.BlValueParseException: com.bladelogic.mfw.util.BlException: in

      stance "My Data Store" specified in incorrect syntax

       

      I know that my property file isn't complete, but here's what I have:

       

      1. Server.Property.prop_name=value, where prop_name is the name of a server property.

      2. SystemPackage.LocalProperty.prop_name=value, where prop_name is the name of a property of the given system package.

      3. Network.network_setting=value, where network_setting is a PXE or JumpStart network setting.

       

      SystemPackage.LocalProperty.DATA_STORE=My Data Storea

      SystemPackage.LocalProperty.DATA_STORE_USERNAME=guest

      SystemPackage.LocalProperty.DATA_STORE_FULL_PATH=D:/Program Files/BladeLogix/PXE/pxestore

      SystemPackage.LocalProperty.DATA_STORE_PASSWORD=pmuser

      SystemPackage.LocalProperty.DATA_STORE_SHARE_VIRTUAL_DIR=pxestore

       

      #The following network settings are common between PXE and JumpStart devices:

       

      Network.DHCPEnabled=true

       

      1. Network.IPAddress=[valid v4 ipv4 address]

      2. Network.SubNetMask=[valid subnet mask ipv4 format]

      3. Network.DefaultGateway=[valid ipv4 address]

      #If Network.DHCPEnabled is set to true, settings for Network.IPAddress, Network.SubNetMask and Network.DefaultGateway are ignored.

      #The (additional) valid Network settings for a PXE device are:

       

      Network.AutoDNSEnabled=true

       

      1. Network.DNSAddress.Primary=[valid ipv4 address]

      2. Network.DNSAddress.Secondary

      3. If Network.AutoDNSEnabled is set to true, settings for Network.DNSAddress.Primary and Network.DNSAddress.Secondary are ignored.

      4. The (additional) valid Network settings for a JumpStart device are:

      5. Network.EnablePrimaryInterface=[true or false]

      6. Network.UseIPv6=[true or false]

      7. Network.NameService.Type=[NIS | NIS+ | DNS | LDAP | NONE]

      8. Network.NameService.DomainName=domain_name

      9. If Network.NameService.Type equals "NIS" or "NIS+", you must specify the following settings:

      10. Network.NameService.NameServerHostName=name_server_host_name

      11. Network.NameService.NameServerIPAddress=[valid ipv4 address]

      12. If Network.NameService.Type equals "DNS", use the following required and optional settings:

      13. Network.NameService.PrimaryDNSServer=[valid ipv4 address] (required)

      14. Network.NameService.SecondaryDNSServer=[valid ipv4 address] (optional)

      15. Network.NameService.TertiaryDNSServer=[valid ipv4 address] (optional)

      16. Network.NameService.AdditionalDomains=domains, where domains is a comma-separated list of domains (optional)

      17. If Network.NameService.Type equals "LDAP", you can use the following optional settings:

      18. Network.NameService.ProfileName=profile_name (optional)

      19. Network.NameService.ProfileServerIP=[valid ipv4 address] (optional)

      20. Network.NameService.ProxyDN=proxy_dn (optional)

      21. Network.NameService.ProxyPassword=proxy_password (optional)

       

        • 2. Re: Provisioning with the BLCLI

          I found this post, and it really helped clear things up.

          https://www.bladelogic.com/community/thread.jspa?messageID=9654

           

          My provisioning job works now.

           

          Here's what my BLCLI looks like:

           

          BLCLI> SystemPackage getDBKeyByGroupAndName "/Linux/RHEL 4.0" "Dont_Modify-RHEL32-4-Opalis"

          DBKey:SSystemPackageKey:75

           

          BLCLI> Provision provisionDevice 75 00-1A-4B-EE-0B-54 0 file:///c:/propfile2.txt

          DBKey:SJobKey:106-1

          BLCLI>

           

          I followed the instructions in the posts above.

          Basically you add local properties to the system package that correspond to things like hostname and your disk partitioning commands.

          Then you parameterize your system package, and create a propfiles.txt that correspond to those properties.

          • 3. Re: Provisioning with the BLCLI

            We (normal users) cannot see your internal posts. Is there away to use the default values already supplied in our system packages? I would like to not have to use a property file to set properties that are already customized and/or parameterized to our internal build standards. It would also be nice to understand what entries must be specified in the property file.

            • 4. Re: Provisioning with the BLCLI

              I agree with Tobin, I cannot see those links (probably for internal use only), but we will have to implement parametrized provisioning, so some guidelines would be very valuable for us at this point.

              • 5. Re: Provisioning with the BLCLI

                I'm wrapping up a long engagement today, and I don't have time to post a proper reply.

                But I would like to help.

                I'll send myself a remind to update this thread early next week.

                If I wasn't so busy today I'd respond immediately.

                • 7. Re: Provisioning with the BLCLI

                  Thank you, I can see the posts now!

                  • 8. Re: Provisioning with the BLCLI
                    John Van Ommen

                    I believe that some of Bill's links no longer work, due to the migration to the new forums.

                     

                    If I'm not mistaken, my posts referenced a doc from Andrew Knott - here's the content of that doc:

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                    BladeLogic Automated Provisioning

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                    Table of Contents

                     

                     

                    1. Introduction. 3
                    2. 1.1.      Document Information. 3
                    3. 1.2.      Revision History. 3
                    4. Automated Provisioning. 4
                    5. 2.1.      Standard BladeLogic Technology. 4
                    6. 2.1.1.       System Packages. 4
                    7. 2.1.2.       Devices and States. 5
                    8. 2.1.3.       BladeLogic Command Line Interface (BLCLI) 6
                    9. BLCLI Documentation for Automated Provisioning. 7
                    10. 3.1.      Setting Up a Provision. 8
                    11. 3.2.      Executing a Provision. 8
                    12. 3.3.      Check Status of a Provision. 9
                    13. 3.4.      Utility Functions. 10
                    14. Appendix A – Format for BladeLogic Provisioning Configuration File. 12
                    15. Appendix B – Possible Causes for Provisioning Problems Based on State. 13

                     

                     

                     

                     

                     

                     

                     

                    1.    Introduction

                     

                    1.1.   Document Information

                     

                    This document describes a method for directly invoking the Bladelogic Provisioning API in order to discover and provision ‘bare metal’ servers in an automated way.

                     

                    Bladelogic extended the BladeLogic Command Line Interface (BLCLI) with  Provisioning Manager API  calls.  With this automated provisioning API,  one may quickly provision servers up to the OS layer. Following this, the provisioned server is available for standard management under Bladelogic.

                     

                     

                    1.2.   Revision History

                     

                     

                    Version #

                    Revision Date

                    By

                    Comments

                    1. 1.0

                    08/10/05

                    Andrew Knott

                    Initial Draft

                    1. 1.1

                    20/05/06

                    Andrew Knott

                    Modified to make more general

                     

                     

                     

                     

                     

                     

                     

                    2.  Automated Provisioning

                     

                     

                    2.1.      Standard BladeLogic Technology

                     

                    In order to understand the solution for automated provisioning, it is important to understand the nature and use of several standard, out of the box BladeLogic technologies.  System Packages, Devices, and the BladeLogic Command Line Interface (blcli). 

                     

                    2.1.1.  System Packages

                     

                    In BladeLogic provisioning, each operating system to be installed is defined in a System Package.  The System Package contains all of the provisioning instructions and information to provision a server.  The typical sections of a System Package include:

                    ·         Disk Cleanup

                    ·         Hardware Configuration

                    ·         Disk Array Configuration

                    ·         Pre-Disk Partition

                    ·         Disk Partition

                    ·         Post-Disk Partition

                    ·         Disk Format

                    ·         Basic OS Configuration

                    ·         Computer Settings

                    ·         Optional OS Components

                    ·         Networking Configuration

                    ·         OS Specific Entries

                    ·         Post Installation Configuration

                     

                    By configuring  each section, a system package has all of the information and instructions necessary to install an operating system.

                     

                    Each System Package is associated with a specific Role and is located in a specific System Package Group.  A System Package Group is often referred to as a folder or directory.  A user that logs into BladeLogic Provisioning Manager must be in the correct Role and select the correct System Package Group in order to edit or use a System Package.

                     

                     

                    2.1.2.  Devices and States

                     

                    In addition to system packages, BladeLogic Provisioning has the concept of devices, which are the servers that are provisioned.  A device is normally identified by its Mac Address.   In BladeLogic Provisioning Manager, a device can be in several states including  Discovered, Provisioned or multiple states during device provisioning. 

                     

                    Discovered State

                    The Discovered state indicates that a server has booted using PXE, communicated with BladeLogic, automatically discovered as a server that has not been provisioned and is ready to be provisioned.  The automated provisioning extension allows devices to be manually discovered so the device will immediately be ready for provisioning. A device that is marked as Discovered will not continue to boot  normally using the local disk.  Instead, a Discovered device will wait for BladeLogic Provisioning Manager to provide provisioning instructions.

                     

                    Provisioned State

                    The Provisioned state indicates that a server has been provisioned using BladeLogic, or marked as provisioned using BladeLogic.  Any server marked as provisioned should be manageable from the standard BladeLogic Confirmation Manager.  A server that is provisioned needs to be deleted or marked as discovered before it can be “re-provisioned”.  A device that is marked as Provisioned will continue to boot into an operating system normally using the local disk.

                     

                    States During Provisioning

                    While a device  is being provisioned, it will go through multiple states directly correlating to the System Package sections.  Depending on the state, information in the System Package and the OS being provisioned, the device may reboot at certain states.  For example, a device will reboot if the disks are partitioned, or if the OS install files are copied to the disk and ready to install.  While a device being provisioned, BladeLogic Provisioning Manager understands the different states and will boot a device using PXE or locally depending on the appropriate provision state.

                     

                    Booting a Device – PXE Boot or Local Boot

                    A device that is marked as Discovered will not continue to boot  normally using the local disk.  Instead, a Discovered device will boot using PXE and wait for BladeLogic Provisioning Manager to provide provisioning instructions.  A device that is marked as Provisioned will continue to boot into an operating system normally using the local disk.  While a device being provisioned, BladeLogic Provisioning Manager understands the different states and will boot a device using PXE or locally depending on the appropriate provision state.

                     

                     

                    2.1.3.  BladeLogic Command Line Interface (BLCLI)

                    The BladeLogic Command Line Interface(BLCLI) is a standard out-of-the-box interface that allows command line access to BladeLogic functionality.  The  BLCLI provides an interface to examine information stored in BladeLogic and to perform actions, e.g. running a snapshot job, creating a component, etc...  For more information on the BLCLI including general syntax, command line options and available commands, please see the BLCLI documentation.  The BLCLI available in any BladeLogic installation under <bl-install-dir>/Doc/cli.  BLCLI requires a login of username, password and role to be entered or provided when executing.  It is possible to automate BLCLI logins with a user_info.dat file which can be created using the bl_gen_blcli_user_info program, available in <bl-install-dir>/br

                     

                     

                     

                     

                     

                    3.  BLCLI Documentation for Automated Provisioning

                     

                    The BladeLogic API for Provisioning is arranged in 4 areas – Setting Up a Provision, Executing a Provision, Check Status of a Provision and Utility functions.

                    In order for a server to be able be provisioned, it needs to be added to BladeLogic Provisioning Manager as a discovered device, either manually with BLCLI or automatically discovered when the server boots via PXE.   If the server already exists inside of BladeLogic as a Provisioned server, it needs to be deleted and re-added as a discovered server. 

                     

                    When a server is discovered, it should be booted so BladeLogic Provisioning Manager can take control of the OS installation process.  If the server was already in provisioned and in BladeLogic Configuration Manager, a reboot nsh script can reboot the server.  Alternatively, if the device was powered down, the Wake On Lan “Magic Packet” may be an option to boot the server.  A final option is cycling the power to provide a hard reset.

                     

                    Once a server is set as Discovered in BladeLogic, it then needs to be provisioned by MAC Address.  The provision calls needs to provide a System Package (System Package Folder and System Package Name) and a configuration file.  See Section 2.2 System Packages for more information on System Packages.  See Appendix A – Format for BladeLogic Provisioning Configuration File for more information on the Provisioning Configuration File. Once a Provision has been started, it runs asynchronously, and immediately returns a Provision Handle.

                     

                    In order determine when a provision has finished, the Provision Handle can be used to check on the status of a provision. 

                     

                    Every call to the BladeLogic Command Line Interface for provisioning uses a MAC Address as a parameter. If a server has already been provisioned, it will have a server name in addition to a MAC Address.  There are two utility functions that will map a MAC Address to a server name and vice versa.

                     

                     

                     

                     

                    3.1.      Setting Up a Provision

                     

                    In order for a server to be able be provisioned, it needs to be added to BladeLogic Provisioning Manager, either manually with BLCLI or automatically discovered when the server boots via PXE.   If the server already exists inside of BladeLogic as a Provisioned server, it needs to be deleted and re-added as a discovered server. 

                     

                    Delete a server based on a MAC Address

                     

                    Provision deleteServerByMacAddress {MAC-Address}

                     

                    Parameters: {MAC-Address} – MAC Address in 01-23-45-67-89-AB format

                    Returns: “void” if the operation was successful.

                     

                     

                    Register a Mac address with BladeLogic as a Discovered device.

                    blcli Provision addMac {MAC-Address}

                     

                    Parameters: {MAC-Address} – MAC Address in 01-23-45-67-89-AB format

                    Returns: A device-id, which will be a positive integer.

                     

                    Notes: This is an optional call, if the server has been booted PXE, its MAC Address will automatically be discovered.

                     

                    3.2.      Executing a Provision

                     

                    Once a server is set as Discovered in BladeLogic, it then needs to be provisioned by MAC Address.  The provision calls needs to provide a System Package (System Package Folder and System Package Name) and a configuration file.  See Section 2.2 System Packages for more information on System Packages.  See Appendix A – Format for BladeLogic Provisioning Configuration File for more information on the Provisioning Configuration File. Once a Provision has been started, it runs asynchronously, and immediately returns a Provision Handle.

                     

                     

                    Provision a server asynchronously

                     

                    Provision provisionByName {System-Package-Group}    {System-Package-Name} {MAC-Address} {config-file-URL} 

                     

                    Parameters: {System-Package-Group} – System Package Group Name in “/Path/To Folder” format.

                    {System-Package-Name} – System Package Name from Provision Manager

                    {MAC-Address} – MAC Address in 01-23-45-67-89-AB format.   servername.

                     

                    {config-file-URL} – URL to BladeLogic Provisioning Configuration File.  Both http:// and file:/// formats are accepted.

                     

                    Returns: A Provision Handle that can be used to check status.  General format for a Provision Handle: “DBKey:SJobKey:{Integer}-(Integer}”, e.g. DBKey:SJobKey:189-1

                     

                    Sample Call:

                    blcli Provision provisionByName "/Production Packages" "RedHat AS 2.1 - JPetStore" 01-23-45-67-89-AB file:///c:/temp/bl_provision.properties

                     

                    DBKey:SJobKey:189-1

                     

                     

                    3.3.      Check Status of a Provision

                     

                    Check the status of a provision.

                     

                    Provision getProvisionStatus {Provision-Handle}

                     

                    Parameters: {Provision-Handle} –  Provision Handle from a Provision Job.  Provision Handles are persistent.

                     

                    Returns:  String describing the status of the provision. 

                     

                    Notes: The return string has several different possibilities.  When running, the return string has a specific format:  State Description (State X of Y).  When the provision is finished, the return string will be “The provision job is not currently running”.  If the status is checked immediately (within 5 seconds) after a provision is initiated, there is a possibility that the provision will not have started and the return string will also be “The provision job is not currently running”. 

                     

                    There is no specific error state for a provision, any problems will probably result in a provision staying in a specific state indefinitely.  The server being provisioned may reboot multiple times during the stages, based on the system package settings.  Proper time for the action to occur and the server to reboot is needed.    For assistance in determining why a provision is failing, please see Appendix B - Possible Causes for Provisioning Problems Based on State.

                     

                    The following are the known states for an active provision and directly relate to the System Package Sections in 2.2.1 System Packages:

                     

                    Check State (Stage 3 of 14)

                    Disk Cleanup (Stage 4 of 14)

                    Hardware Config (Stage 5 of 14)

                    Disk Array Config (Stage 6 of 14)

                    Pre Disk Partition (Stage 7 of 14)

                    Disk Partition (Stage 8 of 14)

                    Post Disk Partition (Stage 9 of 14)

                    Format (Stage 10 of 14)

                    Phase 1 OS Install (Stage 12 of 14)

                    Phase 2 OS Install (Stage 13 of 14)

                    The provision job is not currently running

                     

                    3.4.      Utility Functions

                     

                    Map a MAC Address to a Server Name

                     

                    Provision getNameByMacAddress {MAC-Address}

                     

                    Parameters: {MAC-Address} – MAC Address that is already in BladeLogic

                     

                    Returns:  Computer name of the server. 

                     

                     

                    Map a Server Name to a MAC Address

                     

                    Provision getMacAddressByName {Computer-Name}

                     

                    Parameters: {Computer-Name} – Computer that is already in BladeLogic

                     

                    Returns:  MAC Address for the server.

                     

                     

                     

                     

                    4.  Appendix A – Format for BladeLogic Provisioning Configuration File

                     

                     

                    # BladeLogic provisioning configuration file (c) 2005 BladeLogic

                    # usage:

                    # blcli Provision provisionByName {group-name} {system-package-name}

                    #   {mac-id} {this config file}

                    #

                    # The following properties are from the Provisioning Manager, under

                    #    Tools | Property Dictionary

                    #

                    1. Property.DATA_STORE_USERNAME=guest
                    2. Property.DATA_STORE_FULL_PATH=C:/Program Files/BladeLogic/PXE/pxestore
                    3. Property.DATA_STORE_SHARE_VIRTUAL_DIR=pxestore
                    4. Property.DATA_STORE_LOCATION=MAIN DATA STORE
                    5. Property.DATA_STORE_PASSWORD=pmuser

                    # Custom property

                    1. Property.test=somevalue

                    #

                    # if Network.DHCPEnabled is false then the following properties must

                    # be set: Network.IPAddress, Network.SubNetMask, Network.DefaultGateway

                    #

                    1. Network.DHCPEnabled=false
                    2. Network.IPAddress=192.168.65.234
                    3. Network.SubNetMask=255.255.255.0
                    4. Network.DefaultGateway=192.168.65.1

                    #

                    # if Network.AutoDNSEnabled is false then the following properties must

                    # be set: Network.DNSAddress.Primary, Network.DNSAddress.Secondary

                    #

                    1. Network.AutoDNSEnabled=false
                    2. Network.DNSAddress.Primary=10.1.1.1
                    3. Network.DNSAddress.Secondary=10.1.1.2

                     

                     

                     

                     

                    5.  Appendix B – Possible Causes for Provisioning Problems Based on State

                     

                    Problems with Check State (Stage 3 of 14):

                    At this state the provision job has started successfully and is waiting for the server to be provisioned (target server) to PXE boot and start the provision process. If the provision stays at this state indefinitely, the target server has never communicated with the Provisioning Manager to actually start the provision.

                     

                    Common causes:

                    -          The target server may be already booted into an operating system and need to be rebooted to initiate the PXE process

                    -          The provision may have been initiated with the wrong MAC Address

                    -          The target server may be powered off

                    -          The target server may be disconnected from the network

                    -          The target server may not connected to a network where DHCP broadcasts can reach the provision server

                    -          The target server may be setup to not boot PXE before booting from local disk

                    -          The DHCP Server,  BladeLogic PXE Server or BladeLogic TFTP Server may not be running.  In Linux / Unix, check that dhcpd, blpxe and bltftp processes are running.  In Windows, check that the services are running: DHCP Service, BladeLogic PXE Server.

                     

                    Problems with Disk Cleanup (Stage 4 of 14), Hardware Config (Stage 5 of 14),  Disk Array Config (Stage 6 of 14), Pre Disk Partition (Stage 7 of 14) and

                    Post Disk Partition (Stage 9 of 14)

                    At these states, the provision process has started and several pre-format scripts can run if needed and reboot the target server if needed. If the provision stays at one of these states indefinitely, then the script that is running during this step has hung or the target server has not rebooted correctly after the script finished.

                     

                    Problems with Format (Stage 10 of 14)

                    At these states, the provision process has started and all pre-format scripts have run as needed.  If provision is ghost based, then the ghost provision is executed during this stage.  Check the ghost based provisioning script, connectivity to the pxestore share that holds the ghost image, the execution of ghost (use ghost –fni for dell servers).

                     

                    If the provision is Windows or Linux based, then this stage formats the hard drive and copies basic files for OS installation to the newly formatted drive.  The target server likely has booted locally for the first time during the provision process and has failed to find the appropriate files for a local installation of the operating system.  It is very likely that the Operating System files necessary were not copied properly.  Common causes are no network connectivity between the target server and the data_store (pxestore) share, bad configuration of the data_store properties in Provisioning Manager, Tools | Property Dictionary.

                     

                     

                     

                    Problems with Phase 1 OS Install (Stage 12 of 14)

                    If the provision is Ghost Based, then the bmi call inside of the image has not properly called back to the provisioning manager.  If the provision is Windows or Linux based, the initial OS installation has failed.  Common cause for this is that hardware specific drivers have not loaded correctly, incorrect windows CD Key, or bad installation media.

                     

                     

                     

                    Problems with Phase 2 OS Install (Stage 13 of 14)

                    The initial OS installation has failed.  Common cause for this is that hardware specific drivers have not loaded correctly, incorrect windows CD Key, or bad installation media.