new1234.jpg

Archive

Posts Tagged ‘Virtual Machine’

VMware: Disable HotPlug capability for virtual machines with PowerCLI

January 16th, 2016 2 comments

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:

  1. Connect to the ESXi/ESX host or vCenter Server using the vSphere Client.
  2. Power off the virtual machine.
  3. Right-click the virtual machine and click Edit Settings.
  4. Click the Options tab.
  5. Click General > Configuration Parameters > Add Row.
  6. Insert a new row with the name devices.hotplug and a value of false.
  7. Power on the virtual machine.

To disable HotPlug capability using the vSphere Web Client:

  1. From a web browser, connect to the vSphere Web Client.
  2. Log in with Administrator credentials.
  3. Navigate to the virtual machine you want to modify.
  4. Right-click the virtual machine and select Edit Settings.
  5. Click the VM Options tab.
  6. Click Advanced > Edit Configuration > Add Row.
  7. Insert a new row with the name devices.hotplug and a value of false.
  8. Power on the virtual machine.

To disable HotPlug capability by editing the .vmx file:

  1. Power off the virtual machine.
  2. Access the ESXi/ESX service console using an SSH client.
  3. Open the virtual machine configuration file (.vmx) in a text editor. The default location is:
    /vmfs/volumes/datastore_name/vm_name/vm_name.vmx
  4. Add the line:
    devices.hotplug = "false"
    Note: This setting does not interfere with HotPlug CPU/memory.
  5. Save and close the file.
  6. Power on the virtual machine.
    More information:

VMware

sanderdaems

Sander Daems is founder and author of this blog and working as a Sr. Infrastructure Consultant by IT-Value. Sander has over 10 years experience in IT, primary focus: virtualization, storage and SBC

More Posts - Website

Follow Me:
TwitterLinkedIn

VMware: VM auto suspend in 30 minutes.. wtf??

December 7th, 2011 15 comments

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

 

image

Okay… shame shame.. the solution:

image

Tip: Always configure profile: High performance

sanderdaems

Sander Daems is founder and author of this blog and working as a Sr. Infrastructure Consultant by IT-Value. Sander has over 10 years experience in IT, primary focus: virtualization, storage and SBC

More Posts - Website

Follow Me:
TwitterLinkedIn

Categories: VMware Tags: , ,

VMware: Easy menu to find VM network adapter by MAC address

November 1st, 2011 6 comments

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 *
#====================================================================#

image

sanderdaems

Sander Daems is founder and author of this blog and working as a Sr. Infrastructure Consultant by IT-Value. Sander has over 10 years experience in IT, primary focus: virtualization, storage and SBC

More Posts - Website

Follow Me:
TwitterLinkedIn

VMware: FAILED: Unable to obtain the IP address of the helper virtual machine

March 30th, 2011 33 comments

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

image

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.

image

 

The VM will boot with the configured network settings:

image

 

P2V status:

image

sanderdaems

Sander Daems is founder and author of this blog and working as a Sr. Infrastructure Consultant by IT-Value. Sander has over 10 years experience in IT, primary focus: virtualization, storage and SBC

More Posts - Website

Follow Me:
TwitterLinkedIn