@@ -11,3 +11,147 @@ categories:
1111 - compute
1212tags : instance type production production-optimized range POP2 ENT1
1313---
14+
15+ ## Validating the inventory of machines to migrate
16+
17+ Identify the virtual machines (VMs) to migrate on your VMware plattform:
18+
19+ - Disk configuration (number, size, type)
20+ - Network configuration (number of NICs, type)
21+ - Boot type (BIOS or UEFI)
22+
23+
24+ ## Preparing a Scaleway Instance to manage the migration
25+
26+ 1 . [ Create a new instance] ( /instances/how-to/create-an-instance/ ) and log into it [ using SSH] ( /instances/how-to/connect-to-instance/ ) .
27+ 2 . Install the following CLI tools, required for the migration of your virtual machine:
28+ - ` qemu-img ` — for converting VMDK to QCOW2
29+ ``` sh
30+ apt install qemu-utils
31+ ```
32+ - ` scw ` — for Scaleway operations
33+ ``` sh
34+ curl -s https://raw.githubusercontent.com/scaleway/scaleway-cli/master/scripts/get.sh | sh
35+ ```
36+ - ` aws ` — for uploading to S3
37+ ```
38+ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
39+ unzip awscliv2.zip
40+ sudo ./aws/install
41+ ```
42+ - ` govmomi ` — for interacting with vCenter
43+ ```
44+ curl -L -o - "https://github.com/vmware/govmomi/releases/latest/download/govc_$(uname -s)_$(uname -m).tar.gz" | tar -C /usr/local/bin -xvzf - govc
45+ ```
46+
47+ 3 . Configure credentials for the tools:
48+ - For Scaleway: ` scw init `
49+ - For AWS/S3: Refer to [ Using Object Storage with the AWS-CLI] ( https://www.scaleway.com/en/docs/object-storage/api-cli/object-storage-aws-cli/ )
50+ - For vCenter: credentials and VPN (if needed)
51+
52+ ## Downloading VMDK files using govmomi
53+
54+ Download the VMDK file from vCenter:
55+
56+ ``` bash
57+ govc export.ovf -vm < vm_name>
58+ ```
59+
60+ <Message type = " note" >
61+ Adjust this based on your ` govmomi ` /` govc ` setup and environment.
62+ </Message >
63+
64+ ## Converting the VMDK file to QCOW2**
65+
66+ Convert the downloaded VMDK file to QCOW2 using ` qemu-img ` :
67+
68+ ``` bash
69+ qemu-img convert -O qcow2 < vm_name> .vmdk < vm_name> .qcow2
70+ ```
71+
72+ ### (Optional): Mounting the QCOW2 file and system configuration
73+
74+ 1 . Mount the QCOW2 image on your Instance:
75+ ``` bash
76+ sudo modprobe nbd
77+ sudo qemu-nbd -c /dev/nbd0 < vm_name> .qcow2
78+ ```
79+ Make any changes (e.g., install cloud-init, remove VMware tools).
80+
81+ 2 . Unmount the file:
82+
83+ ``` bash
84+ sudo qemu-nbd -d /dev/nbd0
85+ ```
86+
87+ ## Uploading the QCOW2 image to Scaleway Object Storage
88+
89+ Upload the converted disk:
90+
91+ ``` bash
92+ aws s3 cp < vm_name> .qcow2 s3://< bucket_name> /
93+ ```
94+
95+ ## Importing the QCOW2 image from Object Storage into Scaleway as a volume
96+
97+ Import into a new volume :
98+
99+ ``` bash
100+ scw instance volume import qcow2-from-s3 \
101+ s3-url=s3://< bucket_name> /< vm_name> .qcow2 \
102+ name=< volume_name> \
103+ project-id=< project_id> \
104+ zone=< zone>
105+ ```
106+
107+ > You can retrieve project ID and zone using ` scw project list ` and ` scw zone list ` .
108+
109+ ---
110+
111+ ### ** Step 8: Create an image from the imported volume**
112+
113+ ``` bash
114+ scw instance image create-from-volume \
115+ volume-id=< volume_id> \
116+ name=< image_name> \
117+ zone=< zone>
118+ ```
119+
120+ ---
121+
122+ ### ** Step 9: Create Private Networks if needed**
123+
124+ ``` bash
125+ scw vpc private-network create \
126+ name=< pn_name> \
127+ ipam-configs.0.cidr=< subnet_cidr>
128+ ```
129+
130+ ---
131+
132+ ### ** Step 10: Boot an instance with the image and attach PN**
133+
134+ Create a new server:
135+
136+ ``` bash
137+ scw instance server create \
138+ name=< instance_name> \
139+ image-id=< image_id> \
140+ commercial-type=< type> \
141+ zone=< zone> \
142+ private-nics.0.private-network-id=< pn_id>
143+ ```
144+
145+ Start the server:
146+
147+ ``` bash
148+ scw instance server start server-id=< server_id> zone=< zone>
149+ ```
150+
151+ ---
152+
153+ ## ✅ Final Notes
154+
155+ - Run ` scw --help ` or ` scw instance server create --help ` for more guidance.
156+ - Double-check your Scaleway ** region/zone compatibility** (e.g., ` fr-par-1 ` , ` nl-ams-1 ` , etc.).
157+ - Ensure the image is cloud-ready: ideally includes ` cloud-init ` .
0 commit comments