IBM Cloud Docs
Migrating a virtual server from the Classic infrastructure

Migrating a virtual server from the Classic infrastructure

You can migrate a virtual server instance from the Classic infrastructure to meet the IBM Cloud VPC infrastructure requirements. Then, you can create an image template from the instance and deploy it in the VPC environment.

Migrating a virtual server instance from the Classic infrastructure isn't supported for LinuxONE (s390x processor architecture).

Before you begin

Before you begin, make sure that the following prerequisites are fulfilled.

Migrating a virtual server from the Classic infrastructure

Complete the following steps to migrate an image template that is associated with a virtual server in the Classic infrastructure to the IBM Cloud VPC infrastructure. When the custom image is available in IBM Cloud VPC, you can use it to create a virtual server.

The following list is an overview of the migration steps.

  1. For the virtual server that you want to migrate to IBM Cloud VPC infrastructure, create an image template. The image template must be created before you proceed with the following migration steps.
  2. From the image template, provision a virtual server that you want to use as the backup instance.
  3. Customize the backup virtual server to make sure that it meets the requirements to deploy in IBM Cloud VPC.
  4. Create an image template of your modified virtual server.
  5. Export the image template to IBM Cloud Object Storage.
  6. Import the custom image to the IBM Cloud VPC infrastructure.
  7. Use the custom image to create a virtual server in IBM Cloud VPC.

For more information about using shell scripts to migrate a virtual server, see vpc-tutorials.

Step 1 - Identifying the virtual server to migrate and create an image template

You can create an image template from a virtual server in the Classic infrastructure that you want to migrate to the IBM Cloud VPC infrastructure. The image template captures an image of the existing virtual server. Make sure that you understand the following information about image templates.

  • Only image templates with a single primary boot volume (or disk) and associated files can be imported to IBM Cloud VPC infrastructure.
  • The image template includes the operating system on the primary boot disk and the items that you installed, such as PHP or Python. The image template can be between 10 GB and 250 GB of data. Images under 10 GB are rounded up to 10 GB.
  • When you use the imported custom image in IBM Cloud VPC to create a virtual server, you can select a new profile, assign an SSH key, specify user data, and configure network interfaces.

Secondary disks and their associated files for an image template aren't supported when an image template is imported as a custom image to IBM Cloud VPC.

Complete the following steps to create an image template for the virtual server that you want to migrate.

  1. From the Dashboard in IBM Cloud console, create an image template by clicking Navigation menu Menu icon > Classic Infrastructure > Devices > Device List.
  2. Click the virtual server that you want to use.
  3. From the Actions menu, select Create Image Template. Make sure to name it something you can easily recognize. For more information, see Creating an image template.

Step 2 - Locate the image template and provision a virtual server

From the image template that you created, provision a virtual server. This instance is a backup. You can customize this backup virtual server to meet the requirements of IBM Cloud VPC.

Complete the following steps to create a new virtual server from the image template.

  1. Click Devices > Manage > Images to locate the image template that you created.
  2. Provision a virtual server from the image template by clicking the Actions icon Actions icon for the image template and selecting Order Public virtual server instance.

Step 3 - Customize the virtual server for IBM Cloud VPC

Complete the following customizations to prepare your image for the IBM Cloud VPC infrastructure. Some of the customization requirements might already be met on your Classic infrastructure virtual server instance.

Customizing a Linux virtual server

Follow the instructions in Creating a Linux custom image to customize on your Linux instance. Your instance needs to meet the following requirements.

  • The following arguments are present on the kernel command line: nomodeset, nofb, vga=normal, console=ttyS0.
  • Virtio drivers are installed, plus any code that is needed by Virtio.
  • Your image is cloud-init enabled.
  • For any auxiliary storage volumes that are mounted, you must include the fstab entry nofail.

Customizing a Windows instance

Complete the following customizations on your Windows virtual server to prepare the image for IBM Cloud VPC.

  1. Use Remote Desktop to access your Classic Windows server.

  2. Download and install the Windows VirtIO drivers in this server. The virtio-win driver files can be taken from an existing IBM Cloud VPC VPC virtual server by using the following steps.

    Microsoft recommends that you obtain the drivers from a licensed RHEL version 8 or 9 instance because drivers that are obtained from Red Hat are certified by Microsoft. The minimum recommended Red Hat virtio-win package version is virtio-win-1.9.24. However, using the most recent package is best.

    The Red Hat virtio-win-1.9.24 ISO contains the following specific driver versions.

    100.84.104.19500 oem10.inf \vioprot.inf_amd64_af0659efdaba9e4b\vioprot.inf
    100.90.104.21400 oem11.inf \viofs.inf_amd64_c6f785e21f3f6f80\viofs.inf
    100.85.104.20200 oem12.inf \viogpudo.inf_amd64_b19dcf9947e73e5a\viogpudo.inf
    100.85.104.19900 oem13.inf \vioinput.inf_amd64_4505a789e17b5f89\vioinput.inf
    100.81.104.17500 oem14.inf \viorng.inf_amd64_ef304eab276a3e61\viorng.inf
    100.85.104.19900 oem15.inf \vioser.inf_amd64_cb4783c018c10eba\vioser.inf
    100.90.104.21500 oem2.inf  \vioscsi.inf_amd64_02a46a7a223648d1\vioscsi.inf
    100.90.104.21500 oem3.inf  \viostor.inf_amd64_520417bbc533faba\viostor.inf
    100.85.104.20700 oem4.inf  \balloon.inf_amd64_afa8c93081df5458\balloon.inf
    100.90.104.21400 oem5.inf  \netkvm.inf_amd64_0efff05c07fcee39\netkvm.inf
    100.85.104.19900 oem6.inf  \pvpanic.inf_amd64_b7028360ef636f8b\pvpanic.inf
    10.0.0.21000     oem9.inf  \qxldod.inf_amd64_6199f9ecf2339133\qxldod.inf
    
    1. Obtain the required virtio-win drivers by provisioning or accessing an existing RHEL virtual server in IBM Cloud VPC.

    2. On your RHEL virtual server that you provisioned in IBM Cloud VPC, install the virtio-win package by running the following command. In this example, the virtio-win package is installed on RHEL version 8.

      yum install virtio-win
      ```      {: pre}
      
      The output looks like the following example.
      
      ```text {: screen}
      Installed: virtio-win-1.9.24-2.el8_5.noarch
      
    3. Access the virtio-win ISO in the /usr/share/virtio-win directory.

      cd /usr/share/virtio-win/
      
    4. Use the WinSCP utility to copy the virtio-win ISO file, such as virtio-win-1.9.24.iso from the RHEL VPC server to the Classic Windows server.

    5. Locate the downloaded ISO and double-click it to mount it.

    6. From the mounted ISO, run virtio-win-guest-tools.exe and complete the installation.

      1. Locate the downloaded ISO and double-click it to mount it.
      2. From the mounted ISO, run virtio-win-guest-tools.exe and complete the installation.
  3. Install and configure cloudbase-init from Cloudbase-Init installation package.

  4. Modify the cloudbase-init.conf file (C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf) to match the following values. Don't remove any other content from the file.

    [DEFAULT]
    #  "cloudbase-init.conf" is used for every boot
    config_drive_types=vfat,iso
    config_drive_locations=hdd,partition
    activate_windows=true
    kms_host=kms.adn.networklayer.com:1688
    mtu_use_dhcp_config=false
    real_time_clock_utc=false
    bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
    mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\
    debug=true
    log_dir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\
    log_file=cloudbase-init.log
    default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN
    local_scripts_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts\
    metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService,
    # enabled plugins - executed in order
    plugins=cloudbaseinit.plugins.common.mtu.MTUPlugin,
              cloudbaseinit.plugins.windows.ntpclient.NTPClientPlugin,
              cloudbaseinit.plugins.windows.licensing.WindowsLicensingPlugin,
              cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin,
              cloudbaseinit.plugins.common.userdata.UserDataPlugin,
              cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin
    

    If you plan to bring your own license for your custom image, remove the following lines from the cloudbase-init.conf file.

    activate_windows=true
    kms_host=kms.adn.networklayer.com:1688
    
  5. Modify the cloudbase-init-unattend.conf file (C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init-unattend.conf) to match the following values. Don't remove any other content from the file.

    [DEFAULT]
    #  "cloudbase-init-unattend.conf" is used during the Sysprep phase
    username=Administrator
    inject_user_password=true
    first_logon_behaviour=no
    config_drive_types=vfat
    config_drive_locations=hdd
    allow_reboot=false
    stop_service_on_exit=false
    mtu_use_dhcp_config=false
    bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
    mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\
    debug=true
    log_dir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\
    log_file=cloudbase-init-unattend.log
    default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN
    local_scripts_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts\
    metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService,
    # enabled plugins - executed in order
     plugins=cloudbaseinit.plugins.common.mtu.MTUPlugin,
              cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,
              cloudbaseinit.plugins.windows.createuser.CreateUserPlugin,
              cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin,
              cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin,
              cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin
    
  6. Modify the Unattend.xml file (C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\Unattend.xml) and set the PersistAllDeviceInstalls value to false.

  7. Run Sysprep by using the following command from the command prompt.

    C:\Windows\System32\Sysprep\Sysprep.exe /oobe /generalize /shutdown "/unattend:C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\Unattend.xml"
    

    This command shuts down the system.

Step 4 - Creating an image template of your customized virtual server

When your customizations are complete on your backup virtual server, create a new image template by using the following steps.

  1. From the Dashboard in IBM Cloud console, click menu Menu icon > Classic Infrastructure > Devices > Device List to create an image template.
  2. Click the backup virtual server that you previously customized.
  3. From the Actions menu, select Create Image Template. The image template must be created before you can proceed with the following steps.

Step 5 - Exporting the image template to IBM Cloud Object Storage

To export the image template that you created from the modified virtual server to IBM Cloud Object Storage, complete the following steps.

  1. Locate the new image template that you created on the Image Templates page by clicking Devices > Manage > Images.
  2. From the Image Templates page, click ... for the image template that you want to export and select Export to IBM Cloud Object Storage. For more information, see Exporting an image to IBM Cloud Object Storage.

Step 6 - Importing the custom image to the IBM Cloud VPC infrastructure

  1. In the IBM Cloud console, click Navigation menu icon Menu icon > VPC Infrastructure VPC icon > Compute > Images.
  2. On the Custom images tab, click Import Custom Image. For more information, see Importing a custom image.

Step 7 - Using a custom image to create a virtual server in IBM Cloud VPC

When the image that you imported is available on the Custom images tab of the Images for VPC page, you can use it to create a virtual server instance in the IBM Cloud VPC infrastructure.

  1. On the Custom images tab, find the name of the custom image that you imported, click Actions More Actions icon, and select New virtual server.
  2. In IBM Cloud console, go to Navigation menu icon menu icon > VPC Infrastructure VPC icon > Compute > Virtual server instances.
  3. On the Virtual server instances page, click Actions More Actions icon. Stop and then start the virtual server before you access it.
  4. Create inbound and outbound security groups to give access to the RDP traffic port 3389. For more information, see Setting up a security group for your resource.
  5. To generate a password to allow access to Windows and RDP with a floating IP, see Connecting to Windows instances.