Azure híbrido e migração 5 min de leitura

Validate a migrated server before closing the change

Este artigo ainda não foi traduzido — está a ver a versão em inglês.

Nesta página
  1. Use the generated IaC as the validation baseline
  2. Verify the server state against the baseline
  3. Use post-migration scripts to automate verification
  4. Final verification steps

The migration is complete, the server is running, and the change ticket is open. Closing it without verification is a common risk. A migrated server is not the same as the source machine; it has a new identity, a different storage layout, and potentially altered network configuration. You need a concrete way to confirm that the Azure VM matches the intended state before you sign off.

The most reliable approach is to use the Infrastructure as Code (IaC) templates generated by Azure Migrate as the source of truth. These templates define the landing zone and the application structure. You can then use post-migration scripts to verify that the actual state of the server aligns with that definition.

Use the generated IaC as the validation baseline

Azure Migrate can generate IaC templates for assessed workloads. These templates create an application landing zone in Azure. The process starts with a workload or application assessment in Azure Migrate. Once the assessment is complete, you select Generate IaC at the top of the report Redeploy servers to Azure using Infrastructure as Code.

The portal redirects you to the IaC generation flow. You review the workloads and select the application you want to generate code for. You can generate code for only one application at a time Redeploy servers to Azure using Infrastructure as Code. The feature currently supports a basic three-tier design with frontend, backend, and database layers. This architecture includes Cloud Adoption Framework (CAF)-aligned security best practices Redeploy servers to Azure using Infrastructure as Code.

After you select Generate Code, the portal creates the IaC and automatically adds the selected workloads. You download a ZIP file, extract it, and explore the generated code in an IDE like Visual Studio Code Redeploy servers to Azure using Infrastructure as Code. The VM configuration details are saved in a vm_config.json file, which is automatically generated from your assessment data Redeploy servers to Azure using Infrastructure as Code.

This vm_config.json file is your baseline. It defines the intended state of the server. You can use it to verify that the migrated server has the correct configuration.

Verify the server state against the baseline

Once the server is migrated, you need to check that it matches the baseline. The migration process depends on your scenario, such as lift-and-shift, agentless, or agent-based migration Redeploy servers to Azure using Infrastructure as Code.

For Windows servers, Azure Migrate makes some changes automatically during the replication or migration process. For example, it sets the SAN policy to Online All for machines running Windows Server 2008 R2 or later Prepare machines for migration with Azure Migrate. However, you should verify that the drive letters are preserved. You can do this by checking the SAN policy on the migrated server.

On the on-premises or Azure VMware Solution VM, you can open an elevated command prompt and enter diskpart. Then enter SAN. If the drive letter of the guest operating system isn’t maintained, Offline All or Offline Shared is returned Prepare machines for migration with Azure Migrate. You can set the SAN policy to Online All to ensure that disks are brought online and that you can read and write to both disks Prepare machines for migration with Azure Migrate.

For Linux servers, Azure Migrate completes some actions automatically for specific versions, such as Red Hat Enterprise Linux 8.x, Ubuntu 20.04, and SUSE 15 Prepare machines for migration with Azure Migrate. For other versions, you need to prepare the machines manually. You should verify that the Hyper-V Linux Integration Services are installed, the Azure Serial Console logging is enabled, and the device map file is updated Prepare machines for migration with Azure Migrate.

Use post-migration scripts to automate verification

Azure Migrate provides a disk migration script that you can use to detach the data disk from the migrated VM. This script generates a disk-config.json file, which contains the disk’s Infrastructure as Code (IaC) details Redeploy servers to Azure using Infrastructure as Code. You can use this file to verify that the disk configuration matches the baseline.

To use the script, you need to copy the disk-config.json file into the folder that contains your Application IaC code. Then, you need to update the terraform.tfvars file in the Application IaC folder. Uncomment the line disk_config_file = "./disk-config.json" to link the disk configuration to your application deployment Redeploy servers to Azure using Infrastructure as Code.

You can then follow the instructions in the readme.md file included with the Application IaC package to re-apply the script. This step ensures that the disk changes are incorporated and that your migration is completed successfully Redeploy servers to Azure using Infrastructure as Code.

Final verification steps

Before you close the change, you should perform the following verification steps:

  1. Check the VM configuration: Compare the vm_config.json file with the actual configuration of the migrated server. Verify that the VM has the correct size, OS, and network settings.
  2. Check the disk configuration: Use the disk-config.json file to verify that the disk configuration matches the baseline. Ensure that the data disk is attached and that the drive letters are correct.
  3. Check the application state: Verify that the application is running correctly on the migrated server. Check the logs and performance metrics to ensure that the application is performing as expected.
  4. Check the connectivity: Verify that you can connect to the migrated server using the appropriate method (e.g., RDP for Windows, SSH for Linux). Ensure that the network settings are correct and that the server is accessible from the required locations.

By following these steps, you can ensure that the migrated server is configured correctly and that the migration is successful. This approach helps you avoid common pitfalls and ensures that the server is ready for production use.

Prerequisites

Expected Verification

  • The vm_config.json file matches the actual server configuration.
  • The disk-config.json file matches the actual disk configuration.
  • The application is running correctly and is accessible.

Cleanup

This approach ensures that you have a concrete way to validate the migrated server before closing the change. It helps you avoid common pitfalls and ensures that the server is ready for production use.

Pesquisar