Configuring iSCSI Storage
vSphere supports software iSCSI, dependent hardware iSCSI, and independent hardware iSCSI. See Configuring iSCSI Adapters and Storage in the vSphere Storage documentation for a detailed discussion.
The following HostStorageSystem methods are available for iSCSI storage management.
AddInternetScsiSendTarget – Adds send target entries to the host bus adapter discovery list if the DiscoveryProperties.sendTargetsDiscoveryEnabled flag is set to true.
AddInternetScsiStaticTargets – Adds static target entries to the host bus adapter discovery list. The DiscoveryProperty.staticTargetDiscoveryEnabled flag must be set to true.
UpdateInternetScsiAdvancedOptions – Updates the advanced options that the iSCSI host bus adapter or the discovery addresses and targets associated with it.
UpdateInternetScsiAlias – Updates the alias of an iSCSI host bus adapter.
UpdateInternetScsiAuthenticationProperties – Updates the authentication properties for one or more targets or discovery addresses associated with an iSCSI host bus adapter.
UpdateInternetScsiDigestProperties – Updates the digest properties for the iSCSI host bus adapter or the discovery addresses and targets associated with it.
UpdateInternetScsiDiscoveryProperties – Updates the discovery properties for an iSCSI host bus adapter.
UpdateInternetScsiIPProperties – Updates the IP properties for an iSCSI host bus adapter.
UpdateInternetScsiName – Updates the name of an iSCSI host bus adapter.
UpdateSoftwareInternetScsiEnabled – Enables and disables software iSCSI in the VMkernel.
RemoveInternetScsiSendTargets – Removes send target entries from the host bus adapter discovery list. The DiscoveryProperty.sendTargetsDiscoveryEnabled must be set to true. If any of the targets provided as parameters are not found in the existing list, the other targets are removed and an exception is thrown.
RemoveInternetScsiStaticTargets – Remove static target entries from the host bus adapter discovery list. The DiscoveryProperty.staticTargetDiscoveryEnabled must be set to true. If any of the targets provided as parameters are not found in the existing list, the other targets are removed and an exception is thrown.
iSCSI initiators and targets have unique, permanent iSCSI names and addresses. An iSCSI name correctly identifies a specific iSCSI initiator or target, regardless of physical location. Names must be in EUI or IQN format, as specified by the storage vendor’s hardware.
Before you can set up iSCSI on a system, you must create a dedicated VMkernel network interface. See Adding a VMkernel Network Interface. You can then enable the VMkernel to support iSCSI and configure the initiator.
To enable the VMkernel to support software iSCSI
1
2
Invoke the UpdateSoftwareInternetScsiEnabled method, passing the reference to the HostStorageSystem and the value true.
To configure iSCSI initiators
1
You can do this by creating a property collector with HostSystem as the starting point. See Property Collector. From the HostSystem.config property, you can obtain the list (array) of host bus adapters by specifying this property path:
config.storageDevice.hostBusAdapter
The property path returns an array of host bus adapters. For example:
hostBusAdapter["key-vim.host.BlockHba-vmhba32"]
hostBusAdapter["key-vim.host.BlockHba-vmhba33"]
hostBusAdapter["key-vim.host.BlockHba-vmhba34"]
hostBusAdapter["key-vim.host.BlockHba-vmhba35"]
hostBusAdapter["key-vim.host.BlockHba-vmhba1"]
...
2
From the array, select the host bus adapter (instance of HostHostBusAdapter) that you want to configure and obtain its key property, which is the device name of the host bus adapter as a string.
3
4
5
Configure the iSCSI name by calling HostStorageSystem.UpdateInternetScisiName and the alias by running HostStorageSystem.UpdateInternetScisiAlias.
6
Configure target discovery by calling HostStorageSystem.UpdateInternetScisiHbaDiscoveryProperties.
The method takes a HostInternetScisiHbaDiscoveryProperties data object that you can configure.
7
(Optional) Set the authentication information by calling HostStorageSystem.UpdateInternetScisiAuthenticationProperties.
The HostInternetScsiHbaAuthenticationProperties object you pass into that method includes properties for configuring CHAP and Mutual CHAP. See the vSphere Storage documentation for information about securing your iSCSI storage array.
8
9
Rescan enables the HBAs to discover the new storage devices. You can either rescan a single HBA with HostStorageSystem.RescanHba, specifying the HBA ID as a parameter, or rescan all HBAs using HostStorageSystem.RescanAllHba.