Azure仮想マシンスケールセット (VMSS) を使用すると、同一のVMのセットをデプロイおよび管理できます。 VMの数は、設定可能なスケーリングルールに基づいて自動的に増減できます。詳細については、 Azureの仮想マシン スケール セットとは何ですか?
エージェントが事前にインストールされ、有効化されたベース仮想マシンイメージを含めるようにVMSSを設定できます。 VMSSがスケールアップすると、スケールセット内の新しいVMインスタンスに自動的にエージェントが追加されます。
AgentをVMSSに追加するには:
ステップ 1: (推奨) AzureサブスクリプションをCloud Accountsに追加する
トレンドマイクロは[クラウドアカウント]を使用してAzureサブスクリプションを接続することを推奨します。Cloud Accountsに接続することで、Trend Vision Oneで利用可能な最新のCloud Security機能にアクセスできます。さらに、Server & Workload ProtectionはAzureインスタンスを監視し、スケールセットのスケールアップやスケールダウンに応じて[コンピュータ]および[Endpoint Inventory]から仮想マシンを自動的に追加または削除できます。Server & Workload Protectionに個別に追加されたインスタンスは、スケールダウン時にインベントリから自動的に削除されません。
Server & Workload Protectionは、VMにエージェントがインストールされているかどうかに関係なく、Azureインスタンスをインベントリリストに追加します。エージェントがインストールされていないインスタンスのステータスはNo Agentです。インスタンスにエージェントをインストールしてアクティベートすると、ステータスはManaged (Online)に変わります。
Azureサブスクリプションの追加について詳しくは、Azure サブスクリプションの接続と更新をご覧ください。
手順2: 配信スクリプトを準備する
![]() |
重要[Endpoint Inventory]からServer & Workload Protection機能を備えたTrend Vision One Endpoint Securityエージェントのデプロイメントスクリプトを構成およびダウンロードできます。デプロイメントスクリプトの使用に関する詳細は、デプロイメントスクリプトの使用を参照してください。
以下の情報は参照情報としてのみ使用してください。
|
Server & Workload Protectionでデプロイメントスクリプトを準備します。手順については、デプロイメントスクリプトを使用してコンピュータを追加および保護するを参照してください。このデプロイメントスクリプトは、次に構成するカスタムスクリプト拡張機能で参照されます。
![]() |
注意次のVMSSスクリプトを使用してカスタムスクリプトを実行するには、スクリプトがAzure Blob Storageまたは有効なURLを介してアクセス可能なその他の場所に格納されている必要があります。
Azure Blob Storageにファイルをアップロードする手順については、「 Azure PowerShellを使用してAzure BLOBストレージの操作を実行する。
|
手順3: カスタムスクリプト拡張機能を使用してエージェントをVMSSインスタンスに追加する
次に、PowerShellを使用してAgentを追加する方法に関する例を示します。
両方の例:
- を使用します。 Add-AzureRmVmssExtensionコマンドレットVMSSに拡張機能を追加するには
- Azure PowerShell 5.1.1を使用します。
![]() |
注意PowerShellコマンドレットを使用して新しいVMSSを作成する手順については、このMicrosoftチュートリアルを参照してください。Linuxプラットフォームについては、https://github.com/Azure/custom-script-extension-linuxを参照してください。
|
例1:エージェントを含む新しいVMSSを作成する
$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
例2: 既存のVMSSにエージェントを追加する
$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