Skip to content

Datastore Remove

Once you are done with a datastore it is best to remove it, as the Proxmox-LVM-ssd_discard process is not very reliable.

Warning

Change window only: Mistakes in this process can result in service outages.

Confirmation

Confirm that there are no disk devices referenced by the datastore in proxmox.

This can be done by selecting the datastore in the GUI and looking at all of the tables (not just the VM tabs)

If there are dangling devices (because sometimes prox gets confused), please escalate for help

Remove Datastore from Prox

You can remove the datastore from the proxmox inventory from the Proxmox GUI

  1. Select Datacentre
  2. Select Storage
  3. Select the datastore you wish to remove
  4. Click Remove
  5. Accept the prompt

LVM cleanup

You will now need to clean up the underlying LVM datastore information.

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))

Zombie LV references

Prox tends to leave behind some dangling refernces to non-existant LVM devices, so check in the VG mapper for dangling devices.

You can check if there are any zombie disk references by looking in the /dev/<vgname>/ path. It is often different on each node, so each should be inspected.

ls /dev/<vgname>

Clean zombie references

If there are any references to LVs in those folders, yet the LVS are not found in the lvs output, you will need to clean those references.

Warning

Double check your vgname here.

vg_name="<vgname>"
for disk in $(ls /dev/$vg_name/); do echo " > $vg_name -> $disk"; dmsetup remove $(readlink -f /dev/$vg_name/$disk); done

Information

Run the following steps on ONLY ONE of the cluster nodes

Remove Volume Group

You should now be able to remove the volume group

Offline the VG

vgchange -an <vgname>
Remove the VG
vgremove <vgname>

Remove the Physical volume from LVM

Warning

Run the following steps on ALL of the cluster nodes. HOWEVER, the mapper devices will differ on the nodes, so you will need to do this one-by-one

You will now need to inform LVM to release the specific mpath device which differs between hosts

pvremove /dev/mapper/<mpath_device>

Update LVM status

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))

You can now rescan the LVM physical volumes.

pvscan

Storage Array Volume Unmap

You should now unmap the storage volume from the cluster (the guides may offer assistance here)

Cleanups

You can now run the final cleanups on all of the nodes

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


NEW STUFFFS

To safely refresh a Pure Storage volume on a Proxmox cluster using iSCSI and Multipath, the primary goal is to prevent the Linux kernel from experiencing "stale" paths or I/O hangs when the underlying storage metadata changes.

Because LVM is thick-provisioned and shared, you must ensure no host is actively holding a lock or a cached view of the Volume Group (VG) during the overwrite.

Phase 1: Preparation (All Nodes)

Before triggering the snapshot overwrite on the Pure array, you must "isolate" the storage from the Proxmox hosts.

  1. Deactivate the VG: On all nodes in the cluster, deactivate the Volume Group to ensure no LVM metadata is being accessed.
    vgchange -an <your_vg_name>
    
  2. Flush Multipath Maps: On all nodes, remove the multipath device mapping. This prevents the kernel from trying to write to a device that is about to change.
    multipath -f <multipath_device_name_or_wwid>
    # or
    oxide -j3pp "multipath -f /dev/mapper/\$(multipath -ll | grep -i CFBBF9A74F2D462A00019048 | awk '{print \$1}')"
    
  3. Check for Holders: Ensure no processes are still using the block device.
    dmsetup table | grep <multipath_device_name>
    # If it returns a line, the device is still "held" by something.
    # If found run:
    lsblk /dev/mapper/<mpath_name>
    dmsetup remove /dev/mapper/<MAPPER_NAME>
    

Phase 2: Array-Side Overwrite (Pure FlashArray)

Perform the overwrite via the Pure GUI or CLI. * Action: Copy the desired snapshot to the existing volume. * Verification: Ensure the Volume WWID remains the same (Pure's "overwrite" preserves the WWID, which is critical for your multipath config).


Phase 3: Host Refresh (All Nodes)

Now that the data on the "wire" has changed, the hosts need to re-scan the new partition table and LVM headers.

  1. Rescan iSCSI Sessions: Tell the iSCSI initiator to refresh the capacity and block count.
    iscsiadm -m node -T <target_iqn> --rescan
    
  2. Reload Multipath: Re-detect the paths and recreate the device map.
    multipath -v2
    # Verify the path is active
    multipath -ll
    
  3. Scan for LVM Changes: Force LVM to drop its cache and find the "new" PV/VG headers from the snapshot.
    vgscan --mknodes
    pvscan --cache
    
  4. Activate the VG:
    vgchange -ay <your_vg_name>
    

Safety Checks & Troubleshooting

  • Stale Device Check: If multipath -f fails, a host likely still has an LVM partition active or a leftover mount point. Check lsblk to see if any dm-X devices are nested under your multipath device.
  • LVM Metadata Mismatch: If vgdisplay shows an "incorrect" size or UUID after the overwrite, run pvscan --cache <device> specifically on the multipath path (e.g., /dev/mapper/mpathX).
  • Proxmox GUI Refresh: Once LVM is active, go to Datacenter > Storage in Proxmox. Select your LVM storage and ensure it is "Enabled." Proxmox should automatically detect the refreshed LVs.

Note: Since you mentioned using vim, if you need to modify /etc/multipath.conf or LVM filters during this process, ensure you run systemctl restart multipathd after saving your changes.