Migrating from VMware Cloud Foundation for Classic to IBM Cloud Virtual Servers for VPC

Migrate VMs from VMware Cloud Foundation to IBM Cloud VPC: configure transit gateway, transfer disks with netcat, convert with virt-v2v, and deploy on VPC.

Objective

The following objectives are covered in the following tutorial.

  • Create a VPC and the resources that it needs.
  • Set up IBM Cloud for VMware Solutions instance with a Microsoft Windows® virtual server and an RHEL virtual server to use as migration examples.
  • Build a private connection between IBM Cloud for VMware Solutions and VPC through a Transit Gateway (TGW).
  • Move your virtual server disks into VPC block storage volumes.
  • Create virtual servers from the migrated disks.

Some VMware configuration steps, such as connecting your environment to VPC through a Transit Gateway, are different.

The virtual servers that are part of this tutorial have the following constraints:

  • They have a single disk size of less than 250 GB.
  • They are not Bring Your Own License (BYOL).
  • They access the internet to download the necessary packages to start the migration.

The following diagram illustrates what you build with this tutorial.

Virtualization Solutions VPC Migration Tutorial High-Level Architecture
Virtualization Solutions VPC Migration Tutorial High Level Architecture

Before you begin

This tutorial requires the following prerequisites.

  • An available VMware® vCenter Server® (VCS) instance.
  • Virtual Private Network (VPN) access to your VCS instance configured by using the instructions.
  • The correct access policies to manage VCS environments and the ability to create the following VCS resources. For more information, see Managing Identity and Access Management (IAM) access for VCS.
    • Virtual machines
    • Networks
    • Firewall rules
    • Network Address Translation (NAT) rules
    • Transit gateway connection groups
  • Verify that you have the correct access policies to manage VPCs and their resources so you can create the required VPC resources.
    • VPCs
    • Virtual servers
    • Security groups
    • Public gateways
    • Floating IPs

For more information, see Managing IAM access for VPC Infrastructure Services.

  • Verify that you have the correct access policies to manage Transit gateways (TGWs) so you can create the following TGW resources.
    • TGWs
    • TGW connections

For more information, see Using IAM permissions with IBM Cloud Transit Gateway.

Creating a VPC

Use the following steps to create and set up a VPC environment. The VPC hosts the migrated virtual servers and associated resources such as subnets, gateways, and security groups. The following information also includes resources that are used later in the migration process.

Before you begin, make sure that you're logged in to the IBM Cloud console.

  1. From the Navigation menu, go to Infrastructure > Network > VPCs, and then click Create.
  2. In the Location section, specify the following information:
    • For Geography, select North America.
    • For Region, select Dallas (us-south).
  3. In the Details section, for Name, enter vpc-migration.
  4. Deselect the Create a default prefix for each zone checkbox. The default prefix remains the same across VPCs and can introduce routing conflicts when multiple VPCs are connected to the same IBM Cloud classic infrastructure account.
  5. Click Create a virtual private cloud.
  6. Click the name of the VPC that you created.
  7. Select the Address prefixes tab.
  8. Create an address prefix of your choice for the Location us-south-1. Ensure that this address prefix does not overlap with prefixes that are used by other VPCs that are connected through IBM Cloud classic infrastructure using IBM Cloud Transit Gateway.
  9. From the Navigation menu, go to Infrastructure > Network > Subnets. Then, click Create.
  10. In the Location section, specify the following information:
    • For Geography, select North America.
    • For Region, select Dallas (us-south).
    • For Zone, select us-south-1.
  11. In the Details section, for Name, enter vpc-migration-sn-1, and select the new VPC for the Virtual private cloud.
  12. In the IP range selection section, select the address prefix that you created earlier. You can use the entire prefix for your subnet.
  13. Select the toggle to Attach a public gateway to your subnet. This enables your workloads to access the internet from the VPC.
  14. Click Create subnet.

Creating a virtual server

Use these steps to create a worker virtual server that is used to run migrations.

  1. From the Navigation menu, click Infrastructure > Network > Subnets.
  2. From the list of available resources, select vpc-migration-sn-1.
  3. Click Attached resources.
  4. In the Attached instances section, click Create.
  5. In the Location section, specify the following information:
    • For Geography, select North America.
    • For Region, select Dallas (us-south).
    • For Zone, select us-south-1.
  6. In the Details section, for Name, enter vpc-migration-vsi-worker.
  7. In the Server configuration section, specify the following information:
    • For Image, click Change image.
    • The Select an image form appears where you take the following actions:
      1. Search for Ubuntu.
      2. Select ibm-ubuntu-24-04-3-minimal-amd64-4 from the list of results and click Save.
    • For SSH keys, click Create an SSH key and in the Create an SSH key form, take the following actions:
      1. In the Details section, specify the following information:
        1. For Name, enter vpc-migration-ssh-key.
        2. For Select SSH key input method, select Generate a key pair for me.
      2. Click Create. The SSH private key is downloaded automatically.
  8. Click Create a virtual server.

Creating a Bastion virtual server

Create a Bastion virtual server to securely access the resources in the VPC.

  1. From the Navigation menu, click Infrastructure > Network > Subnets.
  2. From the list of available resources, select vpc-migration-sn-1.
  3. Click Attached resources.
  4. In the attached instances section, click Create.
  5. In the Location section, specify the following information:
    • For Geography, select North America.
    • For Region, select Dallas (us-south).
    • For Zone, select us-south-1.
  6. In the Details section, for Name, enter vpc-migration-vsi-bastion.
  7. In the server configuration section, specify the following information:
    • For Image, click Change image.
    • The Select an image form appears where you take the following actions:
      1. Search for ubuntu.
      2. Select ibm-ubuntu-24-04-3-minimal-amd64-4 from the list of results and click Save.
  8. For SSH keys, select vpc-migration-ssh-key.
  9. Click Create a virtual server.

Creating a floating IP

To access your bastion server from the internet, create a floating IP by completing the following steps.

  1. From the Navigation menu, go to Infrastructure > Compute > Virtual server instances.
  2. From the list of available resources, select vpc-migration-vsi-bastion.
  3. Click Networking.
  4. Click the Menu icon for the attached network interface.
    1. Click Edit floating IPs.
    2. In the Edit floating IPs form, click Attach
    3. In the Attach a floating IP form, click Reserve a new floating IP.
    4. In the Reserve a floating IP form, in the Details section:
      1. For Name, enter vpc-migration-fip.
      2. Click Reserve.
  5. Click Close to exit the menu.

Creating a security group

Security groups allow SSH connections to the Bastion virtual server.

Use the following steps to create a security group.

To improve your VPC security, the inbound rules in this security group must set an IP or CIDR as the Source type. This setting helps restrict the sources of traffic into its attached resources.

  1. From the Navigation menu, click Infrastructure > Network security groups, then click Create.

  2. In the Location section, specify the following information:

    • For Geography, select North America.
    • For Region, select Dallas (us-south).
    • For Zone, select us-south-1.
    • In the Details section, specify the following information:
      • For Name, enter vpc-migration-sg-bastion.
      • For Virtual private cloud, select vpc-migration.
  3. In the Inbound rules section, specify the following information:

    1. Click Create. In the Create inbound rule form, specify the following information:
      • For Protocol, select TCP.
      • For Port, select the Port range.
      • For Port min, enter 22.
      • For Port max, enter 22 and click Create.
    2. Click Create. In the Create inbound rule form, specify the following information:
      • For Protocol, select ICMP.
      • For Value, select Type and code.
      • For Type, enter 8.
      • For Code, keep empty and click Create.
  4. In the Attaching virtual server interfaces section, specify the following information:

    • Select the interface of the Bastion virtual server.
    • Click Create a security group.
  5. Get the IP of the Bastion virtual server:

    • From the Navigation menu, click Infrastructure > Compute > Virtual server instances.
    • Search for vpc-migration-vsi-bastion.
    • Copy the floating IP of the Bastion virtual server from the list of results.
  6. Get the IP of the worker virtual server:

    • From the Navigation menu, click Infrastructure > Compute > Virtual server instances.
    • Search for vpc-migration-vsi-worker.
    • Copy the reserved IP of the worker virtual server from the list of results.
  7. Copy the downloaded SSH private key to its default location.

    • On Windows, the default location is C:\Users\<YourUsername>\.ssh\id_rsa.
    • On Linux and macOS, the default location is ~/.ssh/id_rsa.
  8. Try to connect to the internet from the worker virtual server.

    • Use Secure Shell to log in to the worker virtual server by running the following command:

    ssh -J root@<BASTION_VSI_IP> root@<WORKER_VSI_IP>

    Where

    • <BASTION_VSI_IP> is the IP of the Bastion virtual server that you copied previously.

    • <WORKER_VSI_IP> is the IP of the worker virtual server that you copied previously.

    • Verify that you can reach Google by its domain name by running the following command:

    nslookup www.google.com

Setting up networking on a VCS instance

Use the following steps to configure networking in your IBM Cloud® for VMware Solutions environment to enable outbound internet access to install the required packages on the virtual servers.

  1. Find the credentials to NSX®.
    1. Log in to the IBM Cloud® console.
    2. From the Navigation menu, click VMware > Resources > VCF for Classic.
    3. From the list of available resources, select your VCS instance.
    4. Go to Access information.
    5. Under NSX Manager, copy http credentials and Fully Qualified Domain Name (FQDN).
  2. Find the available Internet Protocol (IP) address for private Source Network Address Translation (SNAT).
    1. Log in to the IBM Cloud console.
    2. From the Navigation menu, click VMware > Resources > VCF for Classic.
    3. From the list of available resources, select your VCS instance.
    4. Go to Infrastructure.
    5. Scroll down to the Network interface and click Private virtual local area network (VLAN).
    6. Find the subnet labeled Portable private subnet for customer workload edge.
      1. Note the IP addresses that are Reserved.
      2. Click the subnet and find an IP address that is Usable but does not exist in the Reserved list on the previous page.
      3. Copy this IP as it is used multiple times in the following steps.
  3. Create the NAT rules in the NSX User Interface (UI).
    1. Log in to the NSX UI.
    2. Go to the Networking tab.
    3. Click NAT under Network Services.
    4. For Gateway, select T1-workload-vcs-mf | Tier-1.
    5. Verify that you see an SNAT rule that is named T1-public-snat-workload-* that exists and is enabled.
      • Copy the IP address under Translated IP | Port. This IP address is used in later steps.
    6. Click ADD NAT RULE.
      1. For Name, enter T1-private-snat-workload.
      2. For Action, choose SNAT.
      3. For Source IP, enter 192.168.0.0/16.
      4. For Translated IP | Port, enter the IP that you chose in the previous step.
      5. For Enabled, choose No.
      6. Click SAVE.
  4. Create gateway firewall rules for T1 in NSX UI.
    1. Log in to the NSX UI.
    2. Go to the Security tab.
    3. Click Gateway Firewall under Policy management.
    4. For Gateway, select T1-workload-vcs-mf | Tier-1.
    5. Click the checkbox for Wkld_Drop_All_Policy_T1 and click + ADD RULE.
      1. For Name, enter allow 192.
      2. For Sources:
        1. Click the edit icon.
        2. Click IP addresses.
        3. Enter 192.168.0.0/16.
        4. Click APPLY.
      3. Click PUBLISH.
  5. Create gateway firewall rules for T0 in NSX UI.
    1. Log in to the NSX UI.
    2. Go to the Security tab.
    3. Click Gateway Firewall under Policy Management.
    4. For Gateway, select T0-workload-vcs-mf | Tier-0.
    5. Click the checkbox for Wkld_Drop_All_Policy_T0 and click + ADD RULE.
      1. For Name, enter allow 192.
      2. For Sources:
        1. Click the edit icon.
        2. Click IP addresses.
        3. Enter the two converted IP addresses that are saved from before.
        4. Click APPLY.
      3. Click PUBLISH.

Uploading the Ubuntu Server ISO into the VCS instance

Use the following steps to create a catalog in VCS and upload an Ubuntu® Server International Organization for Standardization (ISO) into it. This ISO is used later to start the virtual servers into a shell for disk migration.

  1. Go to Get Ubuntu Server and download the ISO of the most recent Long-Term Support (LTS) version of Ubuntu Server.
  2. Log in to the IBM Cloud console.
  3. Find the credentials to vCenter.
    1. Log in to the IBM Cloud console.
    2. From the Navigation menu, click VMware > Resources > VCF for Classic.
    3. From the list of available resources, select your VCS instance.
    4. Go to Access information.
    5. Under vCenter, copy ADMIN credentials.
  4. Log in to vCenter and upload the ISO image.
    1. From the vCenter UI, click the icon in the upper left next to vSphere Client and choose inventory.
    2. Click the data store icon.
    3. Click management-share or vsanDatastore depending on your VCS instance type.
    4. Make sure that the root folder is highlighted and click UPLOAD FILES.
    5. Choose the Ubuntu ISO.
    6. Click Open.
    7. Wait for the operation to finish.
    8. If you see a certificate error:
      1. Click the host in the error message and accept the certificate.

Creating the Windows and RHEL virtual servers

Use the following steps to create Microsoft Windows® and Red Hat® Enterprise Linux® (RHEL) virtual servers in VCS. These servers are migrated to the Virtual Private Cloud (VPC).

  1. Find the credentials to vCenter®.
    1. Log in to the IBM Cloud console.
    2. From the Navigation menu, click VMware > Resources > VCF for Classic.
    3. From the list of available resources, select your VCS instance.
    4. Go to Access information.
    5. Under vCenter, copy ADMIN credentials.
  2. Log in to vCenter and deploy your Windows virtual server that is named vm-win22 in your VCS instance.
    1. Make sure your Network Interface Card (NIC) is connected to the 192.168.0.0/16 NSX segment.
  3. Open a Web Console window to the Windows virtual server.
    1. From the vCenter UI, click the icon in the upper left next to vSphere Client and choose inventory.
    2. Find and click vm-win22.
    3. Click Launch Web Console and in the Web Console window, log in with Administrator credentials.
  4. Try to reach the internet from the Windows virtual server.
    1. From the Web Console window, do the following actions:
      1. Open Microsoft Edge®.
      2. Go to the Google home page.
      3. Verify that the page loads.
    2. Close the Web Console window.
  5. Log in to vCenter and deploy your RHEL virtual server that is named vm-rhel9 in your VCS instance.
    • Make sure that your NIC is connected to the 192.168.0.0/16 NSX segment.
  6. Open a Web Console window to the RHEL virtual server.
    1. From the vCenter UI, click the icon in the upper left next to vSphere Client and choose inventory.
    2. Find and click vm-rhel9.
    3. Click Launch Web Console and in the Web Console window, log in with root credentials.
  7. Try to reach the internet from the RHEL virtual server.
    1. From the Web Console window, verify that you can resolve Google's domain name by running the following command:

      nslookup www.google.com
      
    2. Close the Web Console window.

Getting the ISO for the Windows virtIO drivers into the Windows virtual server

Use the following steps to obtain and transfer the ISO that contains the Windows virtIO drivers. These drivers help ensure compatibility with IBM Cloud VPC. This ISO file on the Windows virtual server is used to fix the Windows recovery image in a later step.

  1. Find the credentials to vCenter.

    1. Log in to the IBM Cloud console.
    2. From the Navigation menu, click VMware > Resources > VCF for Classic.
    3. From the list of available resources, select your VCS instance.
    4. Go to Access information.
    5. Under vCenter, copy ADMIN credentials.
  2. Log in to vCenter and deploy your RHEL virtual server that is named vm-rhel9-tmp in your VCS instance.

    • Make sure that your NIC is connected to the 192.168.0.0/16 NSX segment.
  3. Open a Web Console window to the temporary RHEL virtual server.

    1. From the vCenter UI, click the icon in the upper left next to vSphere Client and choose inventory.
    2. Find and click vm-rhel9-tmp.
    3. Click Launch Web Console and in the Web Console window, log in with root credentials.
    4. Make sure that your RHEL is registered.
  4. Install the virtio-win package on the RHEL virtual server.

    1. From the Web Console window, run the following command to install the package:

      dnf install -y virtio-win
      
  5. Get the IP address of the temporary RHEL virtual server.

    1. From the vCenter UI, click the icon in the upper left next to vSphere Client and choose inventory.
    2. Find and click vm-rhel9-tmp.
    3. Under virtual machine Details, look for IP addresses and copy the 192.x.x.x address.
  6. Copy the virtIO drivers ISO into the Windows virtual server.

    1. From the vCenter UI, click the icon in the upper left next to vSphere Client and choose inventory.

    2. Find and click vm-win22.

    3. Click Launch Web Console and in the Web Console window, log in with Administrator credentials.

    4. Open the command prompt and copy the ISO from the RHEL virtual server by running the following command:

      scp root@<TEMP_RHEL_VM_IP>:/usr/share/virtio-win/virtio-win.iso C:\virtio-win.iso
      

      Where <TEMP_RHEL_VM_IP> is the IP address of the temporary RHEL virtual server that you previously copied.

      When prompted whether you trust the remote server, enter y and enter the password of the temporary RHEL virtual server.

  7. Keep the temporary RHEL virtual server and the virtio-win.iso file together, as they will be used later to transfer the ISO to the worker virtual server after VPC connectivity is established.

Getting the cloud-init installer for the Windows virtual server

The Windows virtual server also needs Cloud-init installed on it to run as a virtual server in your VPC. Use the following steps to obtain the installer from the internet.

  1. Find the credentials to vCenter.
    1. Log in to the IBM Cloud console.
    2. From the Navigation menu, click VMware > Resources > VCF for Classic.
    3. From the list of available resources, select your VCS instance.
    4. Go to Access information.
    5. Under vCenter, copy ADMIN credentials.
  2. Open a Web Console window to the Windows virtual server.
    1. From the vCenter UI, click the icon in the upper left next to vSphere Client and choose inventory.
    2. Find and click vm-win22.
    3. Click Launch Web Console and in the Web Console window, log in with Administrator credentials.
  3. Download the cloud-init installer.
    1. From the Web Console window:
      1. Open Microsoft Edge.
      2. Go to the download page for the installer. The download starts automatically.
    2. Close the Web Console window.

Setting up a transit gateway (private connection) between the VCS instance and VPC

Use the following steps to create a transit gateway to securely connect your VCS instance and VPC over the IBM Cloud private network.

  1. Log in to the IBM Cloud console.
  2. Create a transit gateway.
    1. From the Navigation menu, click Infrastructure > Network > Transit gateway.
    2. Click Create.
    3. In the Configuration section, specify the following information:
      1. For Name, enter vpc-migration-tgw.
    4. In the Location section, specify the following information:
      1. For Routing option, select Local routing.
      2. For Location, select Dallas (us-south).
      3. Click Create.
  3. Connect the VPC to the transit gateway.
    1. From the Navigation menu, click Infrastructure > Network > Transit gateway.
    2. From the list of available resources, select vpc-migration-tgw.
    3. Click Add connection and within the form, specify the following information:
      1. For Network connection, select VPC.
      2. For Connection reach, select Add a new connection to this account.
      3. For Region, select Dallas (us-south).
      4. For Available connections, select vpc-migration.
      5. Click Add.
  4. Connect the VCS instance to the transit gateway.
    1. Find the subnet for the VCS instance.
      1. Log in to the IBM Cloud console.
      2. From the Navigation menu, click VMware > Resources > VCF for Classic.
      3. From the list of available resources, select your VCS instance.
      4. Click the Infrastructure tab.
      5. Click the cluster where the virtual machine that you are migrating is located in the list of clusters.
      6. Scroll down to Network interface and find the subnet labeled Portable private subnet for customer workload edge.
      7. Record the Classless Inter-Domain Routing (CIDR) notation. For this document, it is referred to as <CIDR>.
    2. Update transit gateway with the VCS subnet.
      1. Log in to the IBM Cloud console.
      2. From the Navigation menu, click Infrastructure > Network > Transit gateway.
      3. From the list of available resources, select vpc-migration-tgw.
      4. Click Add connection and within the form, specify the following information:
        1. For Network connection, select Classic infrastructure.
        2. For Connection reach, select Add a new connection to this account.
        3. Click Prefix filtering (optional).
        4. Click Create a prefix filter.
          1. For Action, choose Permit.
          2. For Network, enter <CIDR>. <CIDR> is the name of the subnet that you found previously.
          3. Click Save.
          4. Click Add.
  5. Create a security group to allow traffic between the virtual server on the VPC environment and the VCS instance.
    1. From the Navigation menu, click Infrastructure > Network > Security groups.
    2. Click Create.
    3. In the Location section, specify the following information:
      1. For Geography, select North America.
      2. For Region, select Dallas (us-south).
    4. In the Details section, specify the following information:
      1. For Name, enter vpc-migration-sg-tgw.
      2. For Virtual private cloud, select vpc-migration.
    5. In the Inbound rules section, specify the following information:
      1. Click Create and within the form, specify the following information:
        1. For Protocol, select Any protocol.
        2. For Source type, select IP or CIDR.
        3. For Source, enter <CIDR>. <CIDR> is the name of the subnet that you found previously.
        4. Click Create.
    6. In the Attaching virtual server interfaces section, select the interface of the worker virtual server and click Create a security group.

Getting the ISO for the Windows virtIO drivers into the worker virtual server

Use the following steps to obtain and transfer the ISO that contains the Windows virtIO drivers onto the worker virtual server. These drivers help ensure compatibility with IBM Cloud VPC. This ISO file on the worker virtual server is used to facilitate disk image conversion in a later step.

  1. Find the credentials to vCenter.

    1. Log in to the IBM Cloud console.
    2. From the Navigation menu, click VMware > Resources > VCF for Classic.
    3. From the list of available resources, select your VCS instance.
    4. Go to Access information.
    5. Under vCenter, copy ADMIN credentials.
  2. Get the IP address of the temporary RHEL virtual server.

    1. From the vCenter UI, click the icon in the upper left next to vSphere Client and choose inventory.
    2. Find and click vm-rhel9-tmp.
    3. Under virtual machine details, look for IP addresses and copy the 192.x.x.x address.
  3. Copy the virtIO drivers ISO into the worker virtual server.

    1. Secure Shell (SSH) into the worker virtual server.

      ssh -J root@<BASTION_VSI_IP> root@<WORKER_VSI_IP>
      
    2. SCP over the virtio drivers ISO file.

      scp root@<TEMP_RHEL_VM_IP>:/usr/share/virtio-win/virtio-win.iso /root/virtio-win.iso
      

      Where <TEMP_RHEL_VM_IP> is the IP address of the temporary RHEL virtual server that you previously copied.

      When prompted whether you trust the remote server, enter yes and enter the password of the temporary RHEL virtual server.

Preparing the Windows virtual server for migration

Before you can migrate the virtual server, you must install the necessary drivers and configure Cloud-init on the Windows virtual server. Use the following steps to prepare the Windows virtual server for migration.

  1. Find the credentials to vCenter.

    1. Log in to the IBM Cloud console.
    2. From the Navigation menu, click VMware > Resources > VCF for Classic.
    3. From the list of available resources, select your VCS instance.
    4. Go to Access information.
    5. Under vCenter, copy ADMIN credentials.
  2. Open a Web Console window to the Windows virtual server.

    1. From the vCenter UI, click the icon in the upper left next to vSphere Client and choose inventory.
    2. Find and click vm-win22.
    3. Click Launch Web Console and in the Web Console window, log in with Administrator credentials.
  3. Install the virtIO drivers on the recovery image of the Windows virtual server by following the steps that are in Making the virtio-win drivers available in the recovery image. Use the command prompt, not PowerShell to run the commands noted in the linked documentation. The driver files added to the recovery image come from mounting the C:\virtio-win.iso file that was copied over to the Windows virtual server in an earlier step.

    Keep in mind that if your virtual server has a GPT partition table, you must set the partition IDs to UUIDs, not numbers. Get the correct IDs by displaying the details of the System and Recovery partitions while diskpart is running. For more information, see the documentation on the detail partition command.

    If your virtual server does not show any files in the recovery drive after you assign a drive letter to the recovery partition, check the C:\Windows\System32\Recovery folder. The Winre.wim file only appears after you disable reagentc. The file is still hidden and can only be viewed by using the dir /a command.

  4. Install and configure Cloud-init on the Windows virtual server.

    1. From the Web Console window, open the File Explorer.
    2. Click Downloads.
    3. Double-click the Cloud-init installer file that you downloaded previously and follow the prompts to install the package. Make sure that you use Administrator for the name of the Cloud-init user, not Admin.
    4. After the installation finishes, in the installation wizard, do not check any boxes to run sysprep. Click finish.
    5. Modify the Cloud-init configuration files by following the steps that are in Customizing a virtual server. Do not run the sysprep steps, stop after you modify the files.
  5. Shut down the Windows virtual server and close the Web Console.

Preparing the RHEL virtual server for migration

You need to configure the RHEL virtual server with virtIO drivers and Cloud-init to prepare it for migration. The installation of the RHEL virtIO drivers depends on whether they are included in the kernel or whether they need to load as modules. These steps assume that the drivers need to be loaded and that they aren't loaded.

Use the following information to prepare the RHEL virtual server for migration.

  1. Log in to the IBM Cloud console.

  2. Find the credentials to vCenter.

    1. Log in to the IBM Cloud console.
    2. From the Navigation menu, click VMware > Resources > VCF for Classic.
    3. From the list of available resources, select your VCS instance.
    4. Go to Access information
    5. Under vCenter, copy ADMIN credentials.
  3. Log in to vCenter and open a Web Console window to the virtual server named vm-rhel9.

  4. Install Cloud-init on the RHEL virtual server.

    1. From the Web Console window, install cloud-init by running the following command:

      dnf install -y cloud-init
      
  5. Delete the existing network configuration on the RHEL virtual server to help ensure that it gets configured correctly when it starts.

    1. From the Web Console window:
      1. Delete the files that are in /etc/sysconfig/network-scripts by running the following command:

        rm /etc/sysconfig/network-scripts/*
        
      2. Delete the files that are in /etc/NetworkManager/system-connections by running the following command:

        rm /etc/NetworkManager/system-connections/*
        
      3. Open /etc/sysconfig/network and delete any lines where GATEWAYDEV is set.

  6. Delete the existing Red Hat Subscription Manager configuration to help ensure that the virtual server gets reregistered when it starts.

    1. From the Web Console window, delete /etc/rhsm/facts/uuid_override.facts by running the following command:

      rm /etc/rhsm/facts/uuid_override.facts
      
    2. Close the Web Console window.

  7. Power off the RHEL virtual server.

    1. From the vCenter UI, click the icon in the upper left next to vSphere Client and choose inventory.
    2. Find vm-rhel9, right-click, and choose Power > Power Off.

Starting the netcat server for migration

Use the following steps to migrate the Windows virtual server by transferring its boot disk to a block storage volume in VPC and create a virtual server from it.

When the virtual server starts, Cloud-init runs and the administrator password resets.

  1. Log in to the IBM Cloud console.

  2. Create a detached Windows boot volume.

    1. From the Navigation menu, click Infrastructure > Network > Subnets.
    2. From the list of available resources, select vpc-migration-sn-1.
    3. Click Attached resources
    4. In the Attached instances section, click Create.
    5. In the Location section, specify the following information:
      • For Geography, select North America.
      • For Region, select Dallas (us-south).
      • For Zone, select us-south-1.
    6. In the Details section, for Name, enter vpc-migration-vsi-win22.
    7. In the Server configuration section, specify the following information:
      1. For Image, click Change image.
      2. Within the Select an image form, specify the following information:
        1. Search for windows.
        2. From the list of results, select ibm-windows-server-2022-full-standard-amd64-32 and click Save.
      3. For SSH keys, select vpc-migration-ssh-key.
    8. In the Storage section, click the edit icon that is next to the item for the boot volume. Within the Edit boot volume form, specify the following information:
      1. In the Details section, specify the following information:
        1. For Name, enter vpc-migration-vsi-win22-boot-volume
        2. Set Auto-delete to disabled
      2. In the Profiles section, select General purpose
      3. In the Storage capacity section, for Storage size, enter a value that is greater than or equal to the storage size of the Windows virtual server and click Save.
    9. Click Create a virtual server.
    10. From the Navigation menu, click > Infrastructure > Compute > Virtual server instances.
    11. From the list of available resources, select vpc-migration-vsi-win22 and click Delete.
    12. Within the Delete virtual server instance form, specify the following information:
      1. Enter Delete into the input.
      2. Click Delete.
  3. Attach the boot volume to the worker virtual server by specifying the following information:

    1. From the Navigation menu, click Infrastructure > Storage > Block storage volumes.
    2. From the list of available resources, select vpc-migration-vsi-win22-boot-volume.
    3. In the Attached virtual server section, click Attach.
    4. Within the Attach to a virtual server form, from the list of virtual servers, select **vpc-migration-vsi-worker, and click Attach.
  4. SSH into the worker virtual server by running the command that you used previously.

  5. Get the name of the block device for the attached boot volume by running the following command:

    lsblk -n -d -o NAME | tail -n 1

  6. Start the Netcat server, wait for an incoming disk transfer, and write it to the attached boot volume by running the following command:

    nc -l 31337 | gunzip | dd of=/dev/<DEV_NAME> bs=16M status=progress

    Where

    <DEV_NAME> is the name of the block device that you found previously.

Allowing VCS instance onto the private network

  1. Enable SNAT rule to allow from VCS instance to VPC.

    1. Find the credentials to NSX.
      1. Log in to the IBM Cloud console.
      2. From the Navigation menu, click VMware > Resources > VCF for Classic.
      3. From the list of available resources, select your VCS instance.
      4. Go to Access information.
      5. Under NSX Manager, copy http credentials and FQDN (Fully Qualified Domain Name).
    2. Disable public SNAT rule.
      1. Log in to the NSX UI.
      2. Go to the Networking tab.
      3. Click NAT under Network Services.
      4. For Gateway, select T1-workload-vcs-mf | Tier-1.
      5. Verify that you see an SNAT rule that is named T1-public-snat-workload-* that exists and is disabled.
    3. Enable private SNAT rule.
      1. Log in to the NSX UI.
      2. Go to the Networking tab.
      3. Click NAT under Network Services.
      4. For Gateway, select T1-workload-vcs-mf | Tier-1.
      5. Verify that you see an SNAT rule that is named T1-private-snat-workload-* that exists and is enabled.
  2. Get the IP address range of the VPC subnet.

    1. From the Navigation menu, click Infrastructure > Network > Subnets.
    2. From the list of available resources, select vpc-migration-sn-1.
    3. Copy the value of the IP range.
  3. Open a Web Console window to the RHEL virtual server.

  4. Try to reach an IP address in the VPC subnet from the VCS instance.

    1. From the Web Console window, verify that you can ping the worker virtual server by running the following command:

      ping <WORKER_VSI_IP>
      

      Where <WORKER_VSI_IP> is the IP address of the worker virtual server that you copied previously.

    2. Close the Web Console window.

  5. Try to reach an IP address in the routed VCS network from the VPC.

    1. SSH into the worker virtual server by running the command that you used previously.
    2. Verify that you can ping the gateway of the routed VCS network.
    3. Find the gateway of <CIDR> and try to ping the IP address. <CIDR> is the name of the subnet that you found previously.

Migrating the Windows virtual server

  1. Find the credentials to vCenter.

    1. Log in to the IBM Cloud console.
    2. From the Navigation menu, click VMware > Resources > VCF for Classic.
    3. From the list of available resources, select your VCS instance.
    4. Go to Access information.
    5. Under vCenter, copy ADMIN credentials.
  2. Get the IP address of the Windows virtual server.

    1. From the vCenter UI, click the icon in the upper left next to vSphere Client and choose inventory.
    2. Find and click vm-win22.
    3. Under virtual machine details, look for IP addresses and copy the 192.x.x.x address.
  3. Start into an Ubuntu Server shell from the Windows virtual server.

    1. From the vCenter UI, click the icon in the upper left next to vSphere Client® and choose inventory.
    2. Find vm-win22, right-click, and choose Edit Settings.
      1. Expand CD/DVD drive 1.
        1. For CD/DVD drive 1, click the dropdown and choose data store ISO File.
          1. For the Select File screen, select management-share or vsanDatastore depending on your VCS instance type.
          2. Choose the Ubuntu ISO that was downloaded earlier.
        2. For Status, click the checkbox for Connect At Power On.
        3. Click OK.
      2. Click OK.
    3. From the vCenter UI, find vm-win22, right-click, and choose Power > Power On.
    4. Click Launch Web Console. Within the Web Console window, specify the following information:
      1. Choose Extensible Firmware Interface (EFI) VMware Virtual Integrated Drive Electronics (IDE) CD-ROM Drive.
      2. Choose Try or Install Ubuntu Server.
      3. Wait for the language selection screen to load.
      4. Choose Help.
      5. Choose enter shell.
  4. Configure networking on the Ubuntu Server that is running on the Windows virtual server.

    1. Within the Web Console window, add an IP address to the primary network interface by running the following command:

      ip addr add <WINDOWS_VM_IP>/24 dev ens192
      

      Where <WINDOWS_VM_IP> is the IP address of the Windows virtual server that you copied previously.

    2. Add a default route through the routed Virtual Data Center (VDC) network by running the following command:

      ip route add default via 192.168.0.1
      
  5. Transfer the disk of the Windows virtual server to the worker virtual server.

    1. Within the Web Console window, start the transfer of the Windows virtual server disk by running the following command:

      dd if=/dev/sda bs=16M status=progress | gzip | nc -v <WORKER_VSI_IP> 31337
      

      Where <WORKER_VSI_IP> is the IP address of the worker virtual server that you copied previously.

    2. Wait for the transfer to complete. You can monitor the progress of the transfer from either the Ubuntu Server shell or the worker virtual server.

      Both the Netcat client and server commands might not stop after the transfer completes. If they don't stop, you need to manually interrupt them.

    3. Close the Web Console window.

  6. On the worker virtual server, fix the partition table on the attached boot volume by moving the partition table to the correct position on the disk by running the following command:

    sgdisk --move-second-header /dev/<DEV_NAME>
    

    Where <DEV_NAME> is the name of the block device that you found previously.

  7. Flush the buffers of the attached boot volume by running the following command:

    blockdev --flushbufs /dev/<DEV_NAME>
    

    Where <DEV_NAME> is the name of the block device that you found previously.

  8. Install utilities to use the virt-v2v-in-place tool.

    apt-get install -y virt-v2v
    apt-get install -y rhsrvany
    
  9. Make a symlink to the mounted Windows boot volume. The virtual server name here corresponds to the example Windows virtual server name that was created in this document. If a virtual server of a different name is being migrated, use the name of that virtual server instead for the VM_NAME variable.

    VM_NAME=vm-win22
    TARGET_DEV=/dev/<DEV_NAME>
    SYMLINK="/tmp/${VM_NAME}-sda"
    ln -fs "${TARGET_DEV}" "${SYMLINK}"
    ls -l "${SYMLINK}"
    

    Where <DEV_NAME> is the name of the block device that you found previously.

  10. Run virt-v2v-in-place. The virtio-win.iso file that is copied over from an earlier step is referenced with the VIRTIO_WIN variable here.

    export LIBGUESTFS_BACKEND=direct
    export VIRTIO_WIN=/root/virtio-win.iso
    virt-v2v-in-place -i disk "${SYMLINK}" --block-driver virtio-scsi -v
    
  11. Make sure that the conversion was successful.

Check that the return code is 0. The following command displays 0 if the conversion was successful:

  echo $?

If the `virt-v2v-in-place` command was not successful, the image on the mounted boot volume is in an indeterminate state. Check the output for any error messages. Any issue needs to be resolved first. Afterwards, the data from the source Windows virtual server needs to be re-transferred to the mounted boot volume on the worker virtual server before retrying the `virt-v2v-in-place` command.
  1. Log in to the IBM Cloud console.
  2. Create a Windows virtual server from the attached boot volume.
    1. From the Navigation menu, click Infrastructure > Storage > Block storage volumes.
    2. From the list of available resources, select vpc-migration-vsi-win22-boot-volume.
    3. In the Attached virtual server section, click the Detach icon next to the name of the worker virtual server.
    4. Wait for the worker virtual server to detach.
    5. In the Attached virtual server section, click Attach. Within the Attach to the virtual server form, specify the following information:
      1. Click Create server.
      2. Click Attach as boot volume.
      3. In the Location section, specify the following information:
        1. For Geography, select North America.
        2. For Region, select Dallas (us-south).
        3. For Zone, select us-south-1.
      4. In the Details section, specify the following information:
        1. For Name, enter vpc-migration-vsi-win22.
      5. In the Server configuration section, for SSH Keys, select vpc-migration-ssh-key.
      6. Click Create a virtual server.
  3. Get the IP address of the Windows virtual server.
    1. From the Navigation menu, click Infrastructure > Compute > Virtual server instances.
    2. Search for vpc-migration-vsi-win22.
    3. Copy the reserved IP address of the Windows virtual server from the list of results.
  4. Log in to the Windows virtual server.
    1. Display the Remote Desktop Protocol (RDP) port of the Windows virtual server through the bastion virtual server by running the following command:

      ssh -L 3389:<WINDOWS_VSI_IP>:3389 <BASTION_VSI_IP> -l root -N
      

      Where <WINDOWS_VSI_IP> is the IP address of the Windows virtual server that you copied previously and <BASTION_VSI_IP> is the IP address of the bastion virtual server that you copied previously.

    2. Use your preferred Remote Desktop client to connect to the Windows virtual server. Use localhost as the IP address and log in as Administrator with the password of the Windows virtual server.

Creating the boot disk for the RHEL virtual server

Use the following information to transfer a RHEL virtual server disk to your VPC and create a virtual server from the migrated disk.

When the virtual server starts, Cloud-init runs and the root password resets.

  1. Log in to the IBM Cloud console.

  2. Create a detached RHEL boot volume by specifying the following information:

    1. From the Navigation menu, click Infrastructure > Network > Subnets.
    2. From the list of available resources, select vpc-migration-sn-1.
    3. Click Attached resources
    4. In the Attached instances section, click Create.
    5. In the Location section, specify the following information:
      • For Geography, select North America.
      • For Region, select Dallas (us-south).
      • For Zone, select us-south-1.
    6. In the Details section, for Name, enter vpc-migration-vsi-rhel9.
    7. In the Server configuration section, specify the following information:
      1. For Image, click Change image.
      2. From the Select an image form, specify the following information:
        1. Search for Red Hat.
        2. Select ibm-redhat-9-6-minimal-amd64-5 from the list of results and click Save.
      3. For SSH keys, select vpc-migration-ssh-key.
    8. In the Storage section, click the Edit icon that is next to the item for the boot volume.
    9. Within the Edit boot volume form, specify the following information:
      1. In the Details section, specify the following information:
        1. For Name, enter vpc-migration-vsi-rhel9-boot-volume
        2. Set Auto-delete to Disabled
      2. In the Profiles section, select General purpose.
      3. In the Storage capacity section, for Storage size, enter a value that is greater than or equal to the storage size of the RHEL virtual server and click Save.
    10. Click Create a virtual server.
    11. From the Navigation menu, click Infrastructure > Compute > Virtual server instances.
    12. From the list of available resources, select vpc-migration-vsi-rhel9.
    13. Click Delete. In the Delete virtual server instance form,
      1. Enter Delete into the input.
      2. Click Delete.
  3. Attach the boot volume to the worker virtual server by specifying the following information:

    1. From the Navigation menu, click Infrastructure > Storage > Block storage volumes.
    2. In the list of available resources, click vpc-migration-vsi-rhel9-boot-volume.
    3. In the Attached virtual server section, click Attach.
    4. Within the Attach to a virtual server form, from the list of virtual servers, select vpc-migration-vsi-worker, and click Attach.
  4. SSH into the worker virtual server by running the command that you used previously.

  5. Get the name of the block device for the attached boot volume by running the following command:

    lsblk -n -d -o NAME | tail -n 1

  6. Start the Netcat server, wait for an incoming disk transfer, then write it to the attached boot volume by running the following command:

    nc -l 31337 | gunzip | dd of=/dev/<DEV_NAME> bs=16M status=progress

    Where <DEV_NAME> is the name of the block device that you found previously.

Understanding Block Storage for VPC volumes

Before you migrate the RHEL virtual server, understand the Block Storage for IBM Cloud VPC volumes that this migration uses:

  • Boot volumes: The volumes that are created in this tutorial are boot volumes that contain the operating system. Boot volumes are attached automatically when you create the instance and can range from 10 GB to 32,000 GB, depending on the profile that you use.
  • Volume profiles: This tutorial uses Block Storage for IBM Cloud VPC volumes. You can choose from traditional tiered profiles (3iops-tier, 5iops-tier, 10iops-tier) or the SDP (defined performance) profile for custom IOPS and throughput.
  • Volume encryption: All volumes are encrypted by default with IBM-managed encryption. You can also use customer-managed encryption with your own root keys.
  • Volume limits: Each account can create up to 300 volumes per region, and each virtual server instance can have up to 12 attached data volumes, plus one boot volume.
  • Performance: Each volume has dedicated performance allocation, which helps prevent noisy neighbor issues that are common in shared storage environments.

For more information, see About Block Storage for VPC.

Migrating the RHEL virtual server

  1. Go to the vCenter portal.

  2. Get the IP address of the RHEL virtual server.

    1. From the vCenter UI, click the icon in the upper left next to vSphere Client and choose inventory.
    2. Find and click vm-rhel9.
    3. Under virtual machine Details, look for IP addresses and copy the 192.x.x.x address.
  3. Start into an Ubuntu Server shell from the RHEL virtual server.

    1. From the vCenter UI, click the icon in the upper left next to vSphere Client and choose inventory.
    2. Find vm-rhel9, right-click, and choose Edit Settings.
      1. Expand CD/DVD drive 1.
        1. For CD/DVD drive 1, click the dropdown and choose data store ISO file.
          1. For the Select File screen, select management-share or vsanDatastore depending on your VCS instance type.
          2. Choose the Ubuntu ISO that was downloaded earlier.
        2. For Status, click the checkbox for Connect At Power On.
        3. Click OK.
      2. Click OK.
    3. From the vCenter UI, find vm-rhel9, right-click, and choose Power > Power On.
    4. Click Launch Web Console. Within the Web Console window, specify the following information:
      1. Choose EFI VMware Virtual IDE CD-ROM Drive (Extensible Firmware Interface VMware Virtual Integrated Drive Electronics CD-ROM Drive).
      2. Choose Try or Install Ubuntu Server.
      3. Wait for the language selection screen to load.
      4. Choose Help.
      5. Choose enter shell.
  4. Configure networking on the Ubuntu Server that is running on the RHEL virtual server.

    1. Within the Web Console window, add an IP address to the primary network interface by running the following command:

      ip addr add <RHEL_VM_IP>/24 dev ens192
      

      Where <RHEL_VM_IP> is the IP address of the RHEL virtual server that you copied previously.

    2. Add a default route through the routed VCS network by running the following command:

      ip route add default via 192.168.0.1
      
  5. Transfer the disk of the RHEL virtual server to the worker virtual server.

    1. Within the Web Console window, start the transfer of the RHEL virtual server disk by running the following command:

      dd if=/dev/sda bs=16M status=progress | gzip | nc -v <WORKER_VSI_IP> 31337
      

      Where <WORKER_VSI_IP> is the IP address of the worker virtual server that you copied previously.

    2. Wait for the transfer to complete. You can monitor the progress of the transfer from either the Ubuntu Server shell or the worker virtual server.

      Both the Netcat client and server commands might not stop after the transfer completes. If they don't stop, you need to manually interrupt them.

    3. Close the Web Console window.

  6. On the worker virtual server, fix the partition table on the attached boot volume by moving the partition table to the correct position on the disk by running the following command:

    sgdisk --move-second-header /dev/<DEV_NAME>

    Where

    <DEV_NAME> is the name of the block device that you found previously.

  7. Flush the buffers of the attached boot volume by running the following command:

    blockdev --flushbufs /dev/<DEV_NAME>

    Where

    <DEV_NAME> is the name of the block device that you found previously.

Starting the RHEL virtual server

Use the following steps to create a RHEL virtual server from the attached boot volume.

  1. Log in to the IBM Cloud console.

  2. From the Navigation menu, click Infrastructure > Storage > Block storage volumes.

  3. From the list of available resources, find and click vpc-migration-vsi-rhel9-boot-volume.

  4. In the Attached virtual server section, click the Detach icon next to the name of the worker virtual server. wait for the worker virtual server to detach.

  5. In the Attached virtual server section, click Attach. Within the Attach to the virtual server form, specify the following information:

    1. Click Create server
    2. Click Attach as boot volume.
    3. In the Location section, specify the following information:
      • For Geography, select North America.
      • For Region, select Dallas (us-south).
      • For Zone, select us-south-1.
    4. In the Details section, for Name, enter vpc-migration-vsi-rhel9.
    5. In the Server configuration section, for SSH Keys, select vpc-migration-ssh-key.
    6. Click Create a virtual server.
  6. Get the IP of the RHEL virtual server by specifying the following information:

    1. From the Navigation menu, click Infrastructure > Compute > Virtual server instances.
    2. Search for vpc-migration-vsi-rhel9.
    3. From the list of results, copy the reserved IP of the RHEL virtual server.
  7. Log in to the new RHEL virtual server

    • SSH into the RHEL virtual server by running the following command:

    ssh -J root@<BASTION_VSI_IP> root@<RHEL_VSI_IP>

    Where

    • <BASTION_VSI_IP> is the IP of the Bastion virtual server that you copied previously.
    • <RHEL_VSI_IP> is the IP of the RHEL virtual server that you copied previously.

Next steps

Now that you successfully migrated your workloads to VPC, see the following resources to learn how to develop your VPC by migrating or adding more virtual servers and other resources.