51
To check if an SR has been upgraded, verify that its sm-config:use_vhd key is true. To check if a VDI was
created with type=raw, check its sm-config map. The sr-param-list and vdi-param-list xe commands can
be used respectively for this purpose.

Creating a Raw Virtual Disk Using the xe CLI

1. Run the following command to create a VDI given the UUID of the SR you want to place the virtual disk in:
xe vdi-create sr-uuid=<sr-uuid> type=user virtual-size=<virtual-size> \
name-label=<VDI name> sm-config:type=raw
2. Attach the new virtual disk to a VM and use your normal disk tools within the VM to partition and format,
or otherwise make use of the new disk. You can use the vbd-create command to create a new VBD to map
the virtual disk into your VM.
Converting Between VDI Formats
It is not possible to do a direct conversion between the raw and VHD formats. Instead, you can create a new VDI
(either raw, as described above, or VHD if the SR has been upgraded or was created on XenServer 5.5 or later)
and then copy data into it from an existing volume. Citrix recommends that you use the xe CLI to ensure that the
new VDI has a virtual size at least as big as the VDI you are copying from (by checking its virtual-size field, for
example by using the vdi-param-list command). You can then attach this new VDI to a VM and use your preferred
tool within the VM (standard disk management tools in Windows, or the dd command in Linux) to do a direct
block-copy of the data. If the new volume is a VHD volume, it is important to use a tool that can avoid writing
empty sectors to the disk so that space is used optimally in the underlying storage repository — in this case a
file-based copy approach may be more suitable.
Probing an SR
The sr-probe command can be used in two ways:
1. To identify unknown parameters for use in creating a SR.
2. To return a list of existing SRs.
In both cases sr-probe works by specifying an SR type and one or more device-config parameters for that
SR type. When an incomplete set of parameters is supplied the sr-probe command returns an error message
indicating parameters are missing and the possible options for the missing parameters. When a complete set of
parameters is supplied a list of existing SRs is returned. All sr-probe output is returned as XML.
For example, a known iSCSI target can be probed by specifying its name or IP address, and the set of IQNs available
on the target will be returned:
xe sr-probe type=lvmoiscsi device-config:target=<192.168.1.10>
Error code: SR_BACKEND_FAILURE_96
Error parameters: , The request is missing or has an incorrect target IQN parameter, \
<?xml version="1.0" ?>
<iscsi-target-iqns>
<TGT>
<Index>
0
</Index>
<IPAddress>
192.168.1.10
</IPAddress>
<TargetIQN>
iqn.192.168.1.10:filer1
</TargetIQN>
</TGT>
</iscsi-target-iqns>
Probing the same target again and specifying both the name/IP address and desired IQN returns the set of SCSIids
(LUNs) available on the target/IQN.