This past week I was asked by a customer if the access mode of a vDisk in PVS could be modified via powershell.  After some research and trial and error, I have figured out the following command will allow you to perform this task via the command line or script.

 

mcli-set disk -p diskLocatorId=’906831ee-80df-4ec7-a52c-bc25efedcd28′,diskLocatorName=vDiskName,siteId=b576df60-a895-4fdb-90b7-738f363102db,storeId=7d80b5ca-162f-41d7-93b8-60129931f5c6 -r WriteCacheType=0

 

Command Anatomy:

mcli-set disk –p : this is the command that allows you to modify the property record of a vDisk.  The ‘p’ switch specifies that the following values are what will be used to locate the vDisk record which needs to be modified.  The required parameters to locate the vDisk are: DiskLocatorID, DiskLocatorName, SiteID, and StoreID.  The ‘r’ switch, allows you to then modify a specific value for that vDisk record which was just specified by the ‘p’ switch.  In this case, that value’s name and value is ‘WriteCacheType=0’.

DiskLocatorID: the Alphanumeric value assigned to the disklocator object.  The disklocator is the terminology used in PVS to identify the vDisk in PVS.

DiskLocatorName: the name of the vDisk.

SiteID:  the alphanumeric value assigned to the site in the PVS console.  This number is used to reference the sites setup via the GUI.  Each site in the console has a unique ID.

StoreID:  the alphanumeric value assigned to the store in the PVS console.  This number is used to reference the store setup via the GUI.  Each store in the console has a unique ID.

WriteCacheType:  This property and the numeric codes assigned at any given point are what specifies the Access Mode for the vDisk.

Image of Disk Record/Image of DiskLocator Record, respectively:

WriteCacheType Codes(PVS 6.1):

0 = Private Mode.

1 = Standard Image, Cache on Server.

3 = Standard Image, Cache in Device RAM.

4 = Standard Image, Cache on Device Hard Drive.

7 = Standard Image, Cache on Server (Persistent).

8 = Standard Image, Cache on Device Hard Drive Persisted (NT 6.1 and Later).