ezrapagel/knife-vsphere — pull request #43 by fapestniegd (2013-06-05 14:56:37+00:00)
Title: Added Automatic LUN selection and auto creation of LSILogic SCSI Adapters

Running:
knife vsphere vm vmdk add --vmdk-type thick host.example.org 50GB
will now search all of the LUNs associated with the VM for available space, not just the first one, and will choose the first one that has the available space, but not exceed 90%

Running:
knife vsphere vm vmdk add --vmdk-type thick --target-lun "LUN_60_Lab_Packages" host.example.org 50GB
will now put the vmdk on the specified LUN, making the vm directory if it doesn't exist.

Running:
knife vsphere vm vmdk add --vmdk-type thick --target-lun "LUN_[0-9]+_Lab_Packages" host.example.org 50GB
will now use a regex on --target-lun to put the vmdk on the first LUN that matches the pattern and has the space available, but will not exceed 90% so snapshots may still be used.

LSILogic SCSI controllers will be added as needed, until you hit 4 controllers and 60 vmdks, which is the current limit of ESX.

By repeatedly running
knife vsphere vm vmdk add --vmdk-type thick --target-lun "LUN_[0-9]+_Lab_Packages" host.example.org 50GB
you can just keep adding storage to a vm until you hit the ESX device limit.