Search

Language:  
Search for:

Available article translations:

How to deploy Parallels Plesk Panel 11 on KVM or Xen systems

APPLIES TO:
  • Parallels Plesk Panel 11.x for Linux

Release Notes

To simplify Parallels Plesk Panel (PP) 11 provisioning for cloud infrastructure providers (including service providers offering dedicated servers, VPS, or IaaS), Parallels introduces PP VM images for KVM and Xen systems.

Download

The images based on CentOS 6.2 and Ubuntu 12.04, both 64-bit, are shipped as an archive including deployment scripts, which is available here.

Software Requirements

Hypervisor services KVM or Xen.

Command line tools:

virt-install
virt-clone
qemu-img
virsh

(Usually, they are included in the virtinst package or in the python-virtinst; libvirt; virt-manager; qemu-kvm, or kvm-qemu-img package.)

Deployment Scripts

To create servers using our images, download and unpack the archive. The archive contains the following:

- Two shell scripts:
plesk_clone_kvm.sh
plesk_clone_xen.sh


- Disk image in qcow2 format:
clone.qcow2

- xml config for KVM:
clone.cfg
 
The scripts are designed for different hypervisors, but they have the same set of commands:
# ./plesk_clone_kvm.sh

USAGE:
plesk_clone_kvm.sh <COMMAND> [OPTIONS]

plesk_clone_kvm.sh install <VM name> <image path> [MAC address]
plesk_clone_kvm.sh mount <VM disk file>
plesk_clone_kvm.sh umount
plesk_clone_kvm.sh installkey <VM disk file> <SSH key file>
plesk_clone_kvm.sh installpasswd <VM disk file> <plain text password>

COMMANDS:
install Install the new virtual machine from Parallels image.
mount Mount the virtual disk of existing environment.
umount Unmount the virtual disk of existing environment.
installkey Install SSH key into existing environment.
installpasswd Set root password into existing envrionment.

# ./plesk_clone_xen.sh

USAGE:
plesk_clone_xen.sh <COMMAND> [OPTIONS]

plesk_clone_xen.sh install <VM name> <image path> [MAC address]
plesk_clone_xen.sh mount <Virtual disk file>
plesk_clone_xen.sh umount
plesk_clone_xen.sh installkey <Virtual disk file> <SSH key file>
plesk_clone_xen.sh installpasswd <Virtual disk file> <plain text password>

COMMANDS:
install Install the new virtual machine from Parallels image.
mount Mount the virtual disk of existing environment.
umount Unmount the virtual disk of existing environment.
installkey Install SSH key into existing environment.
installpasswd Set root password into existing envrionment.

Steps to Deploy

1. Create a KVM virtual server with Parallels Plesk Panel (PP):
# ./plesk_clone_kvm.sh install plesk.centos.vm3 /var/lib/libvirt/images/
Trying to install new VM with disk image /var/lib/libvirt/images//plesk.centos.vm3.qcow2 ...
Cloning clone.qcow2 | 30 GB 00:00

Clone 'plesk.centos.vm3' created successfully.

1.1 Create a virtual server with the specified MAC address:
# ./plesk_clone_kvm.sh install plesk.centos.vm1 /var/lib/libvirt/images 00:11:22:33:44:55

Note: Make sure the first octet in your MAC address is EVEN (e.g., 00:) as MAC addresses with ODD first-bytes (e.g., 01:) are reserved for multicast communication and can cause problems. (See https://help.ubuntu.com/community/KVM/Networking.)

The rest of the operations are performed to the disk of the virtual machine. To avoid possible problems with the file system, do not use it for disks of a started virtual server.

2. Generate and install the public key:
# ssh-keygen -t rsa -b 4096 -f id_example
# ./plesk_clone_kvm.sh installkey /var/lib/libvirt/images/plesk.centos.vm3.qcow2 id_example.pub
Trying to install SSH key for root user... done

3. Create the root password:
# ./plesk_clone_kvm.sh installpasswd /var/lib/libvirt/images/plesk.centos.vm3.qcow2 PASSWORD
Trying to set root password... done

4. (Optional) Mount the disk of the virtual server to the mnt/ directory:
# ./plesk_clone_kvm.sh mount /var/lib/libvirt/images/plesk.centos.vm3.qcow2
Trying to mount virtual disk into /root/plesk_kvm/mnt... done

5. (Optional) Unmount the disk of the virtual server:
# ./plesk_clone_kvm.sh umount
Trying to unmount virtual disk from /mnt... done
Trying to disconnect device ... done

6. Start the virtual server:
# virsh start plesk.centos.vm3
Domain plesk.centos.vm3 started

7. Get the PP admin's password (you should know the IP address*):
# ssh -x root@192.168.122.8 "/usr/local/psa/bin/admin --show-password"
root@192.168.122.8's password:
KOheKBCMgTJ_g8r8
# ssh -i id_example -x root@192.168.122.9 "/usr/local/psa/bin/admin --show-password"
9giO_bUIa1nAETqF


PP post-installation steps should be performed according to the PP Installation/Upgrade/Migration Guide. (Note: You should change the server hostname because the default hostname in our images is "localhost.localdomain.")
 
* You cannot get the IP address assigned to a virtual machine by means of KVM/XEN; therefore, you should have access to lease the files of the DHCP server. For example, for a local DHCP server that serves the virtual network interfaces operating in the Usermode Networking (NAT):
# grep 00:11:22:33:44:55 /var/lib/libvirt/dnsmasq/default.leases | awk '{print $3}'
192.168.122.8

** For configuration of a virtual server with a static IP address, mount the disk of the virtual server and insert the needed network configuration file:
# ./plesk_clone_kvm.sh mount /var/lib/libvirt/images/plesk.centos.vm1.qcow2
Trying to mount virtual disk into /root/plesk_kvm/mnt... done
# cat centos-ifcfg-eth0 > mnt/etc/sysconfig/network-scripts/ifcfg-eth0
# ./plesk_clone_kvm.sh umount
Trying to unmount virtual disk from /mnt... done
Trying to disconnect device ... done

Where centos-ifcfg-eth0:
DEVICE="eth0"
BOOTPROTO="static"
BROADCAST="10.50.255.255"
DNS1="10.50.1.1"
GATEWAY="10.50.1.1"
IPADDR="10.50.2.16"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
NETMASK="255.255.0.0"
NM_CONTROLLED="yes"
ONBOOT="yes"
NAME="System eth0"

Additional Information

The disk size of our images is 30 GB. If you want to change it for an existing virtual server, you can use the following steps:
 
Create a backup of the disk:
# cp /var/lib/libvirt/images/centos.mu.bridged /var/lib/libvirt/images/centos.mu.bridged.back

Change the disk size:
# qemu-img resize /var/lib/libvirt/images/centos.mu.bridged +10GB
Image resized.

Convert the image to "raw" format:
# qemu-img convert -O raw /var/lib/libvirt/images/centos.mu.bridged /var/lib/libvirt/images/centos.mu.bridged.raw

Recreate the third partition of the virtual disk via the "fdisk" utility; it will remove the partition and create a new partition that starts from the same sector as the removed partition:
# fdisk /var/lib/libvirt/images/centos.mu.bridged.raw

Command (m for help): p

Disk /var/lib/libvirt/images/centos.mu.bridged.raw: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders, total 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006d850

Device Boot Start End Blocks Id System
/var/lib/libvirt/images/centos.mu.bridged.raw1 * 2048 411647 204800 83 Linux
/var/lib/libvirt/images/centos.mu.bridged.raw2 411648 4605951 2097152 82 Linux swap / Solaris
/var/lib/libvirt/images/centos.mu.bridged.raw3 4605952 62914559 29154304 83 Linux

Command (m for help): d
Partition number (1-4): 3

Command (m for help): p

Disk /var/lib/libvirt/images/centos.mu.bridged.raw: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders, total 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006d850

Device Boot Start End Blocks Id System
/var/lib/libvirt/images/centos.mu.bridged.raw1 * 2048 411647 204800 83 Linux
/var/lib/libvirt/images/centos.mu.bridged.raw2 411648 4605951 2097152 82 Linux swap / Solaris

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4, default 3): 3
First sector (4605952-83886079, default 4605952):
Using default value 4605952
Last sector, +sectors or +size{K,M,G} (4605952-83886079, default 83886079):
Using default value 83886079

Command (m for help): p

Disk /var/lib/libvirt/images/centos.mu.bridged.raw: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders, total 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006d850

Device Boot Start End Blocks Id System
/var/lib/libvirt/images/centos.mu.bridged.raw1 * 2048 411647 204800 83 Linux
/var/lib/libvirt/images/centos.mu.bridged.raw2 411648 4605951 2097152 82 Linux swap / Solaris
/var/lib/libvirt/images/centos.mu.bridged.raw3 4605952 83886079 39640064 83 Linux

Command (m for help): w
The partition table has been altered!

Syncing disks.

After recreating the partition, convert the "raw" file to "qcow2" format again:
# qemu-img convert -O qcow2 /var/lib/libvirt/images/centos.mu.bridged.raw /var/lib/libvirt/images/centos.mu.bridged

After changing the size of the disk and starting the guest OS, run this command:
# resize2fs /dev/vda3

Remove the backup of the disk if all steps have been completed successfully.
 
If you need to change the disk size for the image, use the same commands for the file of the virtual server cloned from our image. Additionally, after the last command, resize2fs /dev/vda3, in the guest OS, run the following commands:
# /usr/local/psa/bin/ipmanage --auto-remap-ip-addresses true
# /usr/local/psa/bin/cloning --update -prepare-public-image true -reset-license true
# > /etc/udev/rules.d/70-persistent-net.rules
# poweroff

After that, replace the "clone.qcow2" file with the file of the created virtual server.



c7658ac2f68d6572a213687c1077afff 56797cefb1efc9130f7c48a7d1db0f0c 49af2da0f2dd4c81e962790bbbd0c2b4 5d735c0e028ee5b991e4fb80d34fb87f

FEEDBACK
Was this article helpful?
Tell us how we may improve it.
Yes No
 
 
 
 
 
 
Desktop Virtualization
- Parallels Desktop 8 for Mac
- Parallels Transporter
- Parallels Desktop Switch to Mac Edition
- Parallels Desktop for Mac Enterprise Edition
- Parallels Management-Mac for Microsoft SCCM
Server Virtualization
- Parallels Cloud Server
- Parallels Containers for Windows 6.0 Beta
- Parallels Virtuozzo Containers
Automation
- Parallels Automation
- Parallels Automation for Cloud Infrastructure
- Parallels Business Automation Standard
- Parallels Virtual Automation
- Parallels Plesk Panel Suite
- Web Presence Builder
- Parallels Plesk Automation
- Parallels Small Business Panel
- Value-added Services for Hosters
- Parallels Partner Storefront
Services & Resources
- Cloud Acceleration Services
- Professional Services
- Support Services
- Training & Certification