Automation

 View Only
  • 1.  Enable Encrypted FT to required from Oppurtunistic

    Posted Mar 03, 2022 11:57 AM

     

    I need to change Encrypted vmotion and Encrypted FT to "REQUIRED" from "Oppurtunistic"

    I can change vmotion using below code but cannot change Encrypted FT.  Let me know, what we can add here 

     

    $VMView = Get-VM  | Get-View
    $Config = New-Object VMware.Vim.VirtualMachineConfigSpec
    $Config.MigrateEncryption = New-Object VMware.Vim.VirtualMachineConfigSpecEncryptedVMotionModes
    $Config.MigrateEncryption = "required"
    $VMView.ReconfigVM($Config)



  • 2.  RE: Enable Encrypted FT to required from Oppurtunistic

    Posted Mar 03, 2022 01:24 PM

     Any help would be appreciated 



  • 3.  RE: Enable Encrypted FT to required from Oppurtunistic
    Best Answer

    Posted Mar 03, 2022 02:33 PM

    Try something like this.
    Note this requires at least ESXi 7.0.2

    $vm = Get-VM -Name 'Test'
    
    $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
    $spec.MigrateEncryption = [vmware.vim.VirtualMachineConfigSpecEncryptedVMotionModes]::required  
    $spec.FtEncryptionMode = [VMware.Vim.VirtualMachineConfigSpecEncryptedFtModes]::ftEncryptionRequired
    $vm.ExtensionData.ReconfigVM_Task($spec)
    


  • 4.  RE: Enable Encrypted FT to required from Oppurtunistic

    Posted Mar 03, 2022 02:50 PM

     getting below error with FT. Esxi version VMware ESXi, 7.0.2, 18538813

     

    Unable to find type [VMware.Vim.VirtualMachineConfigSpecEncryptedFtModes].
    At C:\encryptvmotion.ps1:5 char:26
    + ... ptionMode = [VMware.Vim.VirtualMachineConfigSpecEncryptedFtModes]::ft ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (VMware.Vim.Virt...ncryptedFtModes:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound



  • 5.  RE: Enable Encrypted FT to required from Oppurtunistic

    Posted Mar 03, 2022 03:07 PM

    Which PowerCLI version are you using?



  • 6.  RE: Enable Encrypted FT to required from Oppurtunistic

    Posted Mar 04, 2022 05:01 AM

     Below are the details

    PowerCLI Version
    ----------------
    VMware PowerCLI 12.2.0 build 17538434



  • 7.  RE: Enable Encrypted FT to required from Oppurtunistic

    Posted Mar 04, 2022 06:09 AM

    Upgrade to 12.5, which has the correct framework for 7.0.2



  • 8.  RE: Enable Encrypted FT to required from Oppurtunistic

    Posted Apr 12, 2022 07:33 AM

      Can we do it same from bash scripting. I am new to bash and not sure how to convert this script in bash. If you can convert it to bash , it will be very helpful. 



  • 9.  RE: Enable Encrypted FT to required from Oppurtunistic

    Posted Apr 12, 2022 07:36 AM

    Do you mean invoke PowerShell from a bash script?
    That should work.



  • 10.  RE: Enable Encrypted FT to required from Oppurtunistic

    Posted Apr 12, 2022 07:47 AM

     i don't won't to invoke powershell script from bash, i need to rewrite code in bash script



  • 11.  RE: Enable Encrypted FT to required from Oppurtunistic

    Posted Apr 12, 2022 07:49 AM

    Sorry, can't help you with that.