Migrate to Pool-Managed Persistent Disks
Use this page for a Huawei DCS or Huawei Cloud Stack cluster that still keeps platform data, such as /var/cpaas, on disks declared in its machine template. After the migration, these disks are declared in the machine pool, and the upgrade keeps them when it replaces the nodes. Migrate every affected cluster, the global cluster included. For a cluster that Check Cluster Versions sends to technical support, contact technical support before the migration.
Complete the migration before you upgrade the cluster. It replaces every node of the cluster with a new VM, one at a time.
Run the commands from the execution host, after ac login, on the global cluster that manages the cluster: the global cluster itself, with global as <cluster-name>, or the primary global cluster for a workload cluster. In a DR environment, migrate each global cluster; for the standby, use its kubeconfig instead of ac login. All objects are in the cpaas-system namespace.
TOC
Before You StartCheck the Provider RequirementsCheck the Rollout SettingsCheck the Pools for Free EntriesMigration ProcedureIf a Disk Reports an ErrorLimitationsBefore You Start
Select the global cluster that runs the commands, and confirm that the printed address ends with /kubernetes/global/:
For the standby global cluster in a DR environment, replace the first command with export KUBECONFIG=<standby-kubeconfig>; the second command then prints the VIP of the standby, and every later ac command on this page uses this kubeconfig. Run unset KUBECONFIG when the migration of the standby is complete.
Also confirm that all nodes of the cluster are Ready, and that the cluster has a recent successful etcd backup, as described in Check the etcd Backup.
Then run the following checks on the same cluster.
Check the Provider Requirements
- The cluster runs ACP v4.2.1 or later, as read in Check Cluster Versions, and its VM templates are v4.2.1 or later.
- Guest tools (
vmtools) run inside the VMs. - Each node has a fixed IP entry in a
DCSIpHostnamePool. - You can read the disks of each VM, with their
sequenceNum, from the DCS platform or the DCS API (QueryVmInfo).
Then confirm that the provider supports the field:
Continue when every item above holds and the command describes the field; otherwise, contact technical support.
Check the Rollout Settings
The first command prints the KubeadmControlPlane name, <kcp-name>. The TEMPLATE columns list the machine templates in use; the procedure works on each of them.
Check the Pools for Free Entries
Check each pool that the cluster uses, control-plane and worker pools alike:
The last command prints the type and the address of the control-plane load balancer of the cluster:
Check each pool in the POOL column. A free entry is an IP address of the pool that no machine of the cluster uses and that is not the load balancer address when the type is internal.
Migration Procedure
Do each step for the control plane template and for every MachineDeployment template that you listed.
Inspect the Disks and Choose Which to Keep
List the VMs of the cluster and the pools:
For every disk to keep on each VM, record:
- From the DCS platform or the VM details of the DCS API (
QueryVmInfo):sequenceNum, size (quantityGB),pciType, and the volume URN (volumeUrn). - From the entry of the disk in
spec.template.spec.vmConfig.dcsMachineDiskSpec[]of the currentDCSMachineTemplate:path,format, anddatastoreNameordatastoreClusterName. The data disk entries follow the old disk order, after the system disk.
A disk can be kept only if it sits at the end of the old disk order. Compute its slot in the pool from its old sequenceNum:
systemDiskCount is 1. newTemplateDataDiskCount is the number of non-system disks that stay in the template after the migration. The slot must be 0 or greater and unique within the IP entry. If a disk gives a negative slot, either also move the disks between it and the end of the old order to the pool, or accept that the disk is deleted with the old VM.
For example, with the old disk order 1 system disk, 2 /var/lib/kubelet, 3 /var/lib/etcd, 4 /var/lib/containerd, 5 /var/cpaas, and a new template that keeps every data disk that is not moved:
Update the Machine Template
Edit each template in place and keep its name:
In current-template.yaml:
- In
spec.template.spec.vmConfig.dcsMachineDiskSpec[], keep the system disk and the disks that may be recreated with the VM. Remove every disk to keep, and the disks that you move with it to make it claimable. - Keep
metadata.name. Removemetadata.resourceVersion,metadata.uid,metadata.creationTimestamp, andmetadata.managedFields.
Then apply it with ac apply -f current-template.yaml.
Update the Pool
Edit the DCSIpHostnamePool that the template references in spec.template.spec.ipHostPoolRef.name:
Under the IP entry of each node, add one persistentDisk entry for each disk to keep, with the slot you computed:
The existing disk is claimed only when quantityGB (exact size), datastoreName or datastoreClusterName (same storage), and pciType match the live disk. Always set pciType to the value of the live disk; it cannot be changed after you save the entry. path applies on the replacement VM; format and isThin are used only for a new, empty disk.
Confirm the Disks Are Claimed
Before you start the replacement, read the disk states of each pool:
Trigger the Rolling Replacement
Start the replacement of the control plane, then of each MachineDeployment:
Verify the Migration
Follow the replacement:
Then read the disk states of each pool with the commands in Confirm the Disks Are Claimed. Each disk goes from Attached on the old VM to Available after it is detached, then to Attached on the replacement VM; Detaching and Attaching appear in between. The migration is complete when the KubeadmControlPlane shows REPLICAS equal to DESIRED, the KubeadmControlPlane and every MachineDeployment show UPDATED equal to REPLICAS and UNAVAILABLE at 0, every Machine is Running, and every disk is Attached.
If a Disk Reports an Error
When a disk is in phase: Error, read its lastError with the command in Confirm the Disks Are Claimed. Fix the cause, and the provider retries and the replacement continues. If the cause cannot be fixed, contact technical support.
A claim fails when quantityGB, the datastore, or pciType in the pool entry differs from the live disk. For quantityGB or the datastore, correct the pool entry; the provider retries on its own. pciType cannot be changed after the entry is saved; if it differs, contact technical support.
Limitations
- Only disks declared in the pool are kept. Every other disk of the machine template is deleted with the old VM.
- Do not declare the same disk in both the machine template and the pool.
When every affected cluster is migrated, return to Prepare for the Upgrade.