3 Replies Latest reply on Aug 2, 2017 8:34 AM by vinny95

    Delete vCloud Director related Custom Attribute on a VM

    clavelstephane Novice



      Following Tomas Fojta's blog post

      How to Export Running VM from vCloud Director – Tom Fojta's Blog


      I'm looking for a way to automate step 4: Remove vCloud Director related Custom Attribute on a set of powered on VMs


      I gave a try with powerCLI, this gives the below error to me, whether the VM is powered on or off by the way.


      PowerCLI E:\LabShare\Scripts> $vm.CustomFields.remove(“system.service.vmware.vsla.fraise”)

      Exception calling “Remove” with “1” argument(s): “Cannot remove value from a
      read-only dictionary.”
      At line:1 char:1
      + $vm.CustomFields.remove(“system.service.vmware.vsla.fraise”)
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
      + FullyQualifiedErrorId : InvalidOperationException


      Help welcome !