Documentation forSecurity Event Manager

Deploy SEM from Bash (Linux)

Scripts are not supported under any SolarWinds support program or service. Scripts are provided AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The risk arising out of the use or performance of the scripts and documentation stays with you. In no event shall SolarWinds or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the scripts or documentation.

Lines starting with the # character are just comments. The back quote (`) character on the end of lines is for multi-line commands.

  1. Run Bash shell (WSL or native) where Azure CLI 2.0 is installed.
  2. Log in to the Azure Portal.
  3. Create your script.

    The following script is a template. When you fill in the variables for your Azure VM environment, the script will run, upload your two VHD files, and then create your VM in the Azure Portal.

    Replace the values in red below with the values you recorded in the previous sections unless otherwise indicated. Enter values between the quotation marks, when present. Copy the entire script template into a text editor, such as Notepad, to make your edits.

    # storage account and key set to ENV to avoid typing it to each command
    $env:AZURE_STORAGE_ACCOUNT="STORAGE_ACCOUNT"
    $env:AZURE_STORAGE_ACCESS_KEY="ACCESS_KEY"
    $disk1Filename="SolarWinds-SEM-Azure-<SEM_VERSION>-disk1-system.vhd"
    $disk2Filename="SolarWinds-SEM-Azure-<SEM_VERSION>-disk2-data.vhd"
    $sku="Standard_LRS"
    $vmSize="Standard_B1s"
    $resourceGroup="RESOURCE_GROUP"
    $vmLocation="LOCATION"
     
    $disk1Name="SYSTEM-disk1.vhd"
    $disk2Name="DATA-disk2.vhd"
    $vmName="VM-NAME"
    					
    # upload system and data disks
    az storage blob upload --container-name CONTAINER NAME --type page --file $disk1Filename --name $disk1Name
    az storage blob upload --container-name CONTAINER NAME --type page --file $disk2Filename --name $disk2Name
     
    # get blob urls
    $blobUrlDisk1=az storage blob url --container-name CONTAINER NAME --name $disk1Name
    $blobUrlDisk2=az storage blob url --container-name CONTAINER NAME --name $disk2Name
     
    # create system and data disks
    az disk create --resource-group $resourceGroup --sku $sku --name $disk1Name --source $blobUrlDisk1
    az disk create --resource-group $resourceGroup --size-gb "250" --sku $sku --name $disk2Name --source $blobUrlDisk2
    					
    # create a machine and enable boot diagnostics
    az vm create --resource-group $resourceGroup --size $vmSize --public-ip-sku "Basic" --location $vmLocation --name $vmName --os-type "linux" --attach-os-disk $disk1Name --attach-data-disks $disk2Name
    az vm boot-diagnostics enable --name $vmName --resource-group $resourceGroup --storage $env:AZURE_STORAGE_ACCOUNT

    Below is an explanation of each value and variable. The first section below initializes the variables. The subsequent sections of the script will execute these variables to upload the disks and create the VM.

    # storage account and key set to ENV to avoid typing it to each command
    $env:AZURE_STORAGE_ACCOUNT="STORAGE_ACCOUNT" This is the resource group you created in the Azure Portal.
    $env:AZURE_STORAGE_ACCESS_KEY="ACCESS_KEY" This is the multicharacter key you copied in a previous section. Paste the entire key between the quotation marks.
    $disk1Filename="SolarWinds-SEM-Azure-<SEM_VERSION>-disk1-system.vhd"
    $disk2Filename="SolarWinds-SEM-Azure-<SEM_VERSION>-disk2-data.vhd" The names of the system and data disk names will vary based on the SEM version. The system disk is much larger ~18GB - the data disk is typically ~1GB.
    $sku="Standard_LRS" This is the minimum requirement.
    $vmSize="Standard_B1s" This is the minimum requirement.
    $resourceGroup="PROSCRIPTIVE" This is the resource group you created in the Azure Portal.
    $vmLocation="LOCATION" For example, "eastus" for Eastern US.
    
    $disk1Name="SYSTEM-disk1" You can give these disks any descriptive name you like.
    $disk2Name="DATA-disk2"
    $vmName="VM-NAME" You can give the VM any descriptive name you like.
    				

    The only other value you need to add is the container name you wrote down in a previous section as shown below. No quotation marks needed.

    # upload system and data disks
    az storage blob upload --container-name CONTAINER NAME --type page --file $disk1Filename --name $disk1Name
    az storage blob upload --container-name CONTAINER NAME --type page --file $disk2Filename --name $disk2Name
    
    # get blob urls
    $blobUrlDisk1=az storage blob url --container-name CONTAINER NAME --name $disk1Name
    $blobUrlDisk2=az storage blob url --container-name CONTAINER NAME --name $disk2Name

  4. Launch Bash.
    Change the directory (cd) in Bash to the directory where the VHD files reside on your local system.
  5. Paste your script into Bash, and then press Enter.

    You can monitor the progress as the script is running. If the script encounters an error, such as a typo in your script, simply correct the error, and rerun the script.

    When completed, you can access your new VM in the Azure Portal under Home > Virtual machines.