vmware / dscr-for-vmware

The Repository contains Microsoft PowerShell Desired State Configuration (DSC) Resources for managing VC and ESXi settings.
Other
140 stars 41 forks source link

[Feature] Update DSC Resource VMHostIScsiHba to allow iSCSI name to be set #285

Closed mikedonleyuoy closed 3 years ago

mikedonleyuoy commented 4 years ago

Current DSC resource allows specifying of chap username/password, etc, but not changing of the iSCSI name. By default, ESXi appends a random set of characters to the end of the name. This randomness causes issues when exportingf iSCSI LUNs from an iSCSI SAN as the node name cannot be predicted. Updating the resource to allow the name to be set will resolve this.

SimeonGerginov commented 4 years ago

Unfortunately the name of the iSCSI Host Bus Adapter is a key for the DSC Resource and is used to uniquely identify it. If we allow the name to be modified than there is no way to found the desired iSCSI Host Bus Adapter because iSCSI Host Bus Adapter with the new name won't be found.

For the export you can use the script mentioned here: https://blogs.vmware.com/PowerCLI/2020/03/exporting-vmhost-dsc-config.html, and you can specify to export only iSCSI Host Bus Adapters.

mikedonleyuoy commented 4 years ago

OK, I perhaps misunderstood the 'name' parameter in the DSC resource (or I'm not going a good job as being clear of my requirements!).

I understood 'name' would be the HBA name, ie. vmhba68. I'm wanting to change the iSCSI Initiator name. e.g. iqn.1998-01.com.vmware:,myesx1-207ab096 to something like iqn.1998-01.com.vmware:myesx1

SimeonGerginov commented 4 years ago

Ok, yes this is certainly possible - we can add a new additional parameter to change the iSCSI Initiator name. So we will extend the existing VMHostIScsiHba DSC Resource.

mikedonleyuoy commented 4 years ago

Awesome thanks, and apologies for not being clear!

SimeonGerginov commented 3 years ago

VMHostIScsiHba DSC Resource was extended with IScsiName property with PR #298. For more information and examples, check the documentation of the VMHostIScsiHba DSC Resource here.