VMware PowerCLI

The Best User Interface for your VMware Datacenter!

New-HardDisk: Add ability to define UnitID, disable CBT and enable Multi-writer

We need the ability to add shared disks to clustered VMs using vvols. The New-HardDisk doesn't allow defining the UnitID, nor disabling CBT, and enabling the Multi-writer setting, so we have to do this in two API calls. The first is to use New-HardDisk, then we have to create a specification from the "vmware.vim.virtualdeviceconfigspec", add selected items to it, then invoke "..ExtensinData.ReconfigVM($spec)". The trouble is that VMware is inconsistent in rejecting this when a VM is powered on (it's about 50/50). The scenario involves a 2-node cluster (oracle on oracleEL actually), where we need to do this on the primary VM (which has live databases that we're adding more disks to). We know the secondary (which refs the disk of the primary) MUST be powered off. This has not been an issue until recent ESXi updates (7.0u3g) where roughly half the time that "ReconfigVM($spec)" fails. This is in a scripted loop, not hand-entered. Moving that extra bit of config to the New-HardDisk cmdlet would make things a lot easier by allowing the disk to be added in one API call rather than two API calls to vCenter (one task vs. two).

  • Guest
  • Oct 28 2022
  • Looking for Feedback
  • Attach files