Reclaim Disk Space from Deleted XenServer Snapshots and Clones

According to Citrix KB article, after deleting all snapshots or clones of a Vm, some disk space still remains allocated. In time this may become an issue, so here is a way to recover that disk space.

Note: The VM will need to be shutdown or suspended (actually, running the following command will suspend the VM anyway):

For Xen Server 5.5 update 1 and later:

coalesce-leaf –u <uuid of VM>

For Xen Server 5.6 and later:

xe host-call-plugin host-uuid=<host-UUID> plugin=coalesce-leaf fn=leaf-coalesce args:vm_uuid=<VM-UUID>

A small script (kudos to http://sysadminnotebook.blogspot.com/2011/07/reclaim-disk-space-from-deleted.html) to automate the process if you need:

#!/bin/bash

MASTER=$(xe pool-list params=master | egrep -o “[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}”)

RUNNING_VMS=$(xe vm-list is-control-domain=false power-state=running params=uuid | egrep -o “[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}”)

for VM in $RUNNING_VMS; do

xe host-call-plugin host-uuid=$MASTER plugin=coalesce-leaf fn=leaf-coalesce args:vm_uuid=$VM

done


#!/bin/bash
MASTER=$(xe pool-list params=master | egrep -o “[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}”)
RUNNING_VMS=$(xe vm-list is-control-domain=false power-state=running params=uuid | egrep -o “[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}”)
for VM in $RUNNING_VMS; do
xe host-call-plugin host-uuid=$MASTER plugin=coalesce-leaf fn=leaf-coalesce args:vm_uuid=$VM
done
~

Linux – simulate high CPU load

March 7, 2011   •   No Comments

Here is a quick command to create some CPU load (courtesy to http://it.toolbox.com/blogs/david/simulate-load-on-your-linux-server-using-a-oneliner-26150):

dd if=/dev/zero bs=100M | gzip | gzip -d | gzip | gzip -d | gzip | gzip -d > /dev/null &

Vmware ESXi 4 and Virtuozzo

The situation:

Because of the non paged memory pool limit of 256MB on the Windows 32 bit systems, I wasn’t able to use Virtuozzo for Windows on dedicated systems with more than 8GB. This translated into a large volume of work related to build and deploy the dedicated systems. In addition, around 2GB of memory was never being use which is a waste.

Qmail queue tool – QmHandle

I was desperately trying to download this tool a few days ago from the project page which is hosted at Sourceforge now and it continuously failed.

So, here is a local link for the qmhandle tool.

Resize a Citrix XenServer Linux domU LVM disk

Long story short – we need to increase the disk space on a Linux VM in Citrix XenServer. Here is how it can be done in general steps – for technical people that know Linux pretty well. If the following steps don’t ring a bell to you, DO NOT proceed. Check on Google as there are plenty of howtos with screenshots and more details. In either case, it’s indicated to have a backup. Better safe then sorry…

Parallels downloads links

Parallels fails badly at providing easy access to its free downloads by asking the user to “register” every time when it tries to get those downloads. This is really annoying, especially when you’re in a hurry installing Plesk or Virtuozzo. However, the downloads are still free so here are the direct links:

Reading NonPagedMemoryPool through SNMP

This post is related to running Virtuozzo Windows 2003 32 bit systems. One important parameter on 32 bit version of Windows 2003 (and probably other versions of Windows, but not relevant in this post) is the so called Non Paged Memory Pool.

Copy LV device between 2 servers

Let’s assume the following scenario. You have a server running some services and using LVM. Let’s also assume that you just deployed a second server which will use the same data existing in one LV device on the first server. Assuming again that both servers are connected in the same network (that’s not mandatory, but if the LV device is big, it will take forever to copy the data), we can use “nc” and “dd” utilities to dump an LV content through a network tunnel.

Choosing a dedicated server

First of all, this article refers to the hardware aspect of the dedicated server and not to the operating systems or software installed on it.

It may sound like a trivial task – “What could be so complicated to chose a dedicated server? Just go online, search for some good feedbacks of a few hosting companies, then chose whichever fits your needs.” The reality is a bit different and is related to the competition in this market.

Sending emails from a hosted domain

So we have a domain, is being hosted on a server to some hosting  provider
and we want to  send some emails.  It may sound a  simple task, but  these
days, with  so many  protections against  spam, we  can easily  found  our
messages being delivered directly in other people’s junk folders. However,
there are few  things that  can drastically  improve the  chances for  the
message to hit the right spot – the recipient inbox folder. Here they are.
First, be sure that the IP address of your server has a proper reverse DNS
record. Most of the providers will allow you to add your own rDNS  record.
If noti, you’ll have to ask their technical support to do it for you.
For example, if your domain is domain.com and your IP address is
123.234.123.234, be sure that the IP address will resolve to some hostname
from your domain. It could be just the domain name. Most of the time
you’ll see something like mail.domain.com.
[root@server ~]# host -t mx domain.com
domain.com mail is handled by 10 mail.domain.com.
[root@server ~]# host mail.domain.com
mail.domain.com has address 123.234.123.234
[root@server ~]# host 123.234.123.234
234.123.234.123.in-addr.arpa domain name pointer mail.domain.com.
Second, give a  name from  your domain to  your email  server. Some  email
servers default installations use the generic name “localhost.localdomain”
and this is a very  bad idea when it  comes about sending emails.  Sending
messages with this identity will determine your messages to be rejected by
most of the receiving email servers. Please note that not all the time the
system name will be  the email server name  (for example Qmail with  Plesk
control panel).
You can simply check if your server is properly configured from this point
of view by following the few steps described [6]here.
Third, add a proper SPF record to your domain name zone file. A good  page
about this can be found [7]here. The information from this page will  help
you to define your SPF record in no time.

So we have a domain, is being hosted on a server to a hosting  provider and we want to  send some emails.  It may sound a  simple task, but these days, with  so many  protections against  spam, we  can easily  found  our messages being delivered directly in other people’s junk folders. However, there are few  things that  can drastically  improve the  chances for  the message to hit the right spot – the recipient inbox folder. Here they are.

Login