Home » Virtualization

Weekly backups of all OpenVZ container

Here’s is a simple shell script to run a weekly lvm snapshot dump of all OpenVZ containers using the vzdump utility:   #!/bin/bash # ve_dumps.sh # Dump all VEs# Todays’ date DATE=$(date +%d) # Paths BAK_PATH=/opt/bak/vz_dumps # Week of month BAK_DIR=$(cal | awk -v date=”${DATE}” ‘{ for( i=1; i <= NF ; i++ ) if [...]

How to clone an OpenVZ virtual machine

I need sometimes to clone a vps in an openvz environment, so here you can find three methods to do this task: first option: # vzctl stop 101 Stopping VE … VE was stopped VE is unmounted # cp -r /vz/private/101 /vz/private/202 # cp /etc/vz/conf/101.conf /etc/vz/conf/202.conf # vzctl start 202 Starting VE … Initializing quota [...]

Back Up LVM XEN Guest Containing LVs

In my day-job all our Linux boxes (bar 3) are Xen VMs. I wanted a way to take a backup of these with out the risk of the files changing underneath. For performance reasons I am running all of them on Logical Volumes. Within these VMs the DomU OS is once again using LVM for [...]

additional RAM on Xen VPS

If you wish to add additional RAM on a Xen based VPS, you need to follow the below steps: #Search the VM name: xm list #Edit the VM’s configuration file. Update the required value and save the file: vi /home/xen/vmname/vmname.cfg #To stop and start the VPS, follow the below steps: xm destroy vmname xm create [...]

Create users in OpenVZ Containers

Helper script to create users on all OpenVZ VEs simultaneously:   #!/bin/bash # create_ve_users.sh # Usage: ./create_ve_users.sh <username> <password> <uid> <group1,group2> USERNAME=$1 PASSWORD=$2 USERID=$3 GROUP=$4 EXPECTED_ARGS=4 OUT_FILE=.create_users_$$ if [ $# -ne $EXPECTED_ARGS ] then echo “Usage: `basename $0` <username> <password> <uid> <group1,group2>” exit 65 fi VE_LIST=$(/usr/sbin/vzlist -H -o veid) for VE in ${VE_LIST} do vzctl [...]

Update OpenVZ containers

If you manage several OpenVZ containers, here is a simple bash script to keep the OpenVZ containers upto date. #!/bin/bash # vzyum_updates.sh # updates VEs VE_LIST=$(/usr/sbin/vzlist -H -o veid | grep -v Warning) for VE in ${VE_LIST} do /usr/bin/vzyum $VE update done exit 0

Xen on Debian Etch

I’ve been testing out a few virtualization systems and am sofar very pleased with Xen. Installing on Debian Etch couldn’t be easier and it worked straight out the box – I had my first virtual server running in under 15 minutes flat! Use the following commands to install Xen on a Debian Etch machine: apt-get [...]

Howto: Re-create/re-install a VPS

How to re-create/re-install a OpenVZ VPS? 1) Make a backup of the configuration file: cp -p /etc/sysconfig/vz-scripts/VEID.conf  /etc/sysconfig/vz-scripts/VEID.conf_old 2) Stop the VPS: vzctl stop VEID 3) Destroy/Terminate the VPS: vzctl destroy VEID 4) Create the VPS using the OS templates stored under /vz/template/cache directory: vzctl recreate VEID –ostemplate os-template-name 5) Copy the original configuration file [...]

VMWare ESX4 and ESX3.5: SCSI timeout For Linux Guest

Recently, I noticed that the timeout values differ on CentOS v5.x and RHEL Linux 5.x guests on VMWare ESX4 and ESX3.5. I’ve notices that older ESX 3.5 set a 60 secs timeout and ESX4.x set to 180 secs. Luckly you can fix it easily: Edit /etc/udev/rules.d/99-vmware-scsi-udev.rules, # vi /etc/udev/rules.d/99-vmware-scsi-udev.rules Sample config: RUN+=”/bin/sh -c ‘echo 180 [...]

PPP in container

Our goal is to start the pppd daemon in a virtual machine. Then it is possible, for example, to connect to your DSL provider in a VM. Caveat This feature is experimental. It currently requires a version of vzctl patched with this patch. It is also necessary to run one of these 2 kernels : 2.6.27 [...]

Enter your email address:

Liên Kết Website

web design | Shared linux windows problems | Dedicated server | website chất lượng cao | hosting chất lượng cao | Tutorial video collection | Troubleshooting Tips and Tutorial