📌 Overview
Migrating on-premises workloads to the cloud requires an efficient, repeatable strategy. In this hands-on project, we took an existing Hyper-V Virtual Machine, exported/backed up its virtual disks, converted the storage format into VMDK, uploaded it to OCI Object Storage, and provisioned a running cloud instance from it.
🚀 Phase 1: Hyper-V Backup & Disk Export
Before modifying or converting disk images, the first rule of infrastructure engineering is securing a clean restore point.
- Step 1.1: Shut Down Workload safely: Ensure the source Hyper-V VM is cleanly powered off to avoid filesystem inconsistency or corrupt database states.
- Step 1.2: Export VHDX: Export the target VM disk image (
.vhdxfile) from Hyper-V Manager to a dedicated staging directory.
Figure 1: Exporting the source VHDX disk from Hyper-V Manager.
🔄 Phase 2: Converting VHDX to VMDK Format
Oracle Cloud Infrastructure supports importing custom disk images in VMDK or QCOW2 formats. We converted the .vhdx file using qemu-img (or V2V Converter).
# Converting VHDX image to VMDK format using qemu-img
qemu-img convert -f vhdx -O vmdk source_disk.vhdx converted_disk.vmdk -p
- Check Integrity: Verify the converted
.vmdkdisk size and headers before uploading.
Figure 2: Converting disk formats and verifying image structure.
☁️ Phase 3: Uploading to OCI Object Storage
With the VMDK prepared, the image is staged inside an OCI Object Storage Bucket using the OCI CLI or OCI Console.
- Step 3.1: Create OCI Bucket: Set up a private Object Storage bucket in your target region.
- Step 3.2: Upload Disk Image: Transfer the converted
converted_disk.vmdkfile into the bucket.
# Uploading VMDK to OCI Object Storage Bucket
oci os object put -bn migration-bucket --name converted_disk.vmdk --file converted_disk.vmdk --progress
Figure 3: Staging the VMDK image inside OCI Object Storage.
🖥️ Phase 4: Import Custom Image & Provision VM
The final step is registering the uploaded object as an OCI Custom Image and launching a live compute instance.
- Import Custom Image: In the OCI Console, navigate to Compute → Custom Images → Import Image. Select the VMDK object from your bucket and set the operating system mode (Emulated / Paravirtualized).
- Launch Compute Instance: Once the image state reaches
AVAILABLE, click Create Instance, configure networking (VCN / Subnet), select shape, and launch. - Verify Connectivity: Test SSH/RDP access to ensure bootloader and drivers loaded smoothly.
Figure 4: Successfully deployed OCI compute instance running from custom VMDK.
💡 Key Takeaways & Lessons Learned
- ✔ Paravirtualized Drivers: Ensure network and storage drivers are compatible before importing to avoid boot loops.
- ✔ Network Configuration: Remember to update static IP settings from the source network to DHCP or OCI VCN IP ranges.
- ✔ Cleanup: Delete temporary VMDK files from local staging and OCI buckets after successful deployment to avoid extra storage costs.