Citrix: PVS Managing and Accessing a LUN Without Using a Network Share

http://support.citrix.com/proddocs/topic/provisioning-7/pvs-network-lun-noshare-manage.html

Managing and Accessing a LUN Without Using a Network Share

Normally, using a SAN for vDisk storage with Provisioning Services requires that a shared file system be placed in front of the SAN to coordinate multiple server access to the NTFS formatted LUN(s). However, under certain instances, it is possible to allow Provisioning Services to use a SAN without a shared file system. Provisioning Services can do this and still allow multiple servers access to the same LUN(s) without volume corruption.

Provisioning Services only allows read-only shared access to the SAN LUN(s). Therefore the desired boot modes for Provisioning Services target devices are important when using this feature.

The following table describes the boot mode and its restrictions when using read-only vDisk storage.

Boot Mode Write Cache Limitations Restrictions
Private Image Not supported Not supported
Standard Image with cache on server disk Separate shared read-write write cache location is required for the store. vDisk properties cannot be modified while the LUN is read-only.

vDisks cannot be mapped on the Provisioning Server.

Standard Image with cache in target device RAM No limitation. vDisk properties cannot be modified while the LUN is read-only.

vDisks cannot be mapped on the Provisioning Server.

Standard Image with cache on the target device’s hard drive Fall back to cache on server disk does not function if the target device hard drive is not found or fails. vDisk properties cannot be modified while the LUN is read-only.

vDisks cannot be mapped on the Provisioning Server.

Basically, the main limitations to placing vDisks on read-only storage include:

  • Private image boot from read-only storage is not allowed
  • If cache on the Provisioning Server disk is desired, a separate shared storage location that has read-write access is needed for the write cache files.
  • Modifying the vDisk properties is not allowed when the vDisk storage location is read-only.
  • Mounting the vDisk on the server is not allowed when the vDisk storage location is read-only.

Prerequisites

The following are prerequisites to using this new feature:

  • Provisioning Servers that will have access to the read-only shared LUN(s) are server class machines (Windows 2003 Server or 2008 Server).
  • The Microsoft iSCSI initiator software is installed on all Provisioning Servers that will have access to the SAN.
  • The vDisk files that will be placed on the read-only shared LUN(s) have already been created and reside on a normal read-write storage location. Creating vDisk files in place on the LUN is more difficult than pre-making the VHD files in a normal read-write store and subsequently copying them to the shared LUN. Therefore, this document will describe the procedure assuming the vDisk files have been pre-made and reside in a normal read-write storage location.
  • The SAN being used has the ability to set a LUN up for shared read-write access or shared read-only access without requiring a shared file system front end. Normally, using a LUN in shared read-write access mode without a shared file system front end will result in a corrupt NTFS volume. Limiting the LUN access to read-only circumvents this problem.

Implementation

On the SAN

  1. Create a volume on the EquaLogic SAN using the EqualLogic Group Manager (or other relevant SAN interface front end). Make the volume large enough to hold all VHD and VHD associated PVP files that will be shared between the Provisioning Servers.
  2. Set the access type for the volume to read/write – shared. Note that the volume will be made read-only through the NTFS attributes not through the SAN access rights. While using the volume in read-only shared mode is possible, it requires extra steps to implement the solution. Therefore this procedure describes the process when the volume is set for read-write – shared access.
On Provisioning Servers

  1. Use the iSCSI Initiator to login to the SAN volume on only one of the Provisioning Servers.
    Note: Do NOT login to the SAN Volume from more than one server simultaneously until the volume has been marked read-only. If you allow more than one server to simultaneously login to the volume through the iSCSI interface while the volume is read-write, you will corrupt the volume and will need to re-format it. All data on the volume will be lost.
  2. Format the volume through the Windows Disk Manager with an NTFS file system and assign a drive letter or mount point path. A mount point path is desirable if you will have many LUN/Volumes exposed on a server as there will be no drive letter limitations. Make sure you use a drive letter/Mount point that will be identical on all servers using the volume. If you cannot make them identical, you will need to use the Provisioning Services/store override paths to point a specific server to a different drive letter/mount point for the volume.
  3. After the volume is formatted and assigned a drive letter/Mount point, the volume should be accessible on this single Provisioning Server as a read/write volume. Make sure all properties for the VHD and PVP files that will reside on the volume are set correctly (including enabling HA) and then copy all VHD files and their associated PVP files to the volume. Lock files do not need to be copied. The PVP file MUST be copied along with the VHD file. The system will not be able to create a PVP file ‘on the fly’ once the volume is read-only.
  4. After all files are copied to the volume, you must make the volume read-only. Close all Explorer windows that have access to the volume, then open a command prompt on the server that has access to the volume.
  5. Run diskpart.exe. This will start an interactive session with diskpart.exe.
  6. Find the volume number by typing the following command: list volume.
  7. Note the volume number of your volume and select it by typing the following command: select volume volumeNumber where volumeNumber is the number of the volume identified with the list volume command.
  8. After the volume is selected, set the read-only attribute of the volume by typing the following command: attributes volume set readonly.
  9. Check that the readonly attribute was set correctly by typing the following command: detail volume.
  10. Exit diskpart.exe by typing the command: exit.
  11. Using the iSCSI initiator interface, logoff the volume on this server and then re-login to the volume again. Make sure to make the volume a persistent target. You must logoff and then login to the volume to get NTFS on the server to re-read the volume attributes so that it will recognize the volume as read-only. Making the volume a persistent target will ensure the volume is accessible when the server reboots.
  12. It is now safe to mount the iSCSI volume on all Provisioning Servers. Using the iSCSI Initiator applet and Microsoft Disk Manager, mount the volume on all Provisioning Servers that need access to the volume. Make the target persistent in the iSCSI interface and try to make all servers mount using the same drive letter or mount point, which makes setting up the Provisioning Services Store easier.
    Note: It may be necessary to make the Provisioning Services’ Stream Service on all servers dependent on the iSCSI Service. This ensures that the volumes are available at the proper time should the server reboot and target devices are booted during the server reboot. To do this, edit the registry for the Stream Service, then add the DependsOnService value pointing to the iscsiexe.exe service (MSiSCSI).
  13. Run the Console on one of the Provisioning Servers to create a store that points to the drive letter/mount point for the volume.
  14. Select which Provisioning Servers have access to the volume for this store.
    Note: If you are using Cache on server or Difference disk mode for any VHDs on the volume, you MUST enter a Default write cache path for the store that does NOT point to the SAN read-only volume. This path must be in a shared location for all Provisioning Servers. You can use a Windows Network Share or any other read-write shared storage device, but the write cache path cannot point to the read-only volume. The read-only volume can only contain the VHD and PVP files. If you are using one of the target device cache modes (local HD or RAM) then you do not need to set up a shared read-write write cache location for the store.
  15. On the Console, right-click on the store then select the Add Existing Disk… menu option, which scans the store and adds the VHD files to the database.
  16. Assign the VHD files that are on this store to target devices, then boot those target devices normally. The VHD files on the read-only volume will always display in the Console as locked with the lock type: Read only media: Shared. You cannot remove this lock type. You cannot create a new vDisk on a store once it has been marked as read-only with diskPart.exe. You cannot edit the properties of the VHD once the store has been marked read-only.

Modifying vDisk Properties

vDisk properties cannot be modified while the SAN LUN location is marked read-only. To edit the vDisk properties or modify the vDisk files on the LUN, complete the following procedure:

  1. Shutdown all target devices that use the VHDs that are on the store.
  2. Use the iSCSI initiator on all Provisioning Servers (except one) to logoff the volume. Alternately, use the diskpart.exe utility on some server OS types and mark the volume as offline on all Provisioning Servers (this feature is not available on all OS types. If necessary, use the iSCSI initiator to logoff the volumes).
  3. In order to use the diskpart.exe utility to mark the volume as read/write, Open a command prompt on the server that has access to the volume, then run diskpart.exe. This starts an interactive session with diskpart.exe.
  4. Find the volume number by typing the following command: list volume.
  5. Note the volume number of your volume and select it by typing the following command: select volume volumeNumber where volumeNumber is the number of the volume identified with the list volume command.
  6. After the volume is selected, to clear the readonly attribute, type the following command: attributes volume clear readonly.
  7. Check that the readonly attribute was set correctly by typing the following command: detail volume.
  8. Exit diskpart.exe by typing the command: exit.
  9. Logoff/login the volume (or mark it offline/online in diskpart) on the single server that still has access to the volume.
  10. Edit the VHD file attributes through the Console, then copy the new files to the volume.
  11. After all edits are complete, use the diskpart.exe utility to mark the volume read-only by selecting the volume, then setting the read-only attribute: attributes volume set readonly.
  12. Check that the readonly attribute was set correctly by typing the following command: detail volume
  13. Exit diskpart.exe by typing the command: exit.
  14. Use the iSCSI Initiator to logoff, then relogin to the volume to re-read the read-only attributes.
  15. Use the iSCSI Initiator on all Provisiong Servers to re-login to the volume.
Note: IMPORTANT! Do NOT login to the SAN Volume from more than one server simultaneously until the volume has been marked read-only. If you allow more than one server to simultaneously login to the volume through the iSCSI interface while the volume is read-write, you will corrupt the volume and will need to re-format it. All data on the volume will be lost.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s