Configuring an Azure VM Image for Instances

IT Asset Management (Cloud)
The easiest way to collect inventory from all your cloud-based instances is to ensure that they are launched from an Azure image that already contains everything needed for the collection of FlexNet inventory. The requirements include:
  • Installing the latest approved FlexNet inventory agent into the image
  • Adding a customized configuration file that identifies the upload location for inventory
  • Installing a customized schedule to manage FlexNet inventory agent in the resulting instances, triggering inventory gathering on start-up (and best practice is to include a backup schedule for further inventory collection in case an instance from this AMI runs for an unexpectedly long time)
  • Including the current version of InventorySettings.xml that provides advanced functionality for FlexNet inventory agent, since the short lifetime does not allow for normal policy-based downloads
  • Ensuring a unique name for each instance created from this Azure VM Image.

At this summary level, the requirements are the same for Windows and Linux platforms. In the details, of course, there are platform specifics.

To prepare an Azure Resource Image:

  1. In the web interface for IT Asset Management, navigate to Discovery & Inventory > Inventory Settings.
    The Inventory Settings page displays.
  2. Expand the Inventory agent for download section.
  3. Collect the template configuration file:
    • For a Windows-based AMI, click Download bootstrapping template file, and save mgssetup.ini to a convenient working folder (such as C:\temp). (Do not change the file name.)
    • For a Linux-based AMI, in the Gathering FlexNet Inventory PDF (available through the title page of online help), copy the text from Agent third-party deployment: Sample UNIX Bootstrap Configuration File and save it as mgsft_rollout_response in a convenient working folder (such as C:\temp).
  4. From the Inventory agent drop-down list, select the version of FlexNet inventory agent you want to install in your AMI, and save it to your working folder.
    In general, install the latest available version, subject to your corporate policies. This provides access to the latest functionality. For example, to include advanced inventory for Microsoft Azure, you must use FlexNet inventory agent 13.2.0 or later (see Appendix 3: Enhanced Inventory Gathered by Agent).
  5. In your preferred flat text editor, customize your bootstrapping template file to be used for FlexNet inventory agent in your Microsoft Azure environment as follows, saving the edited version in a separate subfolder.
    For Windows, the only mandatory change is to identify the upload location for gathered inventory, as described below. On Linux, FlexNet inventory agent requires both an upload location and a download location. As always, on either platform, experts may also customize other preferences needed for your implementation, as described in the platform-specific topics in the Gathering FlexNet Inventory PDF:
    • Agent third-party deployment: Edit the Configuration File for Microsoft Windows
    • Agent third-party deployment: Configure the Bootstrap File for UNIX.
    The upload (and download) locations require a URL to the host inventory beacon. Best practice is to provide a DNS alias for your chosen inventory beacon, so that when circumstances change, a simple switch of the alias leaves any running and future instances fully operational, without requiring changes to the virtual machine image.
    • For Windows, in mgssetup.ini:
    1. Locate this section for Common preferences, and uncomment (remove the leading semi-colon) and edit the following settings:
      ;=========================================================================
      ; Registry settings to be created under
      ; HKLM\Software\ManageSoft Corp\ManageSoft\Common
      [Common]
      desc0 = UploadSettings\Bootstrap Server\Protocol
      val0  = http
      desc1 = UploadSettings\Bootstrap Server\Priority
      val1  = 100
      desc2 = UploadSettings\Bootstrap Server\AutoPriority
      val2  = False
      desc3 = UploadSettings\Bootstrap Server\Host
      val3  = beacon.fnms.com
      desc4 = UploadSettings\Bootstrap Server\Port
      val4  = 80
      desc5 = UploadSettings\Bootstrap Server\Directory
      val5  = /ManageSoftRL/
    2. Optionally, modify the Protocol value if you want to use HTTPS (val0 = https).
    3. You must customize the Host preference (shown above as val3 = beacon.fnms.com) to your chosen DNS alias (or preferred host setting) and your own enterprise name if the inventory beacon is located in your enterprise network rather than on an Azure instance. For an inventory beacon hosted on an Azure instance, you can identify its public and private DNS hostnames on the Azure console (select Instances in the navigation pane, choose the instance hosting the inventory beacon, and read both its public and private DNS hostnames in the details pane).
      Tip: If you have an inventory beacon on an Azure instance, your installations of FlexNet inventory agent on other instances can be configured to use the private DNS hostname for accessing the inventory beacon (provided that both are within the scope of your VPC). The private hostname has greater stability, particular if the inventory beacon host is stopped and started from time to time.
    4. Optionally, customize the port setting (for example, if you are switching to the HTTPS protocol, the default port is 443).
      Important: The Directory preference is mandatory, and must be set as shown above.
    5. Create a subfolder (such as SysPrepAgent) and save your edited mgssetup.ini there. Do not change the file name, which is mandatory.
    • For Linux, in mgsft_rollout_response:
    1. In the first section of the file, customize the setting for the download location (see also the comments for the upload location, next):
      # The initial download location(s) for the installation.
      # For example, http://myhost.mydomain.com/ManageSoftDL/
      # Refer to the documentation for further details.
      MGSFT_BOOTSTRAP_DOWNLOAD=http://beacon.fnms.com:8080/ManageSoftDL/
    2. In the next section of the file, customize the setting for the reporting (upload) location:
      # The initial reporting location(s) for the installation.
      # For example, http://myhost.mydomain.com/ManageSoftRL/
      # Refer to the documentation for further details.
      MGSFT_BOOTSTRAP_UPLOAD=http://beacon.fnms.com:8080/ManageSoftRL/
      You may customize the protocol to HTTPS if required, and omit or customize the port number as required. You must customize the host URL (shown above as beacon.fnms.com) to your chosen DNS alias (or preferred host setting) and your own enterprise name if the inventory beacon is located in your enterprise network rather than on an Azure instance. For an inventory beacon hosted on an Azure instance, you can identify its DNS hostname on the Azure console (select Instances in the navigation pane, choose the instance hosting the inventory beacon, and read its DNS hostname in the details pane).
      Important: In each case, the trailing /ManageSoftDL/ (download location) or /ManageSoftRL/ (upload or reporting location) is mandatory, and must be specified as shown above.
    3. In the last line of the file, switch the value to prevent policy running after installation, as short-lived instances do not have time to wait for policy and its outcomes:
      MGSFT_RUNPOLICY=0
    4. Create a subfolder (such as SysPrepAgent) and save your edited mgsft_rollout_response there. Do not change the file name, which is mandatory.
    5. Unless you already have a strategy and practice that gives every Linux instance a unique name, also create a new text file for your Linux virtual machine image, called tmpconfig.ini, with exactly the following two lines:
      [ManageSoft\Common]
      MachineID=
      This file is deliberately incomplete at this stage, and is to be completed at instance start-up, as described later.
  6. For either platform, copy the following and paste it into a plain ASCII text file, and save it in your SysPrepAgent folder as DefaultSchedule.nds (this file name is mandatory). Of course, you may choose to unwrap those lines wrapped for readability here.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE Schedule PUBLIC "Flexera Inventory Manager schedule" 
         "http://www.managesoft.com/dtd/schedule.dtd">
    
    <Schedule NAME="Default Schedule" TIMEDATESTAMP="20180903T044104Z" SCHEDSCHEMA="60">
    	<Event NETWORK="False" 
                     NAME="Generate Inventory" 
                     CATCHUP="Never" ID="{F065A477-B500-4611-8340-3BF313FB785B}">
    	    <LogicalCommand PARAM=" -o UserInteractionLevel=Quiet" 
                     ACTION="Report" COMPONENT="Tracker"/>
               <Trigger TYPE_PARAM="0" TIMESTART="143950" 
                     DATESTART="20180903" TYPE="Logon" MAXDELAY="0"/>
    	</Event>
          <!-– Following two events are optional (see notes) --!>
    	<Event NETWORK="False" 
                     NAME="Generate Inventory" IDLEDURATION="86400" 
                     CATCHUP="Never" ID="{F065A477-B500-4611-8340-3BF313FB785B}">
    	    <LogicalCommand PARAM=" -o UserInteractionLevel=Quiet" 
                     ACTION="Report" COMPONENT="Tracker"/>
    	    <Trigger TYPE_PARAM="1" TIMESTART="001000" 
                     DATESTART="20180903" TYPE="Daily" REPEAT="21600" 
                     TIMEWINDOW="3600" DURATION="86400"/>
    	</Event>
           <Event NETWORK="False" 
                     NAME="Upload Client Files" 
                     CATCHUP="Never" ID="{9CB87BAE-2829-498C-8643-10A9BD3BFA56}">
    	    <LogicalCommand PARAM="-a" 
                     ACTION="Upload" COMPONENT="Uploader"/>
    	    <Trigger TYPE_PARAM="1" TIMESTART="002000" 
                     DATESTART="20180903" TYPE="Daily" REPEAT="600" 
                     DURATION="86400"/>
    	</Event>
    </Schedule>

    The first event in this schedule triggers machine inventory collection on startup (TYPE="Logon"), and the tracker component automatically attempts an upload to the bootstrap inventory beacon as soon as inventory gathering is complete. If you are certain that all instances from this image are short-lived, only this event is required. If you are using an instance, and you choose to stop and restart your instance (rather than to terminate and re-launch it), this inventory is checked on each restart.

    In addition, two further schedule events provide easy management of cases where an instance proposed to have a short life in fact keeps on running for some longer time.

    The second event also generates inventory, and is triggered every 6 hours (REPEAT="21600", with all times expressed in seconds), to start within an hour thereafter (TIMEWINDOW="3600"). However, this inventory collection is different than the first case, because here the FlexNet inventory agent does not repeat the inventory collection if it has been successful within the last 24 hours (IDLEDURATION="86400"). This means that, effectively, the FlexNet inventory agent checks four times a day whether there has been a successful inventory collection in the last 24 hours, and if not, it runs a new inventory collection.

    In a perfect world, the third event is redundant because the tracker component uploads inventory as soon as it is collected. This third, separate upload event is a catch-up to work around transient network issues. It checks every 10 minutes to see whether any inventory files have failed to upload (and are therefore still waiting in the staging folder). In normal cases, nothing is waiting, and the uploader shuts down immediately, causing negligible load on the instance. But where there have been networking issues, upload is attempted again every 10 minutes until all files are successfully uploaded and removed from the staging folder.

  7. On a convenient inventory beacon, navigate to %CommonAppData%\Flexera Software\Staging\Common\ClientConfiguration, take a copy of InventorySettings.xml, and save it to your SysPrepAgent working folder.

    This completes the preparation of materials for your virtual machine image for instances of this expected life. Now continue to use these materials to prepare the virtual machine image. For both platforms, the high-level process is to customize a running instance, and then save it as a virtual machine image.

    For a Windows-based VM Image please refer to the following link:

    For a Linux-based VM Image please refer to the following link:

  8. Following the Azure documentation, select (or create), launch and connect to your chosen instance from which you are creating your Azure VM Image.
  9. To customize your instance:
    1. Ensure that the destination folder exists for your installation of FlexNet inventory agent, and if not create it.
      The default paths for each platform are:
      • On Windows, C:\Program Files (x86)\ManageSoft
      • On Linux, /opt/managesoft/bin.
    2. From your local SysPrepAgent working folder, copy these files into the destination folder on your instance:
      • DefaultSchedule.nds
      • InventorySettings.xml
      • Only on Windows, mgssetup.ini
      • Only on Linux, tmpconfig.ini.
    3. For Linux only, also copy your amended mgsft_rollout_response file to /var/tmp/ on your instance.
    4. Collect the downloaded installer for FlexNet inventory agent from your working folder, and run the installer on your instance, installing FlexNet inventory agent into the prepared destination folder.
      The installer automatically configures the custom settings declared in the configuration file (either mgssetup.ini or mgsft_rollout_response, depending on platform). For more information about running the installation, see the Agent third-party deployment: Details chapter of the Gathering FlexNet Inventory PDF, focusing on the installation topic for your preferred platform.
    5. When installation is complete, in the same destination folder and for both platforms, run the following command to install your default schedule:
      start ndschedag.exe -t machine .\DefaultSchedule.nds
This virtual machine image is now ready. As soon as each instance is spawned, the embedded FlexNet inventory agent gathers inventory from the instance, and immediately uploads it to the bootstrap inventory beacon. Depending on the resources on each instance, this process may take around 2-5 minutes, after which the instance can be stopped (but remember, not terminated if you wish to track related software licenses in IT Asset Management).

IT Asset Management (Cloud)

Current