47
Note:
This works on new VDI creation in the selected FlexVol, or on all FlexVols during an SR scan and overrides
any manual size adjustments made by the administrator to the SR FlexVols.
To create a NetApp SR, use the following command.
xe sr-create host-uuid=<valid_uuid> content-type=user \
name-label=<"Example shared NetApp SR"> shared=true \
device-config:target=<192.168.1.10> device-config:username=<admin_username> \
device-config:password=<admin_password> \
type=netapp

Managing VDIs in a NetApp SR

Due to the complex nature of mapping VM storage objects onto NetApp storage objects such as LUNs,
FlexVols and disk Aggregates, the plugin driver makes some general assumptions about how storage
objects should be organized. The default number of FlexVols that are managed by an SR instance is 8,
named XenStorage_<SR_UUID>_FV<#> where # is a value between 0 and the total number of FlexVols
assigned. This means that VDIs (LUNs) are evenly distributed across any one of the FlexVols at the point that
the VDI is instantiated. The only exception to this rule is for groups of VM disks which are opportunistically
assigned to the same FlexVol to assist with VM cloning, and when VDIs are created manually but passed a
vmhint flag that informs the backend of the FlexVol to which the VDI should be assigned. The vmhint may
be a random string, such as a uuid that is re-issued for all subsequent VDI creation operations(to ensure
grouping in the same FlexVol), or it can be a simple FlexVol number to correspond to the FlexVol naming
convention applied on the Filer. Using either of the following 2 commands, a VDI created manually using
the CLI can be assigned to a specific FlexVol:
xe vdi-create uuid=<valid_vdi_uuid> sr-uuid=<valid_sr_uuid> \
sm-config:vmhint=<valid_vm_uuid>
xe vdi-create uuid=<valid_vdi_uuid> sr-uuid=<valid_sr_uuid> \
sm-config:vmhint=<valid_flexvol_number>

Taking VDI snapshots with a NetApp SR

Cloning a VDI entails generating a snapshot of the FlexVol and then creating a LUN clone backed off the
snapshot. When generating a VM snapshot you must snapshot each of the VMs disks in sequence. Because
all the disks are expected to be located in the same FlexVol, and the FlexVol snapshot operates on all
LUNs in the same FlexVol, it makes sense to re-use an existing snapshot for all subsequent LUN clones. By
default, if no snapshot hint is passed into the backend driver it will generate a random ID with which to name
the FlexVol snapshot. There is a CLI override for this value, passed in as an epochhint. The first time
the epochhint value is received, the backend generates a new snapshot based on the cookie name. Any
subsequent snapshot requests with the same epochhint value will be backed off the existing snapshot:
xe vdi-snapshot uuid=<valid_vdi_uuid> driver-params:epochhint=<cookie>
During NetApp SR provisioning, additional disk space is reserved for snapshots. If you plan to not use the
snapshotting functionality, you might want to free up this reserved space. To do so, you can reduce the value
of the other-config:multiplier parameter. By default the value of the multiplier is 2.4, so the amount
of space reserved is 2.4 times the amount of space that would be needed for the FlexVols themselves.
Software iSCSI Support
XenServer provides support for shared SRs on iSCSI LUNs. iSCSI is supported using the open-iSCSI
software iSCSI initiator or by using a supported iSCSI Host Bus Adapter (HBA). The steps for using iSCSI