(Advanced) Cloning Plesk in Virtual Environment

Why Do I Need Plesk Cloning?

The popular and efficient way to start offering Plesk services is to install Plesk in a cloud and then seamlessly scale your infrastructure and install more Plesk instances as your business grows. The challenge in this approach is that it is not possible just to copy the same Plesk again and again to different virtual machines because of the following:

  • Some clouds constantly change allocated IP addresses pools. If a Plesk service was bound to an IP address which was later removed from the system, the service will not be operable.
  • Each new Plesk should have unique entities, for example, an SSL certificate, and if you simply keep copying Plesk, all the instances will share the same certificate.

The Plesk cloning technology solves these and other scaling problems.

What Is Plesk Cloning?

Plesk cloning is the technology of copying the same Plesk instance to different virtual machines without compromising Plesk operability. Two prevailing usage scenarios of the cloning are:

  • Fast Plesk setup. If you wish to create virtual machines (Amazon Web Services, KVM, Xen, and so on) with Plesk on demand, the easiest way to streamline this process is to create an image of a virtual machine with specifically prepared Plesk and then create machines from this preset as many times as needed.
  • Full backup. Cloning is a recovery solution too because almost all Plesk data remain in cloned instances. Thus, you can first copy a prepared Plesk to another virtual machine and then start the machine if your original machine becomes inoperable.

The application scope of Plesk cloning is wider: For example, you can clone Plesk and then safely test new features or configurations on it, but in this section, we will consider only the given scenarios because others are their extensions or combinations.

Cloning and Plesk Licensing

Before you start cloning Plesk, please contact our sales representatives and provide the range of IP addresses within which your Plesk instances will be installed. Our licensing system will activate Plesk servers from this range only.

Preparing a Plesk Instance for Cloning

If you want to use Plesk cloning, start with preparing your Plesk instance for cloning. The following preparatory steps help you reset all environment- and initialization-specific settings (like the IP addresses pool) to prevent copying of unique information to other virtual machines. Omit steps 2 and 3 if your scenario is full backup.

  1. (Fast setup, full backup) Instruct Plesk to reconfigure its IP pool after restart. After running the following command, a Plesk instance will discover actual IP addresses and reconfigure its IP pool each time you restart the corresponding virtual machine.

    On Linux:

    # /usr/local/psa/bin/ipmanage --auto-remap-ip-addresses true

    On Windows:

    %plesk_cli%\ipmanage --auto-remap-ip-addresses true

    Note: This step is not mandatory if a virtual machine to which you want to copy Plesk uses a static IP address. Moreover, omitting this option will make Plesk start faster because Plesk will not reconfigure its IP pool on each startup. However, we highly recommend to complete this step if you deploy Plesk to a cloud.

  2. (Fast setup only, optional) Initialize the instance programmatically or from the Plesk GUI. Specify the administrator's information, locale, and other initialization settings using the init_conf command-line utility or the Plesk GUI. Read more about the initialization in After Installing Plesk.
  3. (Fast setup only) Prepare Plesk for cloning by resetting some of its data (for example, the administrator's password, see the full list below). For this purpose use the option -prepare-public-image with the true value. Note that this step does not perform cloning, it only modifies Plesk settings.

    On Linux:

    # /usr/local/psa/bin/cloning --update -prepare-public-image true

    On Windows:

    %plesk_cli%\cloning --update -prepare-public-image true

License reset (optional)

During cloning operation you can ask Plesk to remove the license key on the next start. For this purpose use the option -reset-license with the true value.

On Linux:

# /usr/local/psa/bin/cloning --update -prepare-public-image true -reset-license true

On Windows:

%plesk_cli%\cloning --update -prepare-public-image true -reset-license true

Preserving the source configuration (optional)

By default, the cloning command resets the customized configuration of the source Plesk instance to default: you may need to additionally configure cloned instances. To preserve the configuration of the source Plesk instance in new instances, use the option -reset-init-conf with the false value. By default, this option is used with the true value and resets the Plesk configuration to default.

To preserve a custom Plesk configuration in images of your Plesk server, use the cloning command with the following options:

On Linux:

# /usr/local/psa/bin/cloning --update -prepare-public-image true -reset-init-conf false

On Windows:

%plesk_cli%\cloning --update -prepare-public-image true -reset-init-conf false

Disabling updates after cloning (optional)

After the cloned instance is started, updates for current version are checked explicitly and installed if necessary. Installation of updates is working under the same rules as in daily maintenance task. Updates installation can be disabled if option -skip-update true is passed while cloning.

To disable updates in images of your Plesk server, use the cloning command with the following options:

On Linux:

# /usr/local/psa/bin/cloning --update -prepare-public-image true -skip-update true

On Windows:

%plesk_cli%\cloning --update -prepare-public-image true -skip-update true

Note: When preparing a Plesk instance for cloning, avoid restarting the psa service and shutting down the virtual machine on which the instance is installed.

How to Clone Plesk on Linux

We assume that you have a virtual machine with Plesk and you wish to clone this machine. The cloning procedure consists of three steps:

  1. Prepare the Plesk instance for cloning using the instructions we provided earlier.
  2. Stop (shut down) the virtual machine.
  3. Create a virtual machine image (snapshot) by means of virtual machines management software you use. Refer to the software vendors' documentation for respective instructions.

Once you have the virtual machine image, you can use it as a preset for new virtual machines or as a Plesk snapshot.

How to Clone Plesk on Windows

We assume that you have a virtual machine with Plesk and you wish to clone this machine. The cloning procedure consists of three steps:

  1. Prepare the Plesk instance for cloning using the instructions we provided earlier.
  2. If your software for managing virtual machines supports creating copies of virtual machines, which is normally true, stop (shut down) the virtual machine and create the image copy. Otherwise, if images copying is unavailable, you should use a special shutdown call that resets some instance data and then copy the machine by available means. The shutdown is performed by the following command from the command prompt (Cmd.exe):

    sysprep /oobe /generalize /shutdown

Once you have the virtual machine image, use it as a preset for new virtual machines or as a Plesk snapshot.

What Data Are Reset by the cloning Utility?

The following list contains the data items that are reset by the cloning utility:

  • Remapping of IP addresses
  • Reset GUIDs for clients, domains, service plans, subscriptions, and other database entities
  • Reset initial configuration information
  • Create Panel certificate
  • Delete SSL certificates (only the default certificate, cloning does not change user-defined certificates)
  • Regenerate backup signature
  • Clean up sessions
  • Reset administrator's password and other passwords. (All passwords are decrypted, new symmetric key generated, and passwords encrypted again with new key).
  • Reset last check for update time
  • (Optionally) Reset License key

The rest of the data remain intact.

 

Leave your comments on this page

Leave your feedback or question on this documentation topic below. For technical assistance, contact your hosting service provider or submit a request to Plesk support. Suggest new features for Plesk here. Discuss general questions on the Plesk forum. All offtopic comments will be removed.