VMware Cloud Community
sanjaygpt171
Enthusiast
Enthusiast
Jump to solution

Enable Encrypted FT to required from Oppurtunistic

@LucD 

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)

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

10 Replies
sanjaygpt171
Enthusiast
Enthusiast
Jump to solution

@LucD Any help would be appreciated 

Tags (1)
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

sanjaygpt171
Enthusiast
Enthusiast
Jump to solution

@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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Which PowerCLI version are you using?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
sanjaygpt171
Enthusiast
Enthusiast
Jump to solution

@LucD Below are the details

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Upgrade to 12.5, which has the correct framework for 7.0.2


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

sanjaygpt171
Enthusiast
Enthusiast
Jump to solution

@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. 

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
sanjaygpt171
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Sorry, can't help you with that.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos