{{site.data.keyword.attribute-definition-list}}
Migrating a virtual server from the Classic infrastructure
You can migrate a virtual server instance from the Classic infrastructure to meet the {{site.data.keyword.vpc_short}} infrastructure requirements. Then, you can create an image template from the instance and deploy it in the VPC environment.
Deprecated 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.
- You must have an instance of {{site.data.keyword.cos_full}} available.
- You must create an authorization so that the Image Service for VPC can access images in {{site.data.keyword.cos_full_notm}}. For more information, see Granting access to {{site.data.keyword.cos_full_notm}} to import images.
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 {{site.data.keyword.vpc_short}} infrastructure. When the custom image is available in {{site.data.keyword.vpc_short}}, you can use it to create a virtual server.
The following list is an overview of the migration steps.
- For the virtual server that you want to migrate to {{site.data.keyword.vpc_short}} infrastructure, create an image template. The image template must be created before you proceed with the following migration steps.
- From the image template, provision a virtual server that you want to use as the backup instance.
- Customize the backup virtual server to make sure that it meets the requirements to deploy in {{site.data.keyword.vpc_short}}.
- Create an image template of your modified virtual server.
- Export the image template to {{site.data.keyword.cos_full_notm}}.
- Import the custom image to the {{site.data.keyword.vpc_short}} infrastructure.
- Use the custom image to create a virtual server in {{site.data.keyword.vpc_short}}.
For more information about using shell scripts to migrate a virtual server, see vpc-tutorials. For more information about migrating from Classic to {{site.data.keyword.vpc_short}}, see Getting started with VPC+ Cloud Migration.
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 {{site.data.keyword.vpc_short}} 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 {{site.data.keyword.vpc_short}} 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 {{site.data.keyword.vpc_short}} 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 {{site.data.keyword.vpc_short}}.
Complete the following steps to create an image template for the virtual server that you want to migrate.
- From the Dashboard in {{site.data.keyword.cloud_notm}} console, create an image template by clicking Navigation menu
> Infrastructure > Classic Infrastructure > Devices > Device List.
- Click the virtual server that you want to use.
- 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 {{site.data.keyword.vpc_short}}.
Complete the following steps to create a new virtual server from the image template.
- Click Devices > Manage > Images to locate the image template that you created.
- Provision a virtual server from the image template by clicking the Actions icon
for the image template and selecting Order Public virtual server instance.
Step 3 - Customize the virtual server for {{site.data.keyword.vpc_short}}
Complete the following customizations to prepare your image for the {{site.data.keyword.vpc_short}} 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 {{site.data.keyword.vpc_short}}.
-
Use Remote Desktop to access your Classic Windows server.
-
Download and install the Windows VirtIO drivers in this server. The
virtio-windriver files can be taken from an existing {{site.data.keyword.vpc_short}} 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.24ISO 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-
Obtain the required virtio-win drivers by provisioning or accessing an existing RHEL virtual server in {{site.data.keyword.vpc_short}}.
-
On your RHEL virtual server that you provisioned in {{site.data.keyword.vpc_short}}, install the
virtio-winpackage 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 -
Access the virtio-win ISO in the
/usr/share/virtio-windirectory.cd /usr/share/virtio-win/ -
Use the WinSCP utility to copy the
virtio-winISO file, such asvirtio-win-1.9.24.isofrom the RHEL VPC server to the Classic Windows server. -
Locate the downloaded ISO and double-click it to mount it.
-
From the mounted ISO, run
virtio-win-guest-tools.exeand complete the installation.- Locate the downloaded ISO and double-click it to mount it.
- From the mounted ISO, run
virtio-win-guest-tools.exeand complete the installation.
-
-
Install and configure cloudbase-init from Cloudbase-Init installation package.
-
Modify the
cloudbase-init.conffile (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.LocalScriptsPluginIf you plan to bring your own license for your custom image, remove the following lines from the
cloudbase-init.conffile.activate_windows=true kms_host=kms.adn.networklayer.com:1688 -
Modify the
cloudbase-init-unattend.conffile (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 -
Modify the
Unattend.xmlfile (C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\Unattend.xml) and set thePersistAllDeviceInstallsvalue tofalse. -
Run
Sysprepby 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.
- From the Dashboard in {{site.data.keyword.cloud_notm}} console, click menu
> Infrastructure > Classic Infrastructure > Devices > Device List to create an image template.
- Click the backup virtual server that you previously customized.
- 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 {{site.data.keyword.cos_full_notm}}
To export the image template that you created from the modified virtual server to {{site.data.keyword.cos_full_notm}}, complete the following steps.
- Locate the new image template that you created on the Image Templates page by clicking Devices > Manage > Images.
- 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 {{site.data.keyword.cos_full_notm}}.
Step 6 - Importing the custom image to the {{site.data.keyword.vpc_short}} infrastructure
- In the {{site.data.keyword.cloud_notm}} console, click Navigation menu icon
> Infrastructure
> Compute > Images.
- 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 {{site.data.keyword.vpc_short}}
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 {{site.data.keyword.vpc_short}} infrastructure.
- On the Custom images tab, find the name of the custom image that you imported, click Actions
, and select New virtual server.
- In {{site.data.keyword.cloud_notm}} console, go to Navigation menu icon
> Infrastructure
> Compute > Virtual server instances.
- On the Virtual server instances page, click Actions
. Stop and then start the virtual server before you access it.
- 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.
- To generate a password to allow access to Windows and RDP with a floating IP, see Connecting to Windows instances.