XenServer Tips and Tricks, Minimize the Size of your Exported Virtual Machines
A physical or virtual disk drive is made up of a bunch of blocks. As you save new data on your disk it gets written to these blocks. Brand new blocks are empty but over time as you add and delete files the blocks get filled with data. And in the interest of making file delete operations fast when you delete a file the operating system does not actually clear all the blocks used by the files it just marks the space as free for future use.
Now when XenServer starts exporting the virtual disk it looks and sees data in these unused blocks and in the interest of not tossing anything away on the off chance you need it XenServer exports any blocks with data in them. This can end up making your export files larger than the need to be.
So what you want to do is a process called zeroing out the unused blocks. This will take any space that is no longer used and clear it out. Then when you do your export this data does not have to be exported and you get a smaller file. The process to clear or “zero” out the unused blocks is a little different between Linux and Windows.
NOTE: If you are using VHD backed file systems with XenServer such as NFS storage this has a side effect of maxing out the size of the VHD file on the XenServer box.
Freeing up Windows Blocks
Microsoft has a nifty little utility called SDelete that will run through and find any unused blocks with data and clear them out. You can download SDelete at the link below.
http://technet.microsoft.com/en-us/sysinternals/bb897443.aspx
Once you download the program open up a command prompt and run the command sdelete -c and it will do its magic!
Freeing up Linux Blocks
On Linux you can run a command and get the same result. Open up a shell prompt on your system and then run the following command for each of your file systems:
for example, / or /home
# cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
That's the way to zero out all unused Space on a filesystem, you have to repeat this on every filesystem inside your vm.
댓글 없음:
댓글 쓰기