Skip to content

Datastore Import

Below are steps to import an existing datastore in a Proxmox cluster.
It is assumed that the volume is mapped to the cluster from, the storage. If not, look at Volume/LUN Tasks to map the volume


Volume Group Discovery

You will now need to inform all of the cluster nodes that there is a change to the storage of an LVM volume.

Information

Run the following steps on ALL of the cluster nodes

You can execute all of the below commands on all nodes with Oxide Cluster Run (e.g. oxide -j1pi 'whomai', where j1pi is the jnb1 proxmox internal/uat cluster (use oxide --help for other cluster options))

iSCSI Rescan

Inform the hosts to check the device paths

iscsiadm -m node --rescan

Multipath Rescan

Inform the multipath drivers to update, based on the previous rescan

multipath -r

Add volume to LVM

You can now trigger LVM on each host to scan and update the volume information.

pvscan


Add datastore to Proxmox

You can now add the storage to the cluster

Storage wizard

Click Datacentre -> Storage -> Add -> LVM

Settings

Please configure the below settings for the datastore

  1. Provide a meaningful ID, as it cannot be changed without being removed (keep it the same as the volume group name if possible)
  2. In the Volume Group drop-down, you should now be able to select your new volume group (e.g. VGNAME). Select it.
  3. Toggle Shared on
  4. You can leave all of the rest as default

Click Add

Validation

  1. Look at the data centre inventory on the left (make sure you're in Server View)
  2. Expand all servers so that you can see their contents
  3. Your storage (meaningful ID) should now show in the side bar under each server
  4. It may start with a grey circle simple on it.
  5. After several seconds the symbol should disappear
  6. You should now be able to select that data store and browse the available VM disks.

Import VMs

You will now need to import the data into VMs.

Information

You will need to get the original VMs information from the source proxmox vluster (e.g. The original VM ids , VM config and IP addresses)

Create Blank VM

For each VM that you wish to import, you must create a proxmox VM object, without any data disk. Take note of the VMid of the newly created VM.

Rename the Logical Volume/s

You will need to rename the cluster volume to line up with the VMid provided by our target Proxmox cluster.
This is not strictly necessary for a simple volume import, but if the naming of the LV and the VM do not match up, Prox has been known to get confused.

On ONE of the prox hosts run the following

Get Volume Group Name

If you don't alredy have it (from previously) you can get the name of the VG using the below.

vgs

Get the Logical Volume Name

You will need the proxmox standard LV volume name (using the Old VMs ID)

lvs | grep -i <Old_VMid>

Rename the volume

You must now renamed the LV to match the new Proxmox Cluster's ID.
The new name should just be the same as the old name, replacing just the Old_VMid digits with the New_VMid digits.

lvrename <vgname> <old-disk-name> <new-disk-name>
# e.g. lvrename purestoragepool1 vm-5500-disk-0 vm-101-disk-0
For example, the imported volume group name is the-customers-exported-datastore and the Old_VMid was 5500 in thier proxmox cluster. The New_VMid, created by are blank VM is 234, so the command will be lvrename the-customers-exported-datastore vm-5500-disk-0 vm-234-disk-0)

You can now link the disk/s to the VM.
On the cluster node where the VM is deployed you can now do the following.

qm set <New_VMid> --scsi<disk-no> <vgname>:<new-disk-name>,discard=on,ssd=1
The will be an integer value, starting at 0 that is the order of the disks attached to the VM. Typically, if a disk is named vm-234-disk-0, the value should be 0.

qm set 101 --scsi0 purestoragepool1:vm-101-disk-0,discard=on,ssd=1
qm set 101 --scsi1 purestoragepool1:vm-101-disk-1,discard=on,ssd=1

Information

A customer's VM may have more than one volume linked to it. Just repeat the process for each volume with the same Old_VMid (e.g. A VM may have vm-5500-disk-0, vm-5500-disk-1 and vm-5500-disk-2, so you will need to rename and add all of those in sequence).

Configure Boot Order

Finally, you can now fix the VM disk boot order so the VM boots off of the correct disks.

  1. Go to the Proxmox GUI
  2. Select the VM
  3. Select Options
  4. Edit the Boot Order option
  5. Enable the scsiX devices and drag the boot device to the top of the list.
  6. You should now be able to start the VM

Guest Agent

Ensure that the qemu-guest-agent is installed and enabled on the VM (you can quickly check this by looking at the summery of the VM for additional information)


Storage Migration

Once you are complete, please migrate all new newly imported VMs to the customer's dedicated (official) datastore and remove this temporary one, when done.


Billing

Please don't forget to add the VM to billing (whilst we are still in manual tracking mode)