{"id":44,"date":"2011-09-11T22:15:39","date_gmt":"2011-09-11T21:15:39","guid":{"rendered":"http:\/\/virtualizedworlduk.wordpress.com\/?p=44"},"modified":"2011-09-11T22:15:39","modified_gmt":"2011-09-11T21:15:39","slug":"virtual-machine-disk-alignment-2","status":"publish","type":"post","link":"https:\/\/www.virtualworlduk.co.uk\/wordp\/virtual-machine-disk-alignment-2\/","title":{"rendered":"Virtual Machine Disk Alignment"},"content":{"rendered":"<p>Some of this information is taken from the excellent work that Ricky El-Qasem (<a title=\"Virtualize Planet\" href=\"http:\/\/read.virtualizeplanet.com\/\">http:\/\/read.virtualizeplanet.com\/<\/a>) has done.<\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>I have gone through and tested this procedure on a few machines with good results but please note that I do not take any responsibility for any damage that occurs to a virtual machine through performing these tasks.\u00a0 My advice is to always take a backup of the virtual machine before beginning any tasks like this.<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>Within the virtualized environment, especially when using Windows Server 2003 or Windows XP as the guest operating system, the performance of a virtual machine can be affected by how the disks are aligned.\u00a0 Here is a brief explanation of what Disk Alignment means within VMware:<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>In a SAN environment, the smallest hardware unit used by a SAN storage array to build a LUN out of multiple physical disks is a called a chunk or a stripe. To optimize I\/O, chunks are usually much larger than sectors. Thus a SCSI I\/O request that intends to read a sector in reality reads one chunk.<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>On top of this, in a Windows environment NTFS is formatted in blocks ranging from 1MB to 8MB. The file system used by the guest operating system optimizes I\/O by grouping sectors into so-called clusters (allocation units).<\/div>\n<div><strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>Figure 1 shows that an unaligned structure may cause many additional I\/O operations when only one cluster is ready by the guest operating system.<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div><a href=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/vmdk-no-align.gif\"><strong><\/strong><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-47\" title=\"vmdk-no-align\" src=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/vmdk-no-align.gif\" alt=\"\" width=\"562\" height=\"271\" \/><\/a><a href=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/vmdk-aligned.gif\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-50\" title=\"vmdk-aligned\" src=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/vmdk-aligned.gif\" alt=\"\" width=\"562\" height=\"315\" \/><\/a><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>The best course of action is therefore to align the NTFS volumes in line with the VMFS volumes to reduce the number of read operations required to read information.\u00a0 The chunks used within VMware are 64K chunks.\u00a0 Windows 2008 and Windows 7 already align themselves to 64K chunks but Windows Server 2003 and Windows XP align themselves usually to around 32K chunks and therefore the following technique can be used to align these operating systems to 64K chunks instead.<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>As an example, before writing this document, I performed a test with a Windows Server 2003 server which was not aligned to 64K chunks.\u00a0 The test involved powering up the virtual machine from being powered off and timing it to the point the \u2018CTRL+ALT+DEL\u2019 screen appeared.\u00a0 The virtual machine was then cloned, the modifications to the server were performed and then the test was repeated again.\u00a0 The result was as follows:<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>Server A\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8211;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Boot Time Before:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 58.27 seconds<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>Server A\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8211;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Boot Time After:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 35.34 seconds<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>As you can see there was a saving of approximately 23 seconds just during the boot process and therefore I\u2019m sure that you can imagine the performance improvement that could be seen in normal operation.<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong><br \/>\n<strong><\/strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>Please note that this method may not work correctly on some machines and therefore a full backup should be performed on the virtual machine before attempting to perform this work.<\/div>\n<p>Please note that you will need to download the gparted iso to perform this work, this is available from the following location:<br \/>\n<a title=\"GParted\" href=\"http:\/\/gparted.sourceforge.net\/\" target=\"_blank\" rel=\"noopener\">http:\/\/gparted.sourceforge.net\/<strong><\/strong><\/a><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<p>&nbsp;<\/p>\n<div><strong>Stage 1 \u2013 Reboot Virtual Machine into gparted iso.<\/strong><\/div>\n<p>The first stage of the alignment method is to power down the virtual machine.\u00a0 You should then connect up the gparted-live-0.9.0-7.iso which you should have downloaded previously.\u00a0 You should then power up the virtual machine again.<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>Select the GParted Live (Default Settings) option.<br \/>\n<a href=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted1.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-57\" title=\"gparted1\" src=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted1.jpg\" alt=\"\" width=\"302\" height=\"226\" \/><\/a><\/div>\n<p>Keep the selected option \u2018Don\u2019t touch keymap\u2019 and click OK.<br \/>\n<a href=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-60\" title=\"gparted2\" src=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted2.jpg\" alt=\"\" width=\"358\" height=\"200\" \/><\/a><\/p>\n<p>Type in \u201802\u2019 to select \u2018British English\u2019 and then press enter.<br \/>\n<a href=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-61\" title=\"gparted3\" src=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted3.jpg\" alt=\"\" width=\"365\" height=\"203\" \/><\/a><\/p>\n<p>Next type in \u20180\u2019 and then press Enter.<br \/>\n<a href=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted4.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-62\" title=\"gparted4\" src=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted4.jpg\" alt=\"\" width=\"365\" height=\"203\" \/><\/a><\/p>\n<p>Gparted will now finish loading up.<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div><strong><strong>Stage 2 \u2013 Checking the current alignment of the disks<strong><\/strong><\/strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>In the GParted program, right mouse click on the disk and then click information:<br \/>\n<a href=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted5.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-64\" title=\"gparted5\" src=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted5.jpg\" alt=\"\" width=\"355\" height=\"241\" \/><\/a><\/div>\n<\/div>\n<p>As you can see from this screen, the first sector is not a multiple of 64.\u00a0 This one is 63 and therefore it is not aligned.\u00a0 Change the disk at the top of the program and perform the same task again.<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div><strong>Stage 3 \u2013 Align Disks<\/strong><\/div>\n<p>Select the first disk and highlight the partition by clicking on it.<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>Click the \u2018Resize\/Move\u2019 button.<\/div>\n<p><a href=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted61.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-65 alignleft\" title=\"gparted6\" src=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted61.jpg\" alt=\"\" width=\"51\" height=\"31\" \/><\/a><strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>You can now see the amount of space that is assigned to the disk.\u00a0 To align the disk correctly, the \u2018Free space preceding\u2019 should be set to \u20188\u2019 Mib.<br \/>\n<a href=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted71.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-66\" title=\"gparted7\" src=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted71.jpg\" alt=\"\" width=\"355\" height=\"182\" \/><\/a><\/div>\n<p>Click the \u2018Resize\/Move\u2019 button once the figures have been inserted.<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>Repeat the process for the additional disks that are unaligned.<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>Please note that the tasks will not be performed until you click the \u2018Apply\u2019 button.\u00a0 <a href=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted8.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-67\" title=\"gparted8\" src=\"http:\/\/virtualworlduk.co.uk\/wp-content\/uploads\/2011\/09\/gparted8.jpg\" alt=\"\" width=\"32\" height=\"42\" \/><\/a><strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>The resizing and moving operations may take some time to complete, depending on the amount of data on the disk.<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div><strong><strong>Stage 4 \u2013 Check the alignment of the disks<strong><\/strong><\/strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>Once the operations have been completed but before rebooting the server, check the alignment of the disks following the method in Stage 2.<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>The first sector should now read a value that can be divided by 64 and produce a whole number.\u00a0 If it does not, then the operation has not been performed correctly.<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div><strong><strong>Stage 5 \u2013 Confirm the operation of the server<strong><\/strong><\/strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>The final stage is now to shut down the server, unmount the gparted iso file and then power up the virtual machine from its own disks.<strong><\/strong><\/p>\n<div><strong>\u00a0 <\/strong><\/div>\n<div>Confirm that the virtual machine boots correctly and that the applications function as expected.\u00a0 You should notice that the boot time of the server is reduced.<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Some of this information is taken from the excellent work that Ricky El-Qasem (http:\/\/read.virtualizeplanet.com\/) has done. \u00a0 I have gone through and tested this procedure on a few machines with good results but please note that I do not take any responsibility for any damage that occurs to a virtual machine through performing these tasks.\u00a0 My advice is to always [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[9],"tags":[],"class_list":["post-44","post","type-post","status-publish","format-standard","hentry","category-vmware"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.virtualworlduk.co.uk\/wordp\/wp-json\/wp\/v2\/posts\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtualworlduk.co.uk\/wordp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtualworlduk.co.uk\/wordp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtualworlduk.co.uk\/wordp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtualworlduk.co.uk\/wordp\/wp-json\/wp\/v2\/comments?post=44"}],"version-history":[{"count":0,"href":"https:\/\/www.virtualworlduk.co.uk\/wordp\/wp-json\/wp\/v2\/posts\/44\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.virtualworlduk.co.uk\/wordp\/wp-json\/wp\/v2\/media?parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtualworlduk.co.uk\/wordp\/wp-json\/wp\/v2\/categories?post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtualworlduk.co.uk\/wordp\/wp-json\/wp\/v2\/tags?post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}