{{:user:servarica.png?direct|}} {{ :user:xenica.png?direct|}}
sudo fallocate -l 1G /mnt/1GB.swap
sudo mkswap /mnt/1GB.swap
chmod 600 /mnt/1GB.swap
{{ :user:14createswap.png?direct |}}
----
Step 13: Add this line to the end of /etc/fstab to make the change permanent.
/mnt/1GB.swap swap swap sw 0 0
{{ :user:15fstab.png?direct |}}
----
Step 14:
How aggressively the server will use this swap space can be controlled by modifying the system’s swappiness value.
To change the swappiness value edit /etc/sysctl.conf and add the following line.
vm.swappiness=60
{{ :user:16swappiness.png?direct |}}
----
Step 15: Enable the swap file and Check that the swap file was created using below commands
sudo swapon /1GB.swap
sudo swapon -s
{{ :user:17swapon.png?direct |}}
----
Step 16: Using the command "free -h" we can check the allotted swap space as shown below
----
{{ :user:181gbswap.png?direct |}}
----
Step 17: Next we are going to Install Xentools in the VM, for the Xenica functions to work.
* Mount the disk containing Xentools and Install It as shown below.
''Note: Please make sure that you are installing latest version of xentools''
{{ :user:0xentools.png?direct |}}
----
Step 18:
From the Xenica package download the script file (xenicastart.sh) and place it inside /etc as shown below
----
{{ :user:19xenicastart.png |}}
----
Step 19:Assign the executable mode to the file by the command
chmod +x /etc/xenicastart.sh
----
Step 20: Run the below command
source /etc/xenicastart.sh
After running the file. It should print the message at the end :
''Could not read Ip Address from the xenstore. It seems IP Address is not written to xenstore.''
----
{{ :user:21couldnotread-confirm.png |}}
----
Step 21: To make the script run at the start of the VM:
a) Open the file /etc/rc.local in edit mode
b) put the below lines inside /etc/rc.local
/etc/xenicastart.sh
/etc/xenicastart.sh
----
{{ :user:22rclocalnew.png |}}
----
Step 22: Assign the executable mode to the file by the command
chmod +x /etc/rc.local
----
{{ :user:23chmodrclocal.png?direct |}}
----
Step 23: Run this script as /etc/rc.local on the command line
It should print the same message as in step 20.
''Could not read Ip Address from the xenstore. It seems IP Address is not written to xenstore.''
{{ :user:24rclocalrun-new.png |}}
----
Step 24: Shutdown the VM and Convert it to template
{{:user:25converttemplate.png?direct|}}
----
xenstore-chmod /local/domain rw