Tag: repository

  • XenServer 6 – Deleting a Storage Repository From the Command Line

    8-inch-floppy-disks

    So before we get started deleting a Storage Repository, we need to know a few key terms.

    In XenServer a Storage Repository is a storage target that contains virtual disks (VDIs) and isos.

    A PBD (physical device block) is what they call the interface between a physical host and an attached SR, which is responsible for storing the device config that allows the host to interact with the storage target.

    So now that we have gotten that out of the way, lets get started.

    First list the SRs on a host.

    #xe sr-list uuid=9a9e7903-7c0f-4f7e-f0a3-e39c54478346

    Using the uuid from the you got from the command above, run the command below using the UUID, which for some reason you are calling the sr-uuid.

    #xe pbd-list sr-uuid=9a9e7903-7c0f-4f7e-f0a3-e39c54478346

    uuid ( RO) : a89b78ca-cb3d-0b44-5d0b-9cf2c8ad755a
    host-uuid ( RO): 4a9971f7-1e59-4e02-b849-04d206ee7b2b
    sr-uuid ( RO): 9a9e7903-7c0f-4f7e-f0a3-e39c54478346
    device-config (MRO): device: /dev/disk/by-id/edd-int13_dev81
    currently-attached ( RO): true

    Now using the the UUID output of from the command above, unplug the pdb.

    #xe pbd-unplug uuid=a89b78ca-cb3d-0b44-5d0b-9cf2c8ad755a

    Then destroy it….boom.

    #xe pbd-destroy uuid=a89b78ca-cb3d-0b44-5d0b-9cf2c8ad755a

    Now tell Xenserver to “forget” the SR.

    #xe sr-forget uuid=9a9e7903-7c0f-4f7e-f0a3-e39c54478346