The ability to store and run virtual servers on network storage, such as SAN or NAS, benefits Virtuozzo.
Using such solutions with Virtuozzo reduces planned and unplanned downtime. If hardware fails, storage can be remounted to another physical server which allows you to get virtual servers running in a short period of time.
It also simplifies administrative maintenance and adds flexibility since cables and storage devices are not physically connected to the server and do not require you to move storage from one server to another.
No matter which storage solution is used, the main idea is to link the
/var/parallels folder with the network storage (please note that the
/var/parallels folder is a symbolic link to the
For this reason, Virtuozzo is shipped with packages for creating a Virtuozzo storage.
However, using existing network storage is possible.
Using SAN devices:
There may be different ways to connect storage to the server using the Fibre Channel or iSCSI protocols.
Connecting SAN drive by means of Fibre Channel:
Connecting SAN to the server using Fibre Channel requires a special adapter, which must be installed and configured in accordance with vendor guides. In general, storage is usually mounted in the /dev directory on Virtuozzo, i.e., /dev/sdc. To be able to store virtual servers on that storage, it is necessary to partition and create a file system on the drive using this command:
# mkfs.ext3 /dev/sdc
Then configure the SAN drive to be mounted automatically at boot time by opening the
/etc/fstab file and appending the config directive:
/dev/sdc /var/parallels ext3 0 0
Connecting SAN drive by means of iSCSI:
Install the required package on Parallels Server:
# yum install iscsi-initiator-utils
Configure iSCSI by opening
/etc/iscsi/iscsid.confwith the vi text editor:
# vi /etc/iscsi/iscsid.conf
Set up the username and password:
node.session.auth.username = My_ISCSI_USR_NAME node.session.auth.password = MyPassword discovery.sendtargets.auth.username = My_ISCSI_USR_NAME discovery.sendtargets.auth.password = MyPassword
node.session.*is used to set a CHAP username and password for initiator authentication by the target(s)
discovery.sendtargets.*is used to set a discovery session CHAP username and password for the initiator authentication by the target(s)
For more information about these settings, please refer to this open-iscsi page.
Start the iSCSI service:
# /etc/init.d/iscsi start
Discover the targets:
# iscsiadm -m discovery -t sendtargets -p 192.168.1.2 # /etc/init.d/iscsi restart
(where 192.168.1.2 is the storage server's IP address).
Obtain the new device name:
# fdisk -l
For example, let's say it is
Format and mount the iSCSI volume to the
# mkfs.ext3 /dev/sdc # mount /dev/sdc /var/parallels
Mount the iSCSI drive automatically at boot time:
# chkconfig iscsi on
/etc/fstabfile and append the config directive:
/dev/sdc /var/parallels ext3 _netdev 0 0
Using NAS devices:
/var/parallels/ folder might be placed on either NFS or SMB shares.
To have the SMB share mounted automatically at boot time, it is necessary to edit the
/etc/fstabfile on Parallels Server. You should add the following line to it:
//servername/sharename /var/parallels cifs uid=**local**,credentials=**file**,domain=**domain_name** 0 0
**//servername** is the server name or IP; **sharename** is a shared folder name; **local** is a local user; **domain_name** is a domain name; **file** is the path to the credentials file, which should contain the following entries: username=netid password=password
//server.contoso.local/sharedfolder /var/parallels cifs uid=root,credentials=/etc/cifspw,domain=contoso 0 0
Below are instructions on how to mount an NFS share to the
/var/parallels/directory to be able to store virtual servers on the NFS share:
server:/remote/export /var/parallels nfs-type options 0 0
**server** is the hostname, IP address, or fully qualified domain name of the server exporting the file system; **/remote/export **is the path to the exported directory; **nfs-type** is either the NFS for the NFSv2 or NFSv3 servers, or nfs4 for NFSv4 servers; **options **is a comma-separated list of options for the NFS file system.
192.168.1.2:/remote/share /var/parallels nfs4 0 0
For moving a container's storage to a remote location, please refer to this KB:
Placing /vz partition in external storage (NAS, NFS)