Created
January 27, 2020 14:33
-
-
Save shortcord/969635a5b5ae65adc557377e58128756 to your computer and use it in GitHub Desktop.
Import a existing VM into Proxmox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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