Home Scripting Corner Automating your application delivery fabric: Deploy a LoadMaster

Automating your application delivery fabric: Deploy a LoadMaster

by Kurt Jung
0 comment

Application-Delivery

Automation starts with the initial deployment of the solution, configuration of that solution and continues throughout the life of the solution. In this walk-through I will deploy a new LoadMaster into Azure from the Marketplace, license it, set several system options and create a new Virtual Service to support my workload, all from PowerShell. The steps outlined in this could also be triggered from one of the many automation and orchestration tools on the market. These can tools provide a zero-touch deployment and configuration of solutions.

To start off there are a few prerequisites:

Deploy LoadMaster in Azure

Microsoft Azure provides several ways to automate the deployment of solutions in the cloud. In this example the use of PowerShell in combination with Azure Resource Manager (ARM) Templates will be utilized. KEMP has produced and published several ARM Templates in Github that customers can download and use when designing and deploying solutions. In this example, the “kemp-loadmaster-basic-deploy” template will be used and includes two files:

  • Create-VLM-BYOL-SKU.json
  • VLM-BYOL-SKU-Parameters.json

The VLM-BYOL-SKU-Parameters.json must be updated to include the unique parameters for each deployment. In this example I will use the following values:

{
“$schema”: “http://schema.management.azure.com/schemas/2015-05-01/deploymentParameters.json#”,
“contentVersion”: “1.0.0.0”,
“parameters”: {
“vmName”: {
“value”: “VLM-Automate”
},
“newStorageAccountName”: {
“value”: “vlmautomatestore”
},
“dnsNameForPublicIP”: {
“value”: “VLM-Automate-PIP”
},
“balPassword”: {
“value”: “VLM8965Automate!”
},
“vmSize”: {
“value”: “Standard_A1”
},
}
}

  1. The Azure PowerShell Module must be imported to proceed to the next steps.
  2. Use the Add-AzureRMAccount to authenticate to the Azure Subscription.
     
    Application Delivery 1
  3. Select the Azure Subscription to use for the deployment.
    1. Select-AzureRMSubscription -Subscriptionname “My Subscription”
  4. Create a new Resource Group if necessary.
    1. New-AzureRMResourceGroup -name Automate-RG -Location “East US”
  5. Deploy the KEMP LoadMaster via ARM Template.
    1. New-AzureRmResourceGroupDeployment -Name Automate-VLM -ResourceGroupName Automate-RG -TemplateFile C:\ARM\Create-VLM-BYOL-SKU.json -TemplateParameterFile C:\ARM\VLM-BYOL-SKU-Parameters.json
  6. The deploy takes about 3 minutes and the Public IP Address (PIP) is presenting within the PowerShell. This will be used to license and configure the LoadMaster in the next steps.

Application Delivery 2

License the LoadMaster

The LoadMaster must now be licensed and once again this can be accomplished via the KEMP PowerShell Module. Since many of the PowerShell cmdlets will use the same values, it is best to simplify the task by leveraging variables.

  1. The KEMP PowerShell module must be imported prior to running these cmdlets. Instructions on installing the LoadMaster module can be found at here:
  1. Set the following variables in PowerShell

a.  LoadMaster IP address obtained from the Output above.

i. $LoadMasterIP=”52.226.132.12”

b. Your KEMP ID

i. $KEMPID=”MyKEMPID@company.com”

c. Your KEMP ID Password

i. $KEMPIDPW=”MySecretPassword!”

d. The LoadMaster bal credentials

i. $creds=get-credential

This will prompt for username which is “bal” and the password used in the ARM template parameters file.

Application Delivery login

 

  1. Test the connection to the LoadMaster and confirm True is returned from the cmdlet.
    1. Test-LMServerConnection -ComputerName $LoadMasterIP -Port 8443Application Delivery code screen
  2. Initialize the connection to the LoadMaster using the $LoadMasterIP and $creds variable.
    1. Initialize-LmConnectionParameters -Address $LoadMasterIP -LBPort 8443 -Credential $credsApplication Delivery code screen 2
  3. This cmdlet will set a new variable simulating the reading of the End User License Agreement (EULA)
    1. $readeula=Read-LicenseEULA -LoadBalancer $LoadMasterIP -Credential $creds
  4. This cmdlet is step one of the acceptance of the End User License Agreement (EULA)
    1. $confirmeula = Confirm-LicenseEULA -Magic $readeula.Data.Eula.MagicString -LoadBalancer $LoadMasterIP -Credential $creds
  5.  This cmdlet is step two of the acceptance of the End User License Agreement (EULA)
    1. Confirm-LicenseEULA2 -Magic $confirmeula.Data.Eula2.MagicString -Accept yes -LoadBalancer $LoadMasterIP -Credential $credsApplication Delivery code screen 3
  6.  Get the available license types by logging into KEMP’s Licensing portal.
    1. <Get-LicenseType -KempId $KEMPID -Password $KEMPIDPW -LoadBalancer $LoadMasterIP -Credential $credsApplication Delivery code screen 4
  7.  Request the available license from KEMP’s licensing portal.
    1. Request-LicenseOnline -LoadBalancer $LoadMasterIP -Credential $creds -KempId $KEMPID -Password $KEMPIDPWApplication Delivery code screen 5
  8.  Use the same password that was entered in the $creds variable and ARM parameters file.
    1. Set-LicenseInitialPassword -Passwd KEMP2Automate#$ -LoadBalancer $LoadMasterIP -Credential $credsApplication Delivery code screen 6
  9. Enable the KEMP LoadMaster API interface to manage and configure the appliance.
    1. Enable-SecAPIAccess -LoadBalancer $LoadMasterIP -lbport 8443 -Credential $credsApplication Delivery code screen 7
  10. Confirm the connection to the KEMP LoadMaster by requesting the version.
    1. Get-LmParameter -LoadBalancer $LoadMasterIP -Credential $creds -LBPort 8443 -Param versionApplication Delivery code screen 8

 

Configure options on the LoadMaster

The LoadMaster is licensed and ready for configurations to be applied. In this step, a few networking options will be set using the PowerShell module. These are just examples as there are many options based on requirements.

  1. Set the LoadMaster to accept non-local Real Servers
    1. Set-LMOptions -LMGroup NetworkOptions -LMOption NonLocalRS -LMValue 1 -LMPublicIP $LoadMasterIPApplication Delivery code screen 9
  2.  Set the LoadMaster option Subnet Originating Requests
    1. Set-LMOptions -LMGroup NetworkOptions -LMOption SubnetOriginating -LMValue 1 -LMPublicIP Application Delivery code screen 10

Configure Virtual Services on the LoadMaster

With the LoadMaster options set, it is time to configure our Virtual Service to publish our workload. The Virtual Service consists of a Name, Virtual IP Address, Protocol, and Port for the workload. Additional configuration options can be set based on the workload requirements.

  1. Create a new Virtual Service
    1. New-AdcVirtualService -VirtualService 10.0.0.4 -VSPort 80 -VSProtocol tcp -nickname Automate-VS1Application Delivery code screen 10
  2. Add Real Servers to the newly created Virtual Service
    1. New-AdcRealServer -RealServer 10.0.0.18 -RealServerPort 80 -VirtualService 10.0.0.4 -VSPort 80 -VSProtocol tcpApplication Delivery code screen 11

KEMP’s PowerShell is a critical component of automation that can deliver the speed, consistency, and agility that every business requires. In today’s world of IT, it is relatively clear:

“If it can’t be automated, you don’t need it”

 

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy