Skip to content

Instantly share code, notes, and snippets.

@shortcord
Created January 27, 2020 14:33
Show Gist options
  • Save shortcord/969635a5b5ae65adc557377e58128756 to your computer and use it in GitHub Desktop.
Save shortcord/969635a5b5ae65adc557377e58128756 to your computer and use it in GitHub Desktop.
Import a existing VM into Proxmox
# Mount the storage or CD to a USB disk
cd ./storage
# Create the VM to import to
# we are assuming id of 1100
VMID=1100
qm create "${VMID}" \
--name "Imported VM" \
--memory 1024 \
--cores 4
# Import the virtual disk, assuming its a supported format
virtualDiskName="diskname.vhdx"
storageID="Pool01" # Name of the storage to use, example here would be a CephFS pool
qm importdisk "${VMID}" "${virtualDiskName}" "${storageID}"
# Set the newly imported disk to ide0 and ensure its selected as first boot device
qm set "${VMID}" --ide0 "${storageID}:vm-${VMID}-disk-0"
qm set "${VMID}" --boot c --bootdisk ide0
# We are done now, view the newly imported vm in the webpanel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment