Поделиться через


Move resources in a Maintenance Control configuration to another region

Применимо к: ✔️ Виртуальные машины Linux ✔️ Виртуальные машины Windows ✔️ Гибкие группы масштабирования ✔️ Унифицированные группы масштабирования

Follow this article to move resources associated with a Maintenance Control configuration to a different Azure region. Может потребоваться переместить конфигурацию по ряду причин. Например, чтобы воспользоваться преимуществами нового региона, развернуть функции или службы, доступные в определенном регионе, для удовлетворения требований внутренней политики и управления или в ответ на планирование емкости.

Управление обслуживанием с настраиваемыми конфигурациями обслуживания позволяет управлять применением обновлений платформы к виртуальным машинам и к выделенным узлам Azure. Существует несколько сценариев для перемещения управления обслуживанием в разных регионах:

  • To move the resources associated with a maintenance configuration, but not the configuration itself, follow this article.
  • To move your maintenance control configuration, but not the resources associated with the configuration, follow these instructions.
  • To move both the maintenance configuration and the resources associated with it, first follow these instructions. Then, follow the instructions in this article.

Предпосылки

Before you begin moving the resources associated with a Maintenance Control configuration:

  • Make sure that the resources you're moving exist in the new region before you begin.
  • Verify the Maintenance Control configurations associated with the Azure VMs and Azure Dedicated Hosts that you want to move. Check each resource individually. There's currently no way to retrieve configurations for multiple resources.
  • When retrieving configurations for a resource:
    • Make sure you use the subscription ID for the account, not an Azure Dedicated Host ID.
    • CLI: The --output table parameter is used for readability only, and can be deleted or changed.
    • PowerShell: The Format-Table Name parameter is used for readability only, and can be deleted or changed.
    • If you use PowerShell, you get an error if you try to list configurations for a resource that doesn't have any associated configurations. The error will be similar to: "Operation failed with status: 'Not Found'. Details: 404 Client Error: Not Found for url".

Подготовка к переносу

  1. Before you start, define these variables. We've provided an example for each.

    Переменная Сведения Пример
    $subId ID for subscription containing the maintenance configurations "our-subscription-ID"
    $rsrcGroupName Resource group name (Azure VM) "VMResourceGroup"
    $vmName VM resource name "myVM"
    $adhRsrcGroupName Resource group (Dedicated hosts) "HostResourceGroup"
    $adh Dedicated host name "myHost"
    $adhParentName Parent resource name "HostGroup"
  2. To retrieve the maintenance configurations using the PowerShell Get-AZConfigurationAssignment command:

    • For Azure Dedicated Hosts, run:

      Get-AzConfigurationAssignment -ResourceGroupName $adhRsrcGroupName -ResourceName $adh -ResourceType hosts -ProviderName Microsoft.Compute -ResourceParentName $adhParentName -ResourceParentType hostGroups | Format-Table Name
      
    • For Azure VMs, run:

      Get-AzConfigurationAssignment -ResourceGroupName $rgName -ResourceName $vmName -ProviderName Microsoft.Compute -ResourceType virtualMachines | Format-Table Name
      
  3. To retrieve the maintenance configurations using the CLI az maintenance assignment command:

    • For Azure Dedicated Hosts:

      az maintenance assignment list --subscription $subId --resource-group $adhRsrcGroupName --resource-name $adh --resource-type hosts --provider-name Microsoft.Compute --resource-parent-name $adhParentName --resource-parent-type hostGroups --query "[].{HostResourceGroup:resourceGroup,ConfigName:name}" --output table
      
    • For Azure VMs:

      az maintenance assignment list --subscription $subId --provider-name Microsoft.Compute --resource-group $rsrcGroupName --resource-name $vmName --resource-type virtualMachines --query "[].{HostResourceGroup:resourceGroup, ConfigName:name}" --output table
      

Move

  1. Follow these instructions to move the Azure VMs to the new region.
  2. After the resources are moved, reapply maintenance configurations to the resources in the new region as appropriate, depending on whether you moved the maintenance configurations. You can apply a maintenance configuration to a resource using PowerShell or CLI.

Verify the move

Verify resources in the new region, and verify associated configurations for the resources in the new region.

Очистка исходных ресурсов

After the move, consider deleting the moved resources in the source region.

Дальнейшие действия

Follow these instructions if you need to move maintenance configurations.