Archive for April, 2012
The question of whether to defragment virtual guests popped up on the VMware Communities forums again, and I remember debating this with a colleague a few months ago. If you do a Google search, you’ll find differing opinions (usually ones that are pro-defrag tend to be older documents), so whether to do it can be confusing. I wanted to clarify why virtual machines should not be defragmented courtesy of the sources listed below:
- Thin Provisioning: Performing a defrag will cause significant growth to your thin provisioned disk. Imagine an administrator that performs defrags using a tool on a scheduled basis. The growth has the potential to be catastrophic to your datastores. Your thin provisioned datastore at 75% is now completely full.
- Changed Block Tracking: Most backup utilities, such as Veeam Backup & Replication, use CBT in order to minimize the amount of data that needs to be backed up. A defrag will lead to lots of changed blocks by design, and will cause your backups to sky-rocket in size.
- Snapshots: Defragmentation will also lead to any VMs that have snapshots to grow in size. Of course, snapshots are not backup and they should be cleared out regularly, but this is still a negative.
- Linked Clones: If utilizing Linked Clones, for example in your VMware View VDI environment, you’re again going to run into the linked clone disks growing unnecessarily. It would be better to defragment the parent disk that your replicas are based on instead of each desktop created from them.
- Unnecessary Disk I/O: Defragmentation is going to cause a lot of disk I/O on your SAN. Theoretically, you could try to carefully time your defrag cycle for off-hours to avoid this.
- No Observable Benefit: VMware’s own internal tests show no noticeable improvements after defragging virtual machines on SAN/NAS devices.
- Storage Auto-tiering/SAN Block Handling: With a large amount of vendors now utilizing SAN-based auto-tiering (Equallogic, Compellent, Nimble, etc.), the hotspots on your VM have likely been moved to a higher tier. After a defragmentation, auto-tiering will have to relearn, which depending on the vendor can take awhile. Moreover, the defragmentation tool is unaware of how the SAN is handling the disk layout, and defragmenting a volume on a storage pool is not recommended regardless of whether it is in VMware or not.
- Solid-State Drives: SSD drives are becoming increasingly common. There is no reason to defragment when using this type of storage as there is no disk head movement involved.
- Some Vendors Specifically Advise Against it: NetApp states, “VMs stored on NetApp storage arrays should not use disk defragmentation utilities because the WAFL file system is designed to optimally place and access data at a level below the guest operating system (GOS) file system. If a software vendor advises you to run disk defragmentation utilities inside of a VM, contact the NetApp Global Support Center before initiating this activity.“
I am very honored to be selected as a VMware vExpert this year. This is a great program to encourage contributions within the community, and I’m thankful to be selected. Congratulations to all others that made it: Full vExpert List.
The VMware vExpert Award is given to individuals who have significantly contributed to the community of VMware users over the past year. vExperts are book authors, bloggers, VMUG leaders, tool builders, and other IT professionals who share their knowledge and passion with others. These vExperts have gone above and beyond their day jobs to share their technical expertise and communicate the value of VMware and virtualization to their colleagues and community.
I recently ran into a case of a missing button after trying to enable 2-step verification for GMail. I figured that had to do with using a Google Apps domain account instead of a regular GMail account, so I did some poking around under Domain Management. You can find the setting to enable it under Advanced Tools -> Authentication -> Allow Users to turn on 2-step authentication:
Now you should see the option under Account Overview:
The setup process is painless, and since enabling the process it hasn’t been as obtrusive as I anticipated. Most people are using 2-factor authentication for games (such as Starcraft, WoW, and SW:TOR), and it certainly makes just as much sense to apply this to e-mail as well.
There is a great post over on thelowercasew.com by Matt Liebowitz, which discusses Microsoft’s stance on virtual machine snapshots in respect to MSSQL and Exchange. The gist being that Microsoft will not support snapshots, and consequently virtual machines restored using this policy.
Some hypervisors include features for taking snapshots of virtual machines. Virtual machine snapshots capture the state of a virtual machine while it’s running. This feature enables you to take multiple snapshots of a virtual machine and then revert the virtual machine to any of the previous states by applying a snapshot to the virtual machine. However, virtual machine snapshots aren’t application aware, and using them can have unintended and unexpected consequences for a server application that maintains state data, such as Exchange. As a result, making virtual machine snapshots of an Exchange guest virtual machine isn’t supported.
Virtualization Snapshots for Hyper-V or for any virtualization vendor are not supported to use with SQL Server in a virtual machine. It is possible that you may not encounter any problems when using snapshots and SQL Server, but Microsoft will not provide technical support to SQL Server customers for a virtual machine that was restored from a snapshot.
As mentioned in the article, most popular virtualization backup tools (Veeam, PHD, BackupExec w/ VMware Agent) all use snapshots for their backup process. Why would Microsoft not support this if it is so popular? As mentioned by Microsoft, plain snapshots (e.g. snapshots taken from the vSphere client) are not application-aware. That’s a problem for applications like SQL and Exchange. Fortunately, backup vendors have added application-awareness into their products. Also, another issue that you may run into is related to the stunning of the VM when deleting a snapshot.
In addition to the above, it’s worth noting that a fairly large number of more novice users treat regular snapshots as backups. VMware’s Snapshot Best Practices (KB 1025279) reiterates that plain snapshots are not backups.
I can certainly see where Microsoft is coming from, and I doubt they will give you trouble if you restore a VM from a backup using one of the popular tools, despite the disclaimer. I predict most instances in which you would call Microsoft support, you would already have restored the VM and you’ve now encountered an issue inside the application. If you have a problem with the restore itself, you’re likely going to head to your backup vendor for support. Microsoft engineers are going to have a hard time telling exactly how you got to the point you’re at unless you explicitly tell them, so it might be worth keeping that close to your chest if possible. Of course, Microsoft support could always try to play hard ball, so it’s certainly worth keeping the fact they’ve stated they won’t support snapshots in mind.
With SQL servers, I have always chosen to back up SQL traditionally in conjunction with our virtualization-based backups, as well. I imagine most others follow the same practice.