Tuesday, April 8, 2014

The 4 Most Common Misconfigurations with NetApp Deduplication

Misconfiguration #1 - Not turning on dedupe right away (or forgetting the -s or scan option)

As Dr. Dedupe pointed out in a recent blog, NetApp recommends dedupication on all VMware workloads. You may have noticed that if you use our Virtual Storage Console (VSC) plugin for vCenter that creation of a VMware datastore using the plugin results in dedupe being turned on. We recommend enabling dedupe right away for a number of reasons but here is the primary reason why;

Enabling dedupe on a NetApp volume (ASIS) starts the controller tracking the new blocks that are written to that volume. Then during the scheduled deduplication pass the controller looks at those new blocks and eliminates any duplicates. What if, however, you already had some VMs in the volume before you enabled deduplication? Unless you told the NetApp specifically to scan the existing data, those VMs are never examined or deduped! This results in the low dedupe results. The good news, this is a very easy fix. Simply start a deduplication pass from the VSC with the “scan” option enabled or from the command line with the “-s” switch.

dedupmgmt1.pngAbove, where to enable a deduplication volume scan in VSC. Below, how to do one in Systems Manager;


dedupmgmt2.png
For you command line guys its "sis start -s /vol/myvol" note the -s, amazing what 2 characters can do!


This is by far is the most common mistake I come across but thanks to more customers provisioning their VMware storage with the free VSC plug-in it is becoming less common.


Misconfiguration #2 - LUN reservations

Thin Provisioning has gotten a bad reputation in the last few years. Storage admins who have been burned by thin provisioning in the past tend to get a bit reservation happy. On a NetApp controller we have multiple levels of reservations depending on your needs but with regard to VMware two stand out. First there is the volume reservation. This reserves space away from the large storage pool (the Aggregate) and insures whatever object you place into that volume has space. Inside the volume we now create the LUN for VMware. Again you can choose to reserve the space for the LUN which removes the space away from the available space in the volume. There are two problems with this. First, there is no need to do this. You have already reserved the space with the volume reservation, no need to reserve the space AGAIN with a LUN reservation. Second, the LUN reservation means that the unused space in the LUN will aways consume the space reserved. That is, a 600GB LUN with space reservation turned on will consume 600 GB of space with no data in it. Deduping a space reserved LUN will yeild you some space from the used data but any unused space will remain reserved.


For example say I had a 90GB LUN in a 100GB volume and the LUN was reserved. With no data in the LUN the volume will show 90GB used, the unused but reserved LUN. Now I place 37 GB of data in the LUN. The volume will still show 90GB used. No change. Next I dedupe that 37 GB and say it dedupes to 10GB. The volume will no report 63 GB used since I reclaimed 27GB from deduping. However when I remove the LUN reservation I can see the data is actually taking up only 10GB with the volume now reporting 90GB free. [I updated this section from my orginal post, Thanks to Svetlana for pointing out my error here]

In these occasions, a simple deselection of the LUN reservation reveals the actual savings from dedupe (yes this can be done live with the VMs running). Once the actual dedupe savings are displayed (likely back in that 60-70% range) we can adjust the size of the volume to suit the size of the actual data in the LUN (yes, this too can be done live)


dedupmgmt3.png

Misconfiguration #3 - Misaligned VMs

The problem with some guest operating systems being misaligned with the underlying storage architecture has been well documented. In some cases though this misalignment can cause lower than expect deduplication numbers. Clients are often surprised (I know I was) at how many blocks we can dedupe between unlike operating systems. That is, between say Windows 2003 and 2008 or Windows XP and 2003. However if the starting offset of one of the OS types is different that the starting offset of the other then almost none of the blocks will align.

In addition to lowing your dedupe savings and using more disk space that required, misalignment can also place more load on your storage controller (any storage controller, not a NetApp specific problem). Thus it is a great idea to fix this situation. There are a number of tools on the market that can correct this situation including the MBRalign tool which is free for NetApp customers and included as part of the VSC. As you align the misaligned VMs, you will see your dedupe savings rise and your controller load decrease. Goodness!


Misconfiguration #4 - Large amounts of data in the VMs

Now this one isn’t really a misconfiguration, it's more of a design option. You see, most of my customers do not separate their data from their boot VMDK files. The simplicity  of having your entire VMs in a single folder is just too good to mess with. Customers are normally still able to achieve very high deduplication ratios even with the application data mixed in with the OS data blocks. Sometimes though customers have very large data files such as large database files, large image file repositories or large message datastores mixed in with the VM. These large data files tend not to deduplicate well and as such drive down the percentage seen. No harm is done though since the NetApp will deduplicate the all the OS and other data around these large sections. However the customer can also move these VMDKs off to other datastores which can then expose the higher dedupe ratios on the remaining application and OS data. Either option is fine.

So there it is, the 4 most common misconfigurations I see with deduplication on NetApp in the field. Please feel free to post and share your savings, we always love to hear from our customers directly.

Monday, March 3, 2014

Expanding the size of a Raw Device Mapping (RDM) attached to a VM


Warning: Ensure that there are no snapshots on the disk before attempting this operation. If there are snapshots present, commit them. Otherwise, you may experience data corruption (as described in Extending a RDM with snapshots may cause corruption (1005351). For more information, see Determining if there are leftover delta files that VMware Infrastructure Client cannot detect (1005049).

Note: Snapshots can only be taken with RDMs in Virtual Compatibility Mode. If you do not want to use snapshots, the maximum mapped LUN size in Physical Compatibility mode is 2 TB - 512 bytes in ESX/ESXi 4.x and 64TB in ESX/ESXi 5.x. For more information, see ESX/ESXi 3.x/4.x do not support 2-terabyte LUNs-125339 (3371739) and Calculating the overhead required by snapshot files (1012384).

The procedure to expand the size of the RDM depends on the type:
  • Physical compatibility mode

    Physical compatibility mode RDMs, which are also known as passthru RDMs, expose the physical properties of the mapped LUN to the guest operating system. For the guest operating system to recognize the added space to the expanded mapped LUN, perform a rescan from the ESX host, then from the guest operating system. This process does not require rebooting the virtual machine or the ESX host.

    No changes to the RDM files (.vmdk or metadata pointer) are required to take advantage of the added disk space.

  • Virtual compatibility mode

    To safely expand the RDM:
    1. Stop the virtual machine and remove the RDM from the virtual machine. Before you do this, note the scsiX:Y position of the RDM in VM Settings.
    2. Expand the RDM LUN from the SAN side. Contact your vendor for assistance.
    3. Perform rescan on the ESX and verify the new LUN size is observed.
    4. Recreate the RDM mapping to update the mapped disk size using one of these methods:
      • Utilize Storage vMotion to migrate the Virtual RDM disk's pointer file (vSphere 4.0 and later).
      • Power off the virtual machine, click VM Settings > Add > Hard Disk > RDM, select the scsiX:Y position that the RDM was using before, and then power on the virtual machine.
    5. Perform a rescan from the guest operating system. Consult your vendor for assistance. 

Wednesday, January 29, 2014

Event Viewer being flooded with VMWare Tools [Warnings]vmstat

If you have this setting "isolation.tools.setinfo.disable = "true" this means that Setinfo communication from tools to the ESXi host are being blocked" .


Modify the following line from the .vmx and set the value to "false"

isolation.tools.setinfo.disable = "true"
 
Note :  take backup of vmx file before editing.
 




Refer this Link for more detail about this parameter  page 6  http://www.vmware.com/files/pdf/vi35_security_hardening_wp.pdf

Thursday, December 12, 2013

VMware CPU Resource Pool Guide

When looking at the 'New Resource Pool' window in vCenter, you are presented with a few misleading options, Shares and Reservations. VMware has taken it upon themselves to work in three pre-configured settings you can choose from, Low, Normal and High. Once you begin to understand the ideology behind an RP and the inner workings of resource contention, then you will understand how pointless and dangerous those pre-configured 'RP Shares' settings can be.
Below is an example diagram that I have created to demonstrate a misconfigured RP environment.
misconfigured-resource-pools
I have found in my workings with resource pools that taking the approach of a balanced sharing system is key. Today I want to share with you the basic concept I use when implementing resource pools. Using simple math equations, you are able to create a balanced system that allocates shares evenly throughout all of your child pools. This equation is simple to understand.

The first thing to implement is a priority scale (High, Medium, Low, etc.) and assign a value to each priority (this will be used in the equation). I like to keep things on the 1:2:4 scale and use multiples of a thousand to keep my math simple. For this example, I will be using the following priorities:

High – 4000
Normal – 2000
Low – 1000

Now that our priorities are set, we need to begin building the resource pool structure. This structure will consist of three parent resource pools with child resource pools broken down by the number of vCPU's that each VM contains within that RP. Here is the breakdown for the Resource Pool infrastructure:

RP-High
RP-High-vCPU1
RP-High-vCPU2

RP-Normal
RP-Normal-vCPU1
RP-Normal-vCPU2

RP-Low
RP-Low-vCPU1
RP-Low-vCPU2

Understanding that virtual machines with multiple virtual CPU's are going to require more resources from the hypervisor, it is important to calculate the shares accordingly. Basically, within the parent resource pool, you will want to separate your VM's with 1 vCPU and place them in their appropriate child pool, and do the same with each VM that have 2 vCPU's (in a large environment, there will be many child pools, considering the amount of vCPU's you are allowed to give a VM is much higher that 2). This method allows you to give a higher number of shares to VM's in a resource pool that contains VM's with multiple vCPU's while maintaining the balance to the peer 'Parent Pools' (High, Normal and Low).

Now that the resource pools have been created and each virtual machine has been placed inside its appropriate child pool, it's time do the calculations.

To calculate the Shares, you must start from the bottom and work your way up. The equation is based off the number of virtual machines within the pool, the value assigned to your priority, and the number of virtual CPU’s that each machine maintains within the pool. Once all of the child resource pools have been calculated and assigned a share value, each child's share count is added together to give you the total number of shares to assign the parent pool. Here is the equation:

[#VM in pool × Priority Value] × vCPU count = Share Count

So, using this basic equation, let's calculate the 'High' resource pool and all of its child pools. The VM breakdown is as follows:

RP-High = 68 total virtual machines
RP-High-vCPU1 = 47 virtual machines
RP-High-vCPU2 = 21 virtual machines

Using our equation and understanding that (RP-High-vCPU1 Shares + RP-High-vCPU2 Shares = RP-High Total Shares), the math is:

RP-High-vCPU1 = [47 × 4000] × 1 = 188000 Total Shares
RP-High-vCPU2 = [21 × 4000] × 2 = 168000 Total Shares

Notice that even though vCPU1 RP has more shares, if you divide the number of shares by the number of VM's in the resource pool, you will notice that the share value per VM is lower than the share value per VM in the vCPU2 RP (8000 shares per VM in vCPU2 and 4000 shares per VM in vCPU1). Now we add these two values together to give us our parent resource pool count:

RP-High = 356000 total shares
RP-High-vCPU1 = 188000 total shares
RP-High-vCPU2 = 168000 total shares

This same equation would be applied to every resource pool/child resource pool in your environment to give you a balanced share value throughout your entire infrastructure. Once implemented, it will be your responsibility to update the equations as new VM's are introduced in to your environment to ensure you keep the values balanced.

Thursday, December 5, 2013

Installing VMware View Agent or View Composer fails with the error: The system must be rebooted before installation can continue (1029288)


    Symptoms:
  • You cannot install VMware View Composer/Agent.
  • Installing VMware View Composer/Agent fails.
  • You see this error:

    The system must be rebooted before installation can continue
     
  • Restarting the machine does not resolve this issue.
Possible cause?
This issue may occur if there are pending operations from previous installations.




 

Here's what I did to resolve my particular issue when trying to upgrade the View Composer from version 3.0 to 5.3 on the vCenter Server.
  1. Reboot the guest operating system to clear the pending operations.
  2. If the issue persists, try removing VMware Tools and re-installing it, then proceed to the next step if this does not resolve the issue.
  3. Click Start > Run, type regedit, and click OK.
  4. Look for these registry keys:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\FileRenameOperations


  5. If there is a string in either of these keys, delete the string.
  6. Re-install VMware View Agent again.
Note: If this does not resolve the issue, you may need to delete any strings in these keys as well:
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce\
  • OnceEx\
    After deleting the strings, reboot the virtual machine and attempt to install the View Agent.

Wednesday, November 13, 2013

Remove Snapshot: unable to access file unspecified filename since it is locked


Error message "Unable to access file since it is locked appears in the Recent tasks panel.




Since the filename is unspecified, it makes it hard to figure out what the issue is.
Why did it happen? Well, first I have to tell you that something went wrong in a backup process of one of my VMs, specifically the Virtual Center Server (in my case, this is a VM). It could be ANY VM, but in this case is this one. The last time, the same issue happened with a different VM, but anyway, the problem is the same.





I figured out that the job failed, and It couldn't remove the snapshot. (VDR appliance creates a snapshot, and then copies the contents to the destination; after that, the snapshot is removed). But something went wrong, and the snapshot was not removed. It caused all future jobs also failed. I tried manually creating a snapshot for the failed VM, and then remove it, to force it to "Delete All" the unused snapshots, but the procedure failed, giving me the same error: "unable to access file since it is locked" ... mmmm, who is locking and which file ?????
I tried also moving the VM to another ESX in the cluster; restarted vmware management services; restarted the VM; restarted the ESX host itself, but no luck.
 
1) Shutdown the VDR appliance. It will free up the locked files in your VMs that were not sucessfuly backed up.

2) Manually create a snapshot in every VM with the problem, then "Delete all" snapshots, you won't get that error message again.

3) "Try" to power on the VDR (VMware Data Recovery) appliance... Oh, no, the same message again! And now, I cannot power up the Virtual Machine !

4) I found the VDR "mounts" the hard disks of the VMs it is creating the backups, so, go to the VDR, and in commands "Edit settings".

By default, the VDR has only one hard disk, but mine shows three: those two extra hard disks corresponds to the Virtual Machine the backup failed on!

Look at the hard disk description path for the first hard disk drive, and disk mode independent checkbox is not checked.



Look at the extra hard disks added to the VDR, see the hard disk description path (it corresponds to the VM that was in the process of being backed up). It also has the independent checkbox checked.





Select one by one on each of the extra hard disks and click "Remove". Be very careful here, selecting just remove, and DO NOT dele files from disk.





Also, confirm that you selected the right hard disks ! If you make a mistake, just hit Cancel and do it again.

5) Verify that you have the single and right hard disk in place.



6) Power on the (VMware Data Recovery) appliance. Problem solved !

Wednesday, October 23, 2013

Migrating a virtual machine in vSphere 5.x fails with the error: "The operation is not allowed in the current connection state of the host (2046356) "

Symptoms
  • Cannot migrate a virtual machine in a vSphere 5.x environment.
  • Migrating a virtual machine fails with the error:

    Relocate virtual machine
    The operation is not allowed in the current connection state of the host
    Time: xx/xx/xxxx xx:xx:xx
    Target: xxxxx
    vCenter Server: xxxxx
  • The Summary tab of the powered on virtual machine reports this information:
    • CPU Usage - 0 MHz
    • Memory Usage - 0.00 MB

Resolution

To resolve this issue, perform these steps, verifying if the issue is resolved after each step:
  1. Restart the VMware VirtualCenter Server Service. (This actually solved my problem as simple as it sounds)
  2. Restart the Management agents on the ESX host running the virtual machine. For more information, see Restarting the Management agents on an ESXi or ESX host (1003490).
  3. Disconnect and reconnect the ESX host that is running the virtual machine to force vCenter Server to retrieve an updated set of data relating to the objects registered to the host.
Note: If the problem persists even after performing the steps in this article, file a support request with VMware Support and note this KB article ID (2046356) in the problem description.