Last week I had to change VMX files for 500 XenDesktop machines because the users where able to eject removable devices
To mass disable HotPlug capability by editing the .vmx
file via PowerCLI I used the following script:
$key = "devices.hotplug"
$value = "false"
get-cluster "CL02.XD" | get-VM -Name 000-CXD* | foreach {
$vm = Get-View $_.Id
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.extraconfig += New-Object VMware.Vim.optionvalue
$vmConfigSpec.extraconfig[0].Key=$key
$vmConfigSpec.extraconfig[0].Value=$value
$vm.ReconfigVM($vmConfigSpec)
}
Optional (manual) options:
You can disable HotPlug capability using the vSphere Client or by editing the .vmx
file.
Note: You can disable HotPlug capability for PCI devices such as e1000 or vmxnet3 NICs.
To disable HotPlug capability using the vSphere Client:
- Connect to the ESXi/ESX host or vCenter Server using the vSphere Client.
- Power off the virtual machine.
- Right-click the virtual machine and click Edit Settings.
- Click the Options tab.
- Click General > Configuration Parameters > Add Row.
- Insert a new row with the name
devices.hotplug
and a value of false
.
- Power on the virtual machine.
To disable HotPlug capability using the vSphere Web Client:
- From a web browser, connect to the vSphere Web Client.
- Log in with Administrator credentials.
- Navigate to the virtual machine you want to modify.
- Right-click the virtual machine and select Edit Settings.
- Click the VM Options tab.
- Click Advanced > Edit Configuration > Add Row.
- Insert a new row with the name
devices.hotplug
and a value of false
.
- Power on the virtual machine.
To disable HotPlug capability by editing the .vmx
file:
- Power off the virtual machine.
- Access the ESXi/ESX service console using an SSH client.
- Open the virtual machine configuration file (
.vmx
) in a text editor. The default location is:
/vmfs/volumes/datastore_name/vm_name/vm_name.vmx
- Add the line:
devices.hotplug = "false"
Note: This setting does not interfere with HotPlug CPU/memory.
- Save and close the file.
- Power on the virtual machine.
More information:
VMware
Sander Daems is founder and author of this blog and working as a Lead (Sr.) Consultant by UNICA ICT Solutions. Sander has over 15 years experience in IT, primary focus: virtualization and modern worksplace.
More Posts - Website
Follow Me:


Sometimes.. grrr, stupid me!!.. I’ve configured last week a new Windows 7 x64 virtual machine, but this machine suspend itself after 30 minutes, I thought it was a bug.. couldn’t find any setting configured in vCenter or the particular host but saw only this messages:
Virtual machine is suspended – by User

Okay… shame shame.. the solution:

Tip: Always configure profile: High performance
Sander Daems is founder and author of this blog and working as a Lead (Sr.) Consultant by UNICA ICT Solutions. Sander has over 15 years experience in IT, primary focus: virtualization and modern worksplace.
More Posts - Website
Follow Me:


Last week I need to locate some traffic from physical switches to my virtual environment.. I need to find out which MAC address belong to which virtual machine (+ adapter).. time to script this include menu
#====================================================================#
# SCRIPT: Find_VM_by_MAC_address_menu.ps1 #
# FUNCTION: Find VM (+ adapter) by MAC address with easy menu #
# OWNER: Sander Daems #
# CREATED: 11/01/2011 #
# MODIFIED: 11/01/2011 #
# VERSION: v.1.0 #
#====================================================================#
# CHANGELOG: #
# #
# v.1.0 #
# - Created script; #
# #
#====================================================================#
# HOST - CUSTOM DEFINITIONS #
#====================================================================#
Write-Host "Let's find that damn address" -foregroundcolor green
#====================================================================#
$cluster = read-host "Select Cluster name"
$macaddress = read-host "Select MAC Address to find"
#====================================================================#
# Script #
#====================================================================#
Get-Cluster $cluster | Get-VM | Get-NetworkAdapter | Where-Object {$_.MacAddress -eq "$macaddress"} | Format-List -Property *
#====================================================================#

Sander Daems is founder and author of this blog and working as a Lead (Sr.) Consultant by UNICA ICT Solutions. Sander has over 15 years experience in IT, primary focus: virtualization and modern worksplace.
More Posts - Website
Follow Me:


After migrating the last Linux Suse Enterprise 32-bit physical machine with VMware Converter Standalone 4.3 I received a error:
FAILED: Unable to obtain the IP address of the helper virtual machine

Solution:
The solution is simple, by converting the physical machine to a virtual machine the VM will start directly. By starting the VM the mounted Converter ISO will boot with a VM HelperNetwork. In case you’re VLAN doesn’t have DHCP functionality you need to configure a static IP for the VM HelperNetwork.
To assign a static IP address to the Helper virtual machine, select Use the following IP address: and specify the IP address, subnet mask, and default gateway. Be sure the IP address you specify for the Helper virtual machine is not already in use on the network.
(Optional) To configure the DNS server address manually, select Use the following DNS server address: and type the preferred DNS server address. Optionally, type and alternate DNS server address.
Select another option to set or click Next to view a summary of the conversion task. Converter Standalone uses the IP address and DNS server you specified to copy data from the source Linux machine to the destination virtual machine during conversion.

The VM will boot with the configured network settings:

P2V status:

Sander Daems is founder and author of this blog and working as a Lead (Sr.) Consultant by UNICA ICT Solutions. Sander has over 15 years experience in IT, primary focus: virtualization and modern worksplace.
More Posts - Website
Follow Me:


Recent Comments