Import Disk Image to a VM

This guide explains how to import a disk image into a virtual machine (VM) in Proxmox VE using ProxMenux. The script simplifies the process by scanning for available disk images and allowing users to attach them to VMs without manual configuration.

Overview

The script automates the following steps:

  1. Scans for disk images (.img, .qcow2, .vmdk) in /var/lib/vz/template/images/.
  2. Displays a list of available virtual machines (VMs) for selection.
  3. Allows users to choose one or multiple disk images for import.
  4. Provides storage volume options for placing the imported disk.
  5. Offers an interface choice (SATA, SCSI, VirtIO, or IDE) for each imported disk.
  6. Imports and attaches the selected disk images to the chosen VM.

Implementation Steps

1

Preparation

Ensure that the disk images you want to import are placed in /var/lib/vz/template/images/.

2

VM Selection

Select the VM where the disk image(s) will be imported.

3

Storage Selection

Choose the Proxmox storage volume where the imported disk(s) will be placed.

4

Image Selection

Select one or more disk images to import from the list of detected compatible images.

5

Configuration

For each selected image:

  • Choose the interface type (SATA, SCSI, VirtIO, or IDE).
  • Optionally enable SSD emulation (for non-VirtIO interfaces).
  • Decide whether to make the disk bootable.
6

Import Process

The script will import each selected disk image and display real-time progress updates.

7

Finalization

After the import is complete, the script attaches the disks to the VM and applies the selected settings.

Expected Results

  • The selected disk images are successfully imported and attached to the specified VM.
  • Users receive confirmation of the import operation.
  • The VM is configured to recognize the new disks upon startup.

Important Considerations

  • Ensure you have sufficient storage space in the selected Proxmox storage volume.
  • Supported disk image formats include .img, .qcow2, and .vmdk.
  • The target VM must be powered off before importing disk images.
  • SSD emulation is only available for non-VirtIO interfaces (SATA, SCSI, IDE).
  • Importing a disk as bootable will modify the VM’s boot order. Adjust boot settings as needed.