Archive

Archive for the ‘OpenVZ’ Category

/vz partition errors or when /vz goes read-only

September 2nd, 2010 Behzad No comments

Note : Be Careful while using these steps.

A few times now we have seen problems on the Linux virtuozzo servers where the /vz partition errors out and the kernel forces it to go into a read-only state. The solution is to manually run a filesystem check (FSCK) with the -fy arguments on the /vz partition. It is possible on a vz server to do this without a support ticket, however you must be careful with a few steps.

1. Stop the vz service (service vz stop)

2. Disable the vz service from restarting on boot (chkconfig –level 2345 vz off)

3. Comment out the /vz partition inside the /etc/fstab file to prevent the /vz partition being automaticlyt checked on boot.

4. Reboot the server

5. Once the server reboots and you can SSH back in you can begin the filesystem check.

6. Determine which physical partition is /vz/ You can do this with the command (fdisk -l /dev/sda). This will show you all the partitions.

Usually the /vz partition is the last one listed and will have the larges amount of blocks with a “ID” of 83 and “System” label of Linux:

EXAMPLE
# fdisk -l /dev/sda

Disk /dev/sda: 299.9 GB, 299978719232 bytes
255 heads, 63 sectors/track, 36470 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1305 10482381 83 Linux
/dev/sda2 1306 2610 10482412+ 83 Linux
/dev/sda3 2611 3915 10482412+ 83 Linux
/dev/sda4 3916 36470 261498037+ 5 Extended
/dev/sda5 3916 4437 4192933+ 82 Linux swap
/dev/sda6 4438 4568 1052226 83 Linux
/dev/sda7 4569 36470 256252783+ 83 Linux

In the above example you can see that /dev/sda7 have the most blocks and has the “ID” of 83 and “System” label of Linux:.

Therefore we would issue the command (fsck -fy /dev/sda7).

7. Once the file system check is complete you can uncomment the /vz parition in /etc/fstab

8. re-enable the vz service to start on boot (chkconfig –level 2345 vz on)

9. start up the vz service (service vz start)

All should then be well. You can monitor the logfile /var/log/vzctl.log as VE’s are brought online.

If you are uncomfortable doing any of this then please contact a senior tech or management and we can help out. Please remember it is very dangerous to FSCK a mounted partition to always ensure the target partition os unmounted before beginning. Generally you cannot umout a /vz partition after stopping the VZ service so I recommend the reboot with /vz partition disabled and the vz service disabled.

Categories: Linux | CentOS, OpenVZ Tags:

SolusVM, as HyperVM replacement

February 22nd, 2010 Behzad 1 comment

Few months after HyperVM developer found dead, It was so sad, and I think HyperVM has a long road to go, specially when I saw the source of hypervm published, I looked at it and though, it is not a code which you can rely on.

Hypervm was programmed in plain inline code without any code design pattern in behind. But to be honest, it performed a great role to change vps businesses around the world.

So I though, we have to move to a new vps management system, and finally picked SolusVM. Have to say it was a great choice, and in last two months, it did good job, these guys are promising.

Solus Virtual Manager (SolusVM) is a powerful GUI based VPS management system with full OpenVZ and Xen support with KVM to be released shortly. SolusVM allows you and your clients to manage a VPS cluster with security & ease.

Categories: HyperVM, OpenVZ, SolusVM Tags: , ,

Connected to FTP but listing files/folders fails on VPS with firewall

August 6th, 2008 Behzad No comments

If you connect to FTP and can not list files/folders and you are using csf / config server firewall, It is probably becuase your vps does have support ip_nat_ftp module, and even it maybe becuase ip_nat_ftp not loaded into hardware node kernel. (if you have access to HN and restarted HN, it may not load automatically into kernel).

Just do

# modprobe ip_nat_ftp

then restart vps (or all vps’s with command service vz restart)

You’re done ;)

HyperVM openvz migration

July 23rd, 2008 Behzad No comments

You may faced situation when you hang to do a simple job. Yes, there are most of times, simple answers to resolve issues, but not mentioned anywhere. One of those is when you want to migrate a vps from one node to another with hypervm. You are lucky if you do this without getting any error, and if so, why do you reached this post? ;)

After 6 hours of hammering my head, I got it to work and I post this here to help you and others.

Before starting migration, you MUST do steps below if you want to success:

1. Make sure partition of /usr/local/lxlabs/hypervm/serverfile/tmp on source HN have enough space to dump vps into, or just remove it and create a symlink to another folder/partiotion which have enough space.

2. Make sure /tmp partition on destination HN have enough space, if not you can mount –bind it to another folder in another partition. (only if /tmp is partition, if not just create symlinks) for more info see: http://www.ibm.com/developerworks/library/l-fs3.html

3. Disable firewalls on both HN, so they do not block each other packets (simply disable/enable firewalls, openning ports does not give you the results always.)

4. Ssh to dest HN, from source HN, and make sure you can login without prompt of password. (Using public keys)

5. Now run

cd /usr/local/lxlabs/hypervm/httpdocs;

/usr/local/lxlabs/ext/php/php ../bin/common/switchserver.php ––priority=low ––class=vps ––name=VPS_NAME.vm ––v-syncserver=DEST_HN_IP

(change VPS_NAME and DEST_HN_IP with proper values)
6. check logs with command tail -f /usr/local/lxlabs/hypervm/log/shell_exec on both servers, and find any errors.

Take a cup of coffe and relax, I hope :)

After migration, you must change IP of new vps throught hypervm and cPanel/Plesk/DirectAdmin…

mount point swap does not exist

December 7th, 2007 Behzad No comments

Did you face situation where server goes up with mount points not mounted?

Well, you can mount points according to /etc/fstab:

# cat /etc/fstab

# This file is edited by fstab-sync – see ‘man fstab-sync’ for details
LABEL=/1 / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=/vz1 /vz ext3 defaults,noatime 1 2
LABEL=SWAP-sda2 swap swap defaults 0 0
LABEL=SWAP-sda3 swap swap defaults 0 0
LABEL=SWAP-sda5 swap swap defaults 0 0
LABEL=SWAP-sda6 swap swap defaults 0 0
/dev/sdb1 /vz2 ext3 defaults,noatime 1 2
/dev/sdb2 /backups ext3 defaults,noatime 0 0

Your fstab config certainly differ from my own. This config is for a Virtuozzo server.

You can do mount /vz ; mount /vz2 … to mount these partitions but what if swap not mounted?

So first, do a fdisk -l to see linux partiotion table:

# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 522 4192933+ 83 Linux
/dev/sda2 523 783 2096482+ 82 Linux swap
/dev/sda3 784 1044 2096482+ 82 Linux swap
/dev/sda4 1045 121601 968374102+ 5 Extended
/dev/sda5 1045 1305 2096451 82 Linux swap
/dev/sda6 1306 1566 2096451 82 Linux swap
/dev/sda7 1567 121601 964181106 83 Linux

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 30395 244147806 83 Linux
/dev/sdb2 30396 60790 244147837+ 83 Linux

We have 4 swap partitions. You can not mount a swap partition using the mount command. To enable swap without rebooting: (repeat for all swap partitions)

# swapon /dev/sda2

Now check swap with:

# free -m

total used free shared buffers cached
Mem: 7953 7902 50 0 168 3454
-/+ buffers/cache: 4279 3673
Swap: 8189 75 8113

Thats it ;)