You might encounter this error message in XenServer when launching a VM:

This VM needs storage that cannot be seen from that server

I am not sure why the guys over at Citrix decided to refer to the host you are trying to launch the VM on as “that server”, but this error message simply means that your host cannot access the SR this VM is stored on. This usually means that the SR go detached for some reason, and it is very likely that the SR is going to show up as unplugged in XenCenter, and trying to repair it from the XenCenter client would return another error message, typically something like this:

Error parameters: , Logical Volume mount/activate error

The first result in Google if you try to look for the error message in the title of the post brings you to a post on the Citrix Discussion website recommending to eject any disc from the DVD drive of the VM, but in my case there was no disc inserted, so this wasn’t helpful. What worked for me was removing the SR and adding it back to XenServer. I then restored my VM metadata so that all the drives could be attached to the correct VMs once again.

The solution

  1. Run
    xe pbd-list
  2. Find and copy the uuid of the pbd your SR is stored on
  3. Disconnect the pbd by running
    xe pbd-unplug uuid=uuid_from_step_2
  4. Run
    xe sr-list
  5. Find and copy the uuid of your SR
  6. Forget the SR by running
    xe sr-forget uuid=uuid_from_step_5
  7. Now that your SR is disconnected and doesn’t show up in XenCenter anymore, we can start the process to attach it again. Before we do that, I recommend running top to check whether fsck is running on your system as this could interfere with this process. If you find fsck running on your drive, let it finish before moving on, even if it would take a few minutes
  8. List all available physical disks by running
    pvdisplay
  9. Copy the UUID of the drive you want to attach (you can find it in the VG Name field, it’s the last part of the the string beginning with VG_XenStorage-)
  10. Introduce the SR to XenServer by running
    xe sr-introduce uuid=uuid_from_step_9 type=[lvm/ext] name-label="Your SR name" content-type=user
  11. Check that the SR showed up in XenCenter in “detached” status
  12. Find out and copy your host uuid by running
    xe host-list
  13. Find out and copy your drive name by running
    ls -l /dev/disk/by-id

    (it will look something like scsi-SATA_WDC_WD20EFRX-68_WD-WMC4M3240210)

  14. Create a new pbd by running
    xe pbd-create host-uuid=uuid_from_step_12 sr-uuid=uuid_from_step_9 device-config:device=/dev/disk/by-id/drive_name_from_step_13
  15. The previous command will return the uuid of the pbd, copy it because you will need it in the next and final step
  16. Plug the pbd by running
    xe pbd-plug uuid=uuid_from_step_15
  17. Restore your VM metadata

If you didn’t receive any error message doing any of these steps, your SR should be up and running again and you should see it correctly attached in XenCenter.

If you are looking for some sample output, take a look at this article too.