2.6. Setting Up Clients¶
The process of setting up a client includes three stages:
Preparing to mount the Virtuozzo Storage cluster to the client.
Mounting the cluster.
Configuring virtual machines and containers to be stored in the cluster.
2.6.1. Stage 1: Preparing to Mount the Cluster¶
To prepare for mounting the Virtuozzo Storage cluster to the client:
Log in to the server you want to act as a client as root or as a user with root privileges.
Download and install the
vstorage-clientRPM packages. These packages are available in the Virtuozzo remote repository (this repository is automatically configured for your system when you install Virtuozzo) and can be installed with this command:
# yum install vstorage-client
Create the directory to mount the Virtuozzo Storage cluster to, for example:
# mkdir -p /vstorage/stor1
Make sure that cluster discovery is configured in your network. For details, see Configuring Cluster Discovery.
Authenticate the server in the cluster. This step is required only if the server where you are setting up the client has never been authenticated in the cluster before. For example, you can skip this step if this is the same server where you set up the first MDS server or some of the chunk servers. Otherwise, run the following command to authenticate the server in the cluster:
# vstorage -c stor1 auth-node Please enter password for cluster:
During its execution, the command asks you for the password to validate the server. Type the password you specified when setting up the first MDS server and press Enter.
vstoragethen compares the provided password with the one stored on the MDS server, and if the passwords match, successfully authenticates the server.
2.6.2. Stage 2: Mounting the Cluster¶
Next, you need to mount the cluster to make it accessible to the client. You can do this with the the
vstorage-mount command. For example, if your Virtuozzo Storage cluster has the name of
stor1, you can run this command to mount it to the
/vstorage/stor1 directory on the client:
# vstorage-mount -c stor1 /vstorage/stor1
You can also configure the client to automatically mount the cluster to the
/vstorage/stor1 directory when the client boots. To do this, add a line like the following to the
vstorage://stor1 /vstorage/stor1 fuse.vstorage rw,nosuid,nodev 0 0
If the cluster is not used for virtualization, you can mount it with the
--fail-on-nospace option. In this case an
ERR_NO_SPACE error will be returned if the cluster runs out of free space.
2.6.3. Stage 3: Configuring Virtual Machines and Containers¶
To configure a server with Virtuozzo to store its virtual machines and containers in the cluster, do the following:
Log in to the server as
Configure containers for use in the cluster:
Check the path to the container private area in the
/etc/vz/vz.conffile. By default, the path is set to the following:
Make a symbolic link from the container private area to the directory in the Virtuozzo Storage cluster that will store containers. Assuming that this directory is
/vstorage/stor1/private, create this directory and run the following command:
# ln -s /vstorage/stor1/private/ /vz/private
/vz/privatedirectory already exists on your server, remove it before running the
Configure virtual machines for use in the cluster:
Check the default location of virtual machine files:
# prlsrvctl info | grep "VM home" VM home: /vz/vmprivate
Make a symbolic link from the default location to the directory in the Virtuozzo Storage cluster that will store virtual machines. For example, to make a link to the
/vstorage/stor1/vmprivatedirectory, create this directory and execute the following command:
# ln -s /vstorage/stor1/vmprivate/ /vz/vmprivate
/vz/vmprivatedirectory already exists on your server, remove it before running the