Migration onboarding#

You can migrate infrastructure from your own data center or from another provider’s cloud to K2 Cloud. The sections below explain how to start the migration and how to migrate the most in-demand services.

Note

In the K2 Cloud documentation, virtual machines are called instances.

Before migration#

Important

Due to the high load on the cloud infrastructure, free resources to launch a particular cloud service may be unavailable in the selected availability zone (data center). You can try to launch the service in another availability zone, or contact support via the portal or at support@k2.cloud.

  1. If your company does not have an administrative account yet, submit a registration request with the code word CloudBro. After the company is registered, a notification with the administrative account password and a login of the form admin@<customer> will be sent to the corporate email.

  2. Log in to the web interface. On the first login, change the password.

  3. A default project is created together with the administrative account. You can deploy the infrastructure in it or create your own project.

  4. Use the administrative account to manage users and projects in the IAM section. For the migration and day-to-day work, create separate users and assign them the required project privileges. The CloudAdministrators group grants full access to project resources.

  5. Select a region where you need to create resources, using the selector in the top bar of the web interface.

  6. Set up network connectivity between your current site and K2 Cloud, and migrate the resources following the instructions below.

  7. After the transfer, set up DNS, backup, and load balancing.

How to select a region#

K2 Cloud has two regions:

Region

Location

What to consider

ru-msk

Moscow

Three availability zones. Cluster nodes or individual instances can be distributed across different data centers

ru-spb

Saint Petersburg

One availability zone. For test environments and as additional data storage if the main resources are deployed in ru-msk

You need to select a region before creating resources. The region cannot be changed for a resource that has already been created. Images and volume snapshots can be copied between regions.

Before migrating, check the following in the selected region:

  • required instance and volume types;

  • provided quotas.

The DNSaaS service is global: a DNS zone created in it serves all regions.

How to ensure network connectivity#

To connect to the cloud, you can use:

  • Elastic IP address (if acceptable) — a public IP address that you can use, for example, to transfer data over SSH/rsync (to transfer data, you can also use object storage).

  • VPN connection — a fault-tolerant encrypted channel between the remote infrastructure and a VPC. It lets you start the migration without waiting for a physical link to be connected.

  • Direct Connect — a direct link with low latency and guaranteed bandwidth. It provides L3 connectivity using the BGP protocol. You can place the equipment in a cloud data center or lease an external communication link to K2 Cloud points of presence. Ports of 1, 10, and 25 Gbit/s are available for connecting to the cloud equipment.

If the systems being migrated are deployed in different VPCs and/or cloud projects and must reach each other, set up a transit gateway to provide routing between them.

To give instances access to the internet, attach an internet gateway. If you need to provide access for instances that do not have their own public address, use a NAT gateway. For direct access to instances from the internet, publish them through an Elastic IP address or a load balancer.

You can restrict access to instances using security groups and network access control lists. During the migration, open only the ports and addresses required for replication and administration: SSH (22/tcp) for Linux, RDP (3389/tcp) for Windows, and database and object storage ports. When everything is ready to launch, open access to your services from the required networks.

Migration process#

Virtual machine migration#

Note

Before migrating and launching virtual machines, we recommend that you read the Instances section.

K2 Cloud uses the QEMU-KVM hypervisor. A virtual machine can be transferred as an OVA image or as volume snapshots in the VMDK, VHD, QCOW2, and RAW formats. This way, you can migrate virtual machines from VMware, Hyper-V, KVM, and other environments if they export the disk in one of these formats.

  1. Stop the source virtual machine and export the OVA image or the volume snapshots.

  2. Check that VirtIO drivers for the network and disks are installed in the guest system. Without them, the instance will start, but disk and network performance will be noticeably slower. If the drivers are missing, enable the Enable legacy OS support option during import. For Windows, VirtIO drivers must be installed before the transfer.

  3. Upload the files to an object storage bucket (see the instructions below).

  4. On the bucket page, select the required objects and click Create image. The boot volume must be first in the list. Import progress is shown in the Virtual machines → Storage → Import/Export section.

  5. From the completed image, create an instance. The completed image appears in the Virtual machines → Storage → Images section.

  6. Assign an Elastic IP, if necessary, and allow access in the security group.

  7. Check system startup, the network, and the data. After the check, enable backup.

Detailed steps are in the Migrating virtual machines to K2 Cloud guide and in the Import/Export documentation section.

Data migration to object storage#

Note

Object storage can also be used as a staging area when importing virtual machine images and as backup storage.

This guide describes how to transfer large amounts of data to the cloud.

The Object storage service is compatible with the Amazon S3 API. Before the transfer, create a bucket and access keys. The endpoint for the ru-msk region is https://s3.ru-msk.k2.cloud, and for ru-spb it is https://s3.ru-spb.k2.cloud.

To transfer a large number of objects, use the rclone utility. It should be run on instances in different availability zones. You can also use the AWS CLI and the s3cmd utility to work with a bucket.

Preparing for migration#

  1. Create the target bucket. If necessary, enable versioning (once enabled, it cannot be disabled).

  2. If you plan to write more than 30 million objects to a bucket without versioning, or more than 10 million objects to a bucket with versioning, after you create the bucket tell support its name, the target number of objects, and whether versioning is enabled. Preparing such a bucket takes a couple of minutes.

  3. Make sure the source files are static (they do not change during copying).

Copying data#

Run rclone on instances in different availability zones. Two or three instances are enough to start. You can increase the number of instances to speed up the transfer.

Run the tasks that copy files smaller than 200 MiB and files of 200 MiB or larger on different instances. If there are many files, you can run the corresponding command on two or more instances.

For small objects, run:

rclone copy <source> <bucket> \
  --checkers 64 \
  --transfers 32 \
  --size-only \
  --s3-no-check-bucket \
  --s3-storage-class STANDARD \
  --s3-use-accept-encoding-gzip=false \
  --no-gzip-encoding \
  --header-download "Accept-Encoding: identity"

where <source> is the bucket from which objects are copied, and <bucket> is the bucket in K2 Cloud.

For large objects:

rclone copy <source> <bucket> \
 --checkers 32 \
 --transfers 32 \
 --s3-no-check-bucket \
 --size-only \
 --ignore-checksum \
 --s3-upload-cutoff 200M \
 --s3-chunk-size 64M \
 --s3-upload-concurrency 8 \
 --multi-thread-streams 8 \
 --s3-storage-class STANDARD \
 --s3-use-accept-encoding-gzip=false \
 --no-gzip-encoding \
 --header-download "Accept-Encoding: identity"

where <source> is the bucket from which objects are copied, and <bucket> is the bucket in K2 Cloud.

Important

When working with Yandex Cloud storage, these parameters are required:

--s3-storage-class STANDARD
--s3-use-accept-encoding-gzip=false \
--no-gzip-encoding \
--header-download "Accept-Encoding: identity"

If a TLS connection error occurs, update rclone to a newer version.

Kubernetes cluster migration#

Before migrating, read the documentation for the Kubernetes clusters service. In K2 Cloud, Kubernetes clusters are deployed using Elastic Kubernetes Service: master nodes and Ingress controllers are part of the cluster, and worker node groups are created separately.

The EKSFullAccess project privileges are required to work with the service. If you need the EBS provider, the ELB provider, and/or the Cluster Autoscaler provider, create a service user for each of them, or one user with the EKSClusterPolicy policy to work with all of them (see details).

General procedure:

  1. Create an EKS cluster and node groups in the required availability zones.

  2. Transfer the manifests and container images.

  3. Transfer the volume data. Shared files can be placed in an EFS file system and mounted over NFS.

  4. Switch inbound traffic to the cluster load balancer and check the workloads.

Migration of databases and other PaaS services#

You can find information about the platform services supported in K2 Cloud in the PaaS services documentation. You can deploy the required services in the web interface in the PaaS Service store section, where all supported services are presented on one page. To launch the services, you can also use the PaaS API. Preparation of instances and volumes and software installation are performed automatically.

The PaaSFullAccess project privilege is required to work with the services. You can enable backup for a database service. In this case, the PaaSBackupPolicy policy must be attached to the user.

List of supported services with links to the instructions for launching them:

DNS migration#

The DNSaaS service lets you manage public and private zones and resource records.

General procedure:

  1. Create a public zone for the domain.

  2. Transfer the resource records. Lower the TTL for the duration of the switchover.

  3. Delegate the zone to K2 Cloud: at the registrar, specify all four authoritative name servers from the NS record that is created together with the zone.

  4. Create private names within the VPC in a private zone.

  5. Switch DNS after the new instances, load balancers, and buckets respond to checks.

After migration#

If users need different access rights to object storage buckets, you can use the instructions for configuring granular permissions.

To protect against data loss, enable backup. In addition to backup of instances and volumes, K2 Cloud also offers a database backup option and an agent-based backup service.

  • The Backup service lets you create scheduled backups of instances and volumes. The copies are stored on a dedicated storage system, separately from the volumes. In a region with multiple availability zones, copies of resources from one zone are placed in another.

  • Agent-based solutions provide more flexible data protection. Backups are stored in object storage in three data centers (in the ru-msk region). On request, they can be stored in any S3-compatible storage. To connect agent-based solutions, submit a request on the support portal or email at support@k2.cloud.

  • If you need to capture the state of an instance or a volume, you can also create instance images, volume snapshots, and volume versions. Images and volume snapshots can be stored in object storage, including in another region, or duplicated to an external site.

  • For MySQL, MongoDB, and PostgreSQL databases, you can enable scheduled backup. Full backups of the specified databases are then created daily at the specified time. The backups are written to object storage.