Mar
3
2011

Set Hyperthreading Sharing Options for a Virtual Machine

Will configuring a VM template for a VMware View 4.5 environment with 1200 desktops, I was exploring the advanced CPU options of a VM. There I saw a option: hypertreaded core sharing
I’m not sure if my explanation below is correct so please correct me if you think I’m wrong!

As I did not know what this option does I looked it up in the vSphere Resource Management Guide:

You can specify how the virtual CPUs of a virtual machine can share physical cores on a hyperthreaded system.
Two virtual CPUs share a core if they are running on logical CPUs of the core at the same time. You can set
this for individual virtual machines.

So in other words, do you want to share a core between VMs or not.
This is only the case if you have a 2 vCPU VM running on a host with hyperthreating enabled.

You have the following options:

Any
The default for all virtual machines on a hyperthreaded system. The virtual CPUs of a virtual machine
with this setting can freely share cores with other virtual CPUs from this or any other virtual machine at
any time.

None
Virtual CPUs of a virtual machine should not share cores with each other or with virtual CPUs from other
virtual machines. That is, each virtual CPU from this virtual machine should always get a whole core to
itself, with the other logical CPU on that core being placed into the halted state.

Internal
This option is similar to none. Virtual CPUs from this virtual machine cannot share cores with virtual
CPUs from other virtual machines. They can share cores with the other virtual CPUs from the same virtual
machine.
You can select this option only for SMP virtual machines. If applied to a uniprocessor virtual machine,
the system changes this option to none.

So I was configuring a VM template for a 1200 VMware View deployment. My vSphere host had hyperthreading enabled. Al of my VMs have 1 vCPU so I used the option None. But what if you have 2 or more vCPU VMs and 1 vCPU VMs combined in the same cluster. In that case there is a high change that a 2 vCPU vm and a 1 vCPU VM share the same CPU core. I that case this will effect your performance.

You can work around this problem .
1. Seperate your 1 vCPU VMs and multiple vCPU VMs on different clusters so you won’t mix those VMs.
2. Only provide 1 vCPU VMs.
3. Set the option Hyperthreaded Core Sharing under the advanced settings of your VM to None.

Feb
22
2011

The host bus adapter is not associated with a vmknic. To configure targets the adapter should be associated with a vmknic. Refer to the VMware documentation to associate the adapter with a vmknic.

This warning indicated that you probably have Broadcom NIC in your ESX host with TOE and you haven’t assigned a vmknic to the iSCSI vmhba.

To assign a vmnic to a vmhba do the following:

  • Go to the COS of you ESX host. If you’re using ESXi you may have to enable Remote Tech Support
  • Check the assigned vmknic to the vmhba by entering: esxcli swiscsi vmnic list -d vmhba32
  • Now check the current availible vmknic where a vmk port is assigned: esxcfg-vmknic -l
  • Bind the vmknic to the vmhba: esxcli swiscsi nic add -n vmk0 -d vmhba32
  • Verify if the binding is all right: esxcli swiscsi vmnic list -d vmhba32

Now switch to your vSphere client and click on refresh by Storage Adapters. Now you will be able to add a iSCSI target.

Jan
25
2011

VCAP4-DCA Certification

This morning I’ve received a pleasant email from VMware.

The subject was: Your VCAP4-DCA Score Report

And I’m excited to say that I passed the VCAP4-DCA exam. I’ve got 382 point of the 500 where 300 point are necessary to pass the exam.

How did I prepare for this exam:

I must say that this was the most difficult test I have ever done in my IT career.  My test exists on doing 34 labs  in 4 hours (not native English speaking) . When I was finishing the last lab (the command was issued but was still running) I ran out of time. The stuff you really have to now for this exam is:

  • vSphere ESX and ESXi (Duh!)
  • Update Manager
  • CLI
  • PowerCLI
  • VMware Management Assisant (vMA)
  • vCenter with all it’s features (Distributed Switches, Host Profiles, Reporing, etc)

But most important is real live experience or a lot of lab time. This is not an exam that you can study with a exam essentials.

So now up to the next level: VCAP-DCD

Jan
6
2011

Enter Maintenance mode: Operation Time out

I’ve got this question a couple of time through email and in my training. Let me explain the error (in my case because there can be multiple causes).

A while ago I giving a VMware course where I had 2 ESX host available. Both host where member of a HA en DRS cluster. When I tried to put one host in maintenance mode I took forever and finally I ended up with the error:

Operation Time out

Looking at the Tasks and Events tab didn’t make me any wiser. I looked like a VM was the problem but this VM migrated successfully. The real cause of the problem was HA. In this configuration HA prevented to put one host in maintenance mode because then HA didn’t have enough hosts available for failover. Temporally disabling HA solved the problem.

Again this is one solution. There can me multiple causes witch prevent putting a host in maintenance mode.

Jan
3
2011

vCLI: Managing iSCSI Storage

As I want to get deeper into VMware CLI (vCLI) I deciced to make a summary of the vSphere Command-Line Interface Installation and Scripting Guide. Every chapter will be a separate blog post.

This summary is meant for my documentation but feel free to make use of it.

In this blog post: Managing iSCSI Storage

Setting up Software iSCSI

  1. Determine the HBA type and retrieve the HBA ID (you will get something back like vmhba32)
    vicfg-iscsi –adapter –list
  2. Enable the Software iSCSI client
    vicfg-iscsi –swiscsi –enable
    You can check the status with
    vicfg-iscsi –swiscsi –list
  3. If you want you can set the iSCSI name (IQN) or alias
    vicfg-iscsi -I -n <iscsi_name> <adapter_name>
    vicfg-iscsi –iscsiname –name <iscsi_name> <adapter_name>
    vicfg-iscsi -I -a <alias_name> <adapter_name>
    vicfg-iscsi –iscsiname –alias <alias_name> <adapter_name>
  4. Add a dynamic discovery address or a static discovery address
    Dynamic: vicfg-iscsi <conn_options> –discovery –add –ip <ip_addr | domain_name> <adapter_name>
    Static: vicfg-iscsi <conn_options> –static –add –ip <ip_addr | domain_name> –name <iscsi_name <adapter_name>
  5. If you want to use CHAP authentication
    vicfg-iscsi –authentication –level <level> –method <auth_method>
    –auth_username <auth_u_name> –auth_password <auth_password>
    [–ip <stor_ip_addr|stor_hostname> [:<portnum>] [-name <iscsi_name]]
    <adapter_name>
  6. If you want to use mutual CHAP run the vicfg-iscsi -A command again with the -b option. Best practice is to use a different username and password.
    For the <level> you can use:

    • chapProhibited to disable host CHAP authentication
    • chapRequired to enable host CHAP authentication
  7. For additional iSCSI paremeters use vicfg-iscsi -W
  8. Rescan the host with vicfg-rescan

Setting up Dependent Hardware iSCSI

  1. Determine the HBA type and retrieve the HBA ID (you will get something back like vmhba32)
    vicfg-iscsi –adapter –list
  2. If you want you can set the iSCSI name (IQN) or alias
    vicfg-iscsi -I -n <iscsi_name> <adapter_name>
    vicfg-iscsi –iscsiname –name <iscsi_name> <adapter_name>
    vicfg-iscsi -I -a <alias_name> <adapter_name>
    vicfg-iscsi –iscsiname –alias <alias_name> <adapter_name>
  3. Set up port binding
    • Identify the VMkernel port of the dependent hardware iSCSI adapter.
      esxcli <conn_options> swiscsi vmknic list -d <vmhba>
    • Connect the dependent hardware iSCSI initiator to the iSCSI VMkernel ports by running the
      following command for each port.
      esxcli <conn_options> swiscsi nic add -n <port_name> -d <vmhba>
    • Verify that the ports were added to the dependent hardware iSCSI initiator.
      esxcli <conn_options> swiscsi nic list -d <vmhba>
    • Rescan the dependent hardware iSCSI initiator.
      vicfg-rescan <conn_options> <vmhba>
  4. The rest of the steps are the same as from step 4 Software iSCSI

Setting up independent Hardware iSCSI

  1. Determine the HBA Type and HBA ID
    vicf-iscsi –adapter –list
  2. Configure the HBA by running vicfg-iscsi -N with one or more of the following options:
    • –list (list network adapters)
    • –ip <ip address> (sets the HBA IPv4 address)
    • –subnetmask <subnetmask> (Sets the HBA subnetmask)
    • –gateway <default gateway> (Set the default gateway)
    • –set ARP=TRUE|FALSE (enable or disable ARP redirect)

    Of course you can use these option in one command line

  3. The rest is the same as from step 3 Software iSCSI

vicfg-iscsi Command syntax

-A –authentication -c <level>
-m <auth_method> -b
-u <ma_username>
-w <ma_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]]
<adapter_name>
–level <level>
–method <auth_method> –mutual
–auth_username <ma_username>
–auth_password <ma_password>
[–ip <stor_ip_addr|stor_hostname> [:<portnum>]
[–name <iscsi_name>]] <adapter_name>
Enables mutual authentication.
You must enable authentication
before you can enable mutual
authentication.
-A –authentication -c <level>
-m <auth_method>
-u <auth_u_name>
-w <a_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]]
<adapter_name>
–level <level>
–method <auth_method>
–auth_username <auth_u_name>
–auth_password <auth_password>
[–ip <stor_ip_addr|stor_hostname> [:<portnum>]
[–name <iscsi_name>]] <adapter_name>
Enables authentication using the
specified options.
-A –authentication -l <adapter_name>
–list <adapter_name>
Lists supported authentication
methods.
-D –discovery -a -i <stor_ip_addr|stor_hostname[:<portnum>] <adapter_name>
–add –ip <stor_ip_addr|stor_hostname> [:<portnum>]
<adapter_name>
Adds a dynamic discovery
address.
-D –discovery -l <adapter_name>
–list <adapter_name>
Lists dynamic discovery
addresses.
-D –discovery -r -i <stor_ip_addr|stor_hostname>[:<portnum>] <adapter_name>
–remove –ip <stor_ip_addr|stor_hostname> [:<portnum>]
<adapter_name>
Removes a dynamic discovery
address.
-H -l [<adapter_name>]
–list [<adapter_name>]
Lists all iSCSI adapters or a
specified adapter.
-L –lun -l <adapter_name>
–list <adapter_name>
Lists LUN information.
-L –lun -l -t <target_ID> <adapter_name>
–list –target_id <target_id> <adapter_name>
Lists LUN information for a
specific target.
-N –network (Independent hardware iSCSI only) -l <adapter_name>
–list <adapter_name>
Lists network properties.
-N –network (Independent hardware iSCSI only) -i <ip_addr> <adapter_name>
–ip <ip_addr> <vmhba>
Sets the HBA IPv4 address to
ip_addr.
-N –network (Independent hardware iSCSI only) -s <subnet_mask> <adapter_name>
–subnetmask <subnet_mask> <adapter_name>
Sets the HBA network mask to
subnet_mask.
-N –network (Independent hardware iSCSI only) -g <default_gateway> <adapter_name>
–gateway <default_gateway> <adapter_name>
Sets the HBA gateway to
default_gateway.
-N –network (Independent hardware iSCSI only) -i <ip_addr> -s <subnet mask>
-g <default_gateway> <adapter_name>
–ip <ip_addr> –subnetmask <subnet_mask>
–gateway <default_gateway> <adapter_name>
Sets the IP address, subnet mask,
and default gateway in one
command.
-p –pnp (Independent hardware iSCSI only) -l <adapter_name>
–list <adapter_name>
Lists physical network portal
options.
-p –pnp (Independent hardware iSCSI only) -M <mtu_size> <adapter_name>
–mtu <mtu-size> <adapter_name>
Sets physical network portal
options.
-I –iscsiname -a <alias_name> <adapter_name>
–alias <alias_name> <adapter_name>
Sets the iSCSI initiator alias.
-I –iscsiname -n <iscsi_name> <adapter_name>
–name <iscsi_name> <adapter_name>
Sets the iSCSI initiator name.
-I –iscsiname -l <adapter_name>
–list <adapter_name>
Lists iSCSI initiator options.
-M –mtu -p -M <mtu_size> <adapter_name>
–pnp –mtu <mtu-size> <adapter_name>
Sets MTU size. Used with the
–pnp option.
-S –static -l <adapter_name>
–list <adapter_name>
Lists static discovery addresses.
-S –static -r -i <stor_ip_addr|stor_hostname> [:<portnum>] -n <target_name>
<adapter_name>
–remove –ip <stor_ip_addr|stor_hostname> [:<portnum>] -name
<target_name> <adapter_name>
Removes a static discovery
address.
-S –static -a -i <stor_ip_addr|stor_hostname> [:<portnum>]
-n <target_name> <adapter_name>
–add –ip <stor_ip_addr|stor_hostname> [:<portnum>]
-name <target_name> <adapter_name>
Adds a static discovery address.
-P –phba -l <adapter_name>
–list <adapter_name>
Lists external, vendor‐specific
properties of an iSCSI adapter.
-T –target -l <adapter_name>
–list <adapter_name>
Lists target information.
-W ‐‐parameter -l [-i <stor_ip_addr|stor_hostname> [:<portnum>]
[-n <iscsi_name]] <adapter_name>
–list [–ip <stor_ip_addr|stor_hostname> [:<portnum>]
[–name <iscsi_name]] <adapter_name>
Lists iSCSI parameter
information.
-W ‐‐parameter -l -k [-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n
<iscsi_name]] <adapter_name>
–list –detail
[–ip <stor_ip_addr|stor_hostname> [:<portnum>]
[–name <iscsi_name]] <adapter_name>
Lists iSCSI parameter details.
-W ‐‐parameter -W -j <name>=<value>
-i <stor_ip_addr|stor_hostname> [:port_num>] [-n <iscsi_name>]]
<adapter_name>
–parameter –set <name>=<value>
–ip <stor_ip_addr|stor_hostname> [:port_num>]
[–name <iscsi_name>]] <adapter_name>
Sets iSCSI parameters.
-W ‐‐parameter -W -o <param_name>
-i <stor_ip_addr|stor_hostname> [:port_num>] [-n <iscsi_name>]]
<adapter_name>
-parameter –reset <param_name>
-ip <stor_ip_addr|stor_hostname> [:port_num>]
[-name <iscsi_name>]] <adapter_name>
Returns parameters in discovery
target or send target to default
inheritance behavior.
-z –reset_auth -a -z
-m <auth_method> -b
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]]
<adapter_name>
–authentication –reset_auth
–method <auth_method>
[–ip <stor_ip_addr|stor_hostname> [:<portnum>]
[–name <iscsi_name>]] <adapter_name>
Resets target level authentication
properties to be inherited from
adapter level. Used with the
–authentication option.