Azure Virtual Machine Scale Sets (VMSS) bieten die Möglichkeit, eine Gruppe identischer
VMs bereitzustellen und zu verwalten. Die Anzahl der VMs kann basierend auf konfigurierbaren
Skalierungsregeln automatisch erhöht oder verringert werden. Für weitere Informationen
siehe Was sind Virtual Machine Scale Sets in Azure?
Sie können Ihr VMSS so einrichten, dass es ein Basis-VM-Image enthält, das den Agenten
vorinstalliert und voraktiviert hat. Wenn das VMSS hochskaliert, enthalten die neuen
VM-Instanzen im Skalierungsset automatisch den Agenten.
Um den Agenten zu Ihrem VMSS hinzuzufügen:
Schritt 1: Fügen Sie Ihr Azure-Abonnement zu Cloud-Konten hinzu
Trend Micro empfiehlt, Ihr Azure-Abonnement mit Cloud Accounts zu verbinden. Durch die Verbindung mit Cloud-Konten erhalten Sie Zugriff auf die
neuesten Cloud-Sicherheitsfunktionen, die in Trend Vision One verfügbar sind. Zusätzlich überwacht Server- und Workload Protection Ihre Azure-Instanzen und kann virtuelle Maschinen sowohl zu Computers als auch zu Endpoint Inventory automatisch hinzufügen oder entfernen, wenn Sie Ihr Skalierungsset erweitern oder
verkleinern. Instanzen, die individuell zu Server- und Workload Protection hinzugefügt werden, werden beim Verkleinern nicht automatisch aus dem Inventar entfernt.
Server- und Workload Protection fügt Azure-Instanzen zu Ihren Inventarlisten hinzu, unabhängig davon, ob die VMs
einen Agenten installiert haben oder nicht. Die Instanzen, die keinen Agenten installiert
haben, haben den Status Kein Agent. Nachdem Sie den Agenten auf Ihren Instanzen installiert
und aktiviert haben, ändert sich der Status zu Verwaltet (Online).
Weitere Informationen zum Hinzufügen von Azure-Abonnements finden Sie unter Azure-Abonnements verbinden und aktualisieren.
Schritt 2: Bereiten Sie ein Bereitstellungsskript vor
Sie können das Bereitstellungsskript für die Trend Vision One Endpunkt-Sicherheitsagent mit Server- und Workload Protection-Funktionen von Endpoint Inventory konfigurieren und herunterladen. Für weitere Informationen zur Verwendung des Bereitstellungsskripts
siehe Bereitstellungsskript ausführen.
Die folgenden Informationen dienen nur als Referenz.
In Server- und Workload Protection bereiten Sie ein Bereitstellungsskript vor. Anweisungen finden Sie unter Bereitstellungsskripts verwenden, um Computer hinzuzufügen und zu schützen. Dieses Bereitstellungsskript wird in einer benutzerdefinierten Skripterweiterung
referenziert, die Sie als Nächstes konfigurieren.
Um ein benutzerdefiniertes Skript mit dem folgenden VMSS-Skript auszuführen, muss
das Skript in Azure Blob Storage oder an einem anderen Ort gespeichert werden, der
über eine gültige URL zugänglich ist. Anweisungen zum Hochladen einer Datei in Azure
Blob Storage finden Sie unter Azure Blob Storage-Operationen mit Azure PowerShell durchführen.
Schritt 3: Fügen Sie den Agenten über eine benutzerdefinierte Skripterweiterung zu Ihren VMSS-Instanzen hinzu
Im Folgenden finden Sie Beispiele, wie Sie PowerShell verwenden, um den Agenten hinzuzufügen:
- Beispiel 1 zeigt, wie man eine neue VMSS erstellt, die den Agenten enthält
- Beispiel 2 zeigt, wie der Agent zu einem bestehenden VMSS hinzugefügt wird
Beide Beispiele:
- Verwenden Sie das Cmdlet
Add-AzureRmVmssExtension, um eine Erweiterung zum VMSS hinzuzufügen - Verwenden Sie Azure PowerShell Version 5.1.1
Anweisungen zum Erstellen eines neuen VMSS mit PowerShell-Cmdlets finden Sie in diesem Microsoft-Tutorial. Für die Linux-Plattform siehe https://github.com/Azure/custom-script-extension-linux.
Beispiel 1: Erstellen Sie ein neues VMSS, das den Agenten enthält
$resourceGroupName = <The resource group of the VMSS>
$vmssname = <The name of the VMSS>
# Create ResourceGroup
New-AzureRmResourceGroup -ResourceGroupName $resourceGroupName -Location EastUS
# Create a config object
$vmssConfig = New-AzureRmVmssConfig `
-Location EastUS `
-SkuCapacity 2 `
-SkuName Standard_DS2 `
-UpgradePolicyMode Automatic
# Define the script for your Custom Script Extension to run on the Windows Platform
$customConfig = @{
"fileUris" = (,"A URL of your copy of deployment script, ex. deploymentscript.ps1");
"commandToExecute" = "powershell -ExecutionPolicy Unrestricted -File deploymentscript.ps1"
}
# Define the script for your Custom Script Extension to run on the Linux Platform
#$customConfig = @{
# "fileUris" = (,"A URL of your copy of deployment script, ex. deploymentscript.sh");
# "commandToExecute" = "bash deploymentscript.sh"
#}
# The section is required only if deploymentscript has been located within Azure StorageAccount
$storageAccountName = <StorageAccountName if deploymentscript is locate in Azure Storage>
$key = (Get-AzureRmStorageAccountKey -Name $storageAccountName -ResourceGroupName $resourceGroupName).Value[0]
$protectedConfig = @{
"storageAccountName" = $storageAccountName;
"storageAccountKey" = $key
}
# Use Custom Script Extension to install the agent (Windows)
Add-AzureRmVmssExtension -VirtualMachineScaleSet $vmssConfig `
-Name "customScript" `
-Publisher "Microsoft.Compute" `
-Type "CustomScriptExtension" `
-TypeHandlerVersion 1.8 `
-Setting $customConfig `
-ProtectedSetting $protectedConfig
# Use Custom Script Extension to install the agent (Linux)
#Add-AzureRmVmssExtension -VirtualMachineScaleSet $vmssConfig `
# -Name "customScript" `
# -Publisher "Microsoft.Azure.Extensions" `
# -Type "customScript" `
# -TypeHandlerVersion 2.0 `
# -Setting $customConfig `
# -ProtectedSetting $protectedConfig
# Create a public IP address
# Create a frontend and backend IP pool
# Create the load balancer
# Create a load balancer health probe on port 80
# Create a load balancer rule to distribute traffic on port 80
# Update the load balancer configuration
# Reference a virtual machine image from the gallery
# Set up information for authenticating with the virtual machine
# Create the virtual network resources
# Attach the virtual network to the config object
# Create the scale set with the config object (this step might take a few minutes)
New-AzureRmVmss `
-ResourceGroupName $resourceGroupName `
-Name $vmssname `
-VirtualMachineScaleSet $vmssConfig
Beispiel 2: Fügen Sie den Agenten zu einem vorhandenen VMSS hinzu
$resourceGroupName = <The resource group of the VMSS>
$vmssname = <The name of the VMSS>
# Get the VMSS model
$vmssobj = Get-AzureRmVmss -ResourceGroupName $resourceGroupName -VMScaleSetName $vmssname
# Show model data if you prefer
# Write-Output $vmssobj
# Define the script for your Custom Script Extension to run on the Windows platform
$customConfig = @{
"fileUris" = (,"A URL of your copy of deployment script, ex. deploymentscript.ps1");
"commandToExecute" = "powershell -ExecutionPolicy Unrestricted -File deploymentscript.ps1"
}
# Define the script for your Custom Script Extension to run on the Linux platform
#$customConfig = @{
# "fileUris" = (,"A URL of your copy of deployment script, ex. deploymentscript.sh");
# "commandToExecute" = "bash deploymentscript.sh"
#}
# The section is required only if deploymentscript has been located within Azure StorageAccount
$storageAccountName = <StorageAccountName if deploymentscript is locate in Azure Storage>
$key= (Get-AzureRmStorageAccountKey -Name $storageAccountName -ResourceGroupName $resourceGroupName).Value[0]
$protectedConfig = @{
"storageAccountName" = $storageAccountName;
"storageAccountKey" = $key
}
# Use Custom Script Extension to install the agent (Windows)
$newvmssobj = Add-AzureRmVmssExtension `
-VirtualMachineScaleSet $vmssobj `
-Name "customScript" `
-Publisher "Microsoft.Compute" `
-Type "CustomScriptExtension" `
-TypeHandlerVersion 1.8 `
-Setting $customConfig `
-ProtectedSetting $protectedConfig
# Use Custom Script Extension to install the agent (Linux)
#$newvmssobj = Add-AzureRmVmssExtension `
# -VirtualMachineScaleSet $vmssobj `
# -Name "customScript" `
# -Publisher "Microsoft.Azure.Extensions" `
# -Type "customScript" `
# -TypeHandlerVersion 2.0 `
# -Setting $customConfig `
# -ProtectedSetting $protectedConfig
# Update the virtual machine scale set model
Update-AzureRmVmss -ResourceGroupName $resourceGroupName -name $vmssname -VirtualMachineScaleSet $newvmssobj -Verbose
# Get Instance ID for all instances in this VMSS, and decide which instance you'd like to update
# Get-AzureRmVmssVM -ResourceGroupName $resourceGroupName -VMScaleSetName $vmssname
# Now start updating instances
# If upgradePolicy is Automatic in the VMSS, do NOT execute the next command Update-AzureRmVmssInstance. Azure will auto-update the VMSS.
# There's no PowerShell command to update all instances at once. But you could refer to the output of Update-AzureRmVmss, and loop all instances into this command.
Update-AzureRmVmssInstance -ResourceGroupName $resourceGroupName -VMScaleSetName $vmssname -InstanceId 0
