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)
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)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
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)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
@LucD 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
Which PowerCLI version are you using?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
@LucD Below are the details
PowerCLI Version
----------------
VMware PowerCLI 12.2.0 build 17538434
Upgrade to 12.5, which has the correct framework for 7.0.2
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
@LucD 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.
Do you mean invoke PowerShell from a bash script?
That should work.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
@LucD i don't won't to invoke powershell script from bash, i need to rewrite code in bash script
Sorry, can't help you with that.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference