Tips and Tricks – Vitual Machine advanced settings

Shares

Few days back I found very useful PowerCLI script which allow add advance setting to virtual machine without power it down. I thought it might be useful for someone so I decided to document it. Standard process for adding new advance setting is as follows:

  • power VM down
  • add advance setting to VM
  • power VM on

Using below script you can add advance setting to VM without power it down ! The only thing which you have to do after script execution, is do virtual machine vMotion.

Connect-VIServer vCenter_server_name
$vm = Get-View (Get-VM virtual_machine_name).ID
$CfgSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$CfgSpec.extraconfig = New-Object VMware.Vim.optionvalue
# you can use any advanced setting key/value pair here:
$CfgSpec.extraconfig[0].Key="RemoteDisplay.maxConnections"
$CfgSpec.extraconfig[0].Value="1"
$vm.ReconfigVM($CfgSpec)

In the example below RemoteDisplay.maxConnections=1 advance value was added to VM. It will limit concurrent VM console connections to 1.

  1. Run a script,  in a Recent task window new task appears: Reconfigure virtual machine – wait until task complete.

    recent task window

  2. vMotion VM between ESX hosts
  3. check if advance setting was applied,  try to open VM console from two vSphere clients

    mks connection error

As you can see on above item, advance setting was applied successfully to virtual machine configuration without powering VM down.

0 0 votes
Article Rating

Artur Krzywdzinski

Artur is Consulting Architect at Nutanix. He has been using, designing and deploying VMware based solutions since 2005 and Microsoft since 2012. He specialize in designing and implementing private and hybrid cloud solution based on VMware and Microsoft software stacks, datacenter migrations and transformation, disaster avoidance. Artur holds VMware Certified Design Expert certification (VCDX #077).

Subscribe
Notify of
guest
3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Gica Livada
Stan k

Looks awesome, never thought that this is even possible, thanks!

Also, there’s a typo in title: Vitual instead of Virtual

3
0
Would love your thoughts, please comment.x
()
x

FOR FREE. Download Nutanix port diagrams

Join our mailing list to receive an email with instructions on how to download 19 port diagrams in MS Visio format.

NOTE: if you do not get an email within 1h, check your SPAM filters

You have Successfully Subscribed!

Don't miss any posts. Subscribe To Our Newsletter!!

Join our mailing list to receive the latest news and updates from www.vmwaremine.com.

You have Successfully Subscribed!

Pin It on Pinterest