VMware

This Question is Answered

2 "helpful" answers available (6 pts)
4 Replies Last post: May 24, 2009 10:30 PM by mrajani  

How to remove an extraConfig setting posted: Apr 18, 2009 6:58 PM

Click to view chavez9119's profile Novice 23 posts since
May 25, 2006
I added the following extraconfig settings

isolation.tools.copy.enable=false
isolation.tools.paste.enable=false

What I should have added was

isolation.tools.copy.disable=true
isolation.tools.paste.disable=true

How can I change or delete these settings?

Here is how I added it originally:

connect-viserver $args[0]

$vmConfigSpec1 = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec1.extraconfig += New-Object VMware.Vim.optionvalue
$vmConfigSpec1.extraconfig[0].Key="isolation.tools.copy.enable"
$vmConfigSpec1.extraconfig[0].Value="false"

$vmConfigSpec2 = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec2.extraconfig += New-Object VMware.Vim.optionvalue
$vmConfigSpec2.extraconfig[0].Key="isolation.tools.paste.enable"
$vmConfigSpec2.extraconfig[0].Value="false"

$VMs = Get-Cluster $args[1] | Get-VM | % {Get-View $_.Id}

foreach ($vm in $VMs) {
$vm.ReconfigVM($vmConfigSpec1)
$vm.ReconfigVM($vmConfigSpec2)
}

Re: How to remove an extraConfig setting

1. Apr 19, 2009 3:53 AM in response to: chavez9119
Click to view LucD's profile Champion 2,431 posts since
Oct 31, 2005
Afaik you can't with the ReconfigVM method of the SDK.
Although the SDK Reference states "An option is removed if the key is present but the value is not set or the value is an empty string." in the VirtualMachineConfigSpec object for the extraConfig property this doesn't seem to work.
This is apparently confirmed by the message you get in the VIC when you go to <Edit Settings><Options><General><Configuration Parameters>. There you get a message saying "Entries cannot be removed".

What you can do is to blank out the keys you don't want to apply anymore.
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.extraconfig += New-Object VMware.Vim.optionvalue
$vmConfigSpec.extraconfig[0].Key="isolation.tools.copy.enable" 
$vmConfigSpec.extraconfig[0].Value=""

$vmConfigSpec.extraconfig += New-Object VMware.Vim.optionvalue
$vmConfigSpec.extraconfig[1].Key="isolation.tools.paste.enable" 
$vmConfigSpec.extraconfig[1].Value=""

$VMs = Get-Cluster $args[1] | Get-VM | % {Get-View $_.Id}

foreach ($vm in $VMs) {
  $vm.ReconfigVM($vmConfigSpec)
} 

Note that you don't need to call ReconfigVM for each key, you can all the keys into the extraconfig array and call the method once.

Re: How to remove an extraConfig setting

2. May 24, 2009 4:49 PM in response to: LucD
Click to view mrajani's profile Enthusiast 27 posts since
Dec 6, 2007

Hi LucD,

This did not work for me. There were no errors, but the variables were not removed.

Re: How to remove an extraConfig setting

3. May 24, 2009 9:56 PM in response to: mrajani
Click to view LucD's profile Champion 2,431 posts since
Oct 31, 2005
This doesn't remove the variables but blanks them out.
Weren't the variables blanked out ?
Which specific setting did you try to remove/blank out ?

Re: How to remove an extraConfig setting

4. May 24, 2009 10:30 PM in response to: LucD
Click to view mrajani's profile Enthusiast 27 posts since
Dec 6, 2007

Thanks LucD,

It was just setting the values to null. I wanted them removed.

From the subject of this thread it seemed that it would remove the variables.


VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities