new1234.jpg

Archive

Posts Tagged ‘vmx’

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: Repeated characters when typing in remote console

April 7th, 2015 1 comment

Everyone knows the hanging keyboard console session issue, when you type your username or password the keyboard hangs. If you access a virtual machine console over a slow connection, you’ll encounter keyboard sync issues

If you open a remote console to a virtual machine from a slow network connection (such as a VPN) while tethered to a mobile phone providing Internet access, the experience is not optimal, as keyboard and mouse gestures aren’t timed exactly the same. This is especially problematic if you try to enter a password where the characters are masked.

image

  

Solution

There are two ways to add a extra line in the configuration file of the virtual machine,

 

Option 1. Edit VMX file directly

1. Power off the virtual machine.

2. Add a line, similar to this, at the end of your virtual machine’s configuration (.vmx) file

keyboard.typematicMinDelay = "2000000"

The delay is specified in micro-seconds, so the line in the example above increases the repeat time to 2 seconds. This should ensure that you never get auto-repeat unless you intend it.

image

3. Power on the virtual machine.

 

Option 2. Edit VMX via vSphere Client

1. Power off the virtual machine.

2. Edit settings > Options > General > Configuration Parameters, add new row with text:

keyboard.typematicMinDelay = "2000000"

The delay is specified in micro-seconds, so the line in the example above increases the repeat time to 2 seconds. This should ensure that you never get auto-repeat unless you intend it.

image
3. Power on the virtual machine.

 

Ps. You can edit the .VMX files directly, but a better practice is to configure this value within the vSphere Client for a virtual machine template. When you consider that most of the access to a virtual machine is provided by tools such as remote desktop, there is no harm in configuring this value globally for all virtual machines that originate from a template

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] Could not start VMX: msg.vmk.status.VMK_NO_MEMORY

March 29th, 2015 4 comments

Last week I had some issues with starting virtual machines on vSphere 5.5 hosts (enough capacity available), when I try to start up the VM I receive message:

Could not start VMX: msg.vmk.status.VMK_NO_MEMORY”

An error was received from the ESX host while powering on VM [name]
Head globalCartel-1 already at its maximum size of 7869288. Cannot expand
Could not start VMX: msg.vmk.status.VMK_NO_MEMORY

image

 

Cause

This issue is caused by a memory leak in the driver which fills the SWAP memory of the ESXi host, making it unable to response to any requests at all. This issue occurs with ESXi hosts running on HP hardware with these versions of AMS:

  • hp-ams 500.9.6.0-12.434156
  • hp-ams-550.9.6.0-12.1198610
  • hp-ams 500.10.0.0-18.434156
  • hp-ams-550.10.0.0-18.1198610


Solution

This is a known issue affecting ESXi 5.x. To resolve this issue, upgrade to AMS version 10.0.1.

For ESXi 5.0 and 5.1, see:

For ESXi 5.5, see:

 

Note: In some cases, commands running on the ESXi host fails with cant’t fork.  In this case the virtual machines running on the ESXi host needs to be powered off and the ESXi host rebooted. To verify the installed versions of AMS, run this command:

esxcli software vib list | grep ams

To remove the package on all hosts running on these AMS versions:

  1. Log in to the host using SSH. For more information, see Using ESXi Shell in ESXi 5.x and 6.0 (2004746).
  2. Run this command to stop the HP service (does not persist on reboot):
    /etc/init.d/hp-ams.sh stop
  3. Run this command to remove the VIB:
    esxcli software vib remove -n hp-ams
  4. Reboot the host.
    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: Nesting Hyper-V 2012 R2 on vSphere ESXi 5.5

August 28th, 2014 3 comments

In my test environment I configured tree Hyper-V 2012R2 servers nested on vSphere 5.5,  the configuration was very easy, here some details:

1. Deploy a Windows 2012R2 server, use GuestOS Windows 2012 (64-bit)

2. Upgrade hardware level to version 10

3. Remove the virtual machine from the vCenter inventory

4. Download and edit the .vmx file, add the following lines:

vhv.enable = “TRUE”
hypervisor.cpuid.v0 = “FALSE”
mce.enable = “TRUE”

 image

5. Upload and re-add the .vmx file to the vCenter inventory

6. Edit the virtual machine hardware > CPU > Hardware virtualization> select: Expose hardware assisted virtualization to the guest OS

*Note: you need to upgrade to HW level 10, otherwise the hardware virtualization tab is grayed out.

 image

7. Power on the virtual machine

8. Now you are able to select the Hyper-V role, finish the setup

image

 

Ejoy!

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: Install Windows 8 in vSphere 5

March 22nd, 2012 2 comments

I tried to install Windows 8 at my vSphere 5 patch 1 environment, but after starting the VM I received a warning:

Your computer ran into a problem and needs to restart.

If you’d like to know more, you can search online later for this code: HAL_INITIALIZATION_FAILED

It’s collecting error info and will restart in: 0 seconds

image

 

Solution:

Only you have to do is add the new guest OS in you’re .vmx file, re-add the file to your vSphere inventory and start the VM. Guest OS you need to add:

guestOS = "windows8srv-32"
guestOS = "windows8srv-64"

image[2]

 

Note: if you’re running vSphere 5 without Update 1 you need to install Patch 02

Read more…

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: Microsoft, VMware Tags: , , ,

VMware: The MAC Address entered is not in the valid range

May 31st, 2011 3 comments

After configuring a manual MAC address on a MAC based license server I received a error message:

The MAC Address entered is not in the valid range. Valid values are between 00:50:56:00:00:00 and 00:50:56:3F:FF:FF:FF

Error message:

image

 

Solution:

Without additional setting in the .VMX config file you won’t be able to assign a static MAC address in the range your require. To disable mac address checking before boot add the following line in the .VMX file.

ethernetX.checkMACAddress = “false”

 

image

 

Re-upload the .VMX config to the datastore and add the virtual machine to the inventory:

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

Categories: VMware Tags: , , , ,

VMware: Insufficient video RAM. The maximum resolution of the virtual machine will be limited to 1672×1254

January 16th, 2011 9 comments

I created a new VM via the “New virtual machine" wizard at my ESXi 4.1 server, after configuring the correct network settings and added some disks I started the VM.. but received this warning:

Insufficient video RAM. The maximum resolution of the virtual machine will be limited to 1672×1254. To use the configured maximum resolution of 2560×1600, increase the amount of video RAM allocated to this virtual machine by setting svga.vramSize="16384000" in the virtual machine’s configuration file.

image

 

Solution:

– Edit the VM settings

– Select: Video card

– Select: “Auto-detect video settings”

– Power on your VM… and it’s working

 

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: HP Management Agent “An active Virtual Machine [ IP] has been detected on host”

October 4th, 2010 3 comments

Today I was busy to to install some HP Managent Agents 8.60 on a DL380 G6, after entering the host in maintenance mode, extracting the HP software in the /tmp/ folder I was ready to install the agent. By running the command “./install860.sh –install” I received the warning that some VM’s still running and must be powered down before you install the agent, warning:

An active Virtual Machine [ ***.***.***.*** ] has been detected on host [*****.*****.local]

And:

Please modify the state of the VMs to be Suspended or powered off and then retry Agents Installation.

See full message log:

 

[root@********* 860]# ./install860vibs.sh –install

HP Insight Manager Agent 8.6.0-11 Installer for VMware ESX
Target System is VMware ESX 4.0.0 build-208167
Server:  ProLiant DL380 G6

This script will now attempt to set ESX Host in Maintenance Mode
for IM agents install.
Do you wish to continue? (y/n) y

(vim.fault.NotFound) {
   dynamicType = <unset>,
   faultCause = (vmodl.MethodFault) null,
   msg = "Unable to find a VM corresponding to "***.***.***.***"",
}
(vim.fault.NotFound) {
   dynamicType = <unset>,
   faultCause = (vmodl.MethodFault) null,
   msg = "Unable to find a VM corresponding to "***.***.***.***"",
}
An active Virtual Machine [ ***.***.***.*** ] has been detected on host [*****.*****.local]

The ESX host will be put into maintenance mode
   to be able to install/uninstall the agents.
The Virtual Machines must be either Powered off or Suspended
   by the operator to allow the transition
   of the ESX host into maintenance mode.
Please modify the state of the VMs to be Suspended or powered off
   and then retry Agents Installation.

[root@********* 860]#

Read more…

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: Unable “Add to Invetory” option is greyed out

June 22nd, 2010 9 comments

Today I got some trouble with my Exchange production VM, my VMware Data Recovery 1.2 created many snapshots.. and removed the VM from the vCenter inventory… ok not a big issue, but on the datastore I can’t Add it to the inventory again, the option “Add to Inventory” is greyed out.

VMpros.nl

Solution:

On the console I added the VM again in vCenter with the vmware-cmd option:

image

Read more…

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