Previous page

Next page

Locate page in Contents

Print this page

Copying a Virtual Machine and Container Within the Server

Parallels Server Bare Metal allows you to create a complete copy of a particular virtual machine and Container (in respect of all the virtual machine and Container data and resources parameters), or a clone . This saves your time because you do not have to think of setting up the virtual machine and Container configuration parameters and the like. Moreover, you can create a number of virtual machine and Container clones at a sitting.

In Parallels Server Bare Metal-based systems, you can use the following commands to copy a virtual machine and Container within the given physical server:

  • vzmlocal to clone a Container. For example, you can create Container 111 and make it be a complete copy of Container 101 by running this command:

    # vzmlocal -C 101:111

    Moving/copying Container#101 -> Container#111, [], [] ...

    ...

    Successfully completed

    You can clone both running and stopped Containers.

  • pctl clone to clone a virtual machine. For example, you can create a clone of the MyVM virtual machine and assign the Cloned_VM name to it as follows:

    # pctl clone MyVM --name ClonedVM

    Clone the MyVM VM to the VM ClonedVM...

    The VM has been successfully cloned.

    You can create clones of stopped virtual machines only.

Checking the Cloned Virtual Machine and Container

To check that your virtual machine and Container has been successfully moved, run this command:

# pctl list -a

STATUS IP_ADDR NAME

stopped 10.0.10.101 101

stopped 10.0.10.101 111

stopped 10.0.10.115 MyVM

stopped 10.0.10.115 ClonedVM

As you can see from the example above, the clones of Container 101 (Container 111) and the MyVM virtual machine ( ClonedVM ) have been successfully created. However, before starting to use the clones, you should assign different IP addresses to them which are currently identical to those of Container 101 and MyVM . Refer to Performing Initial Configuration to learn how you can do it.

Note : If you are cloning a running Container, the created clone is stopped to prevent an IP address conflict.

Configuring the Default Directories

When cloning a virtual machine and Container, you can also override the following default directories:

  • /vz/ dest_VM_Name .pvm storing the files of a cloned virtual machine (where dest_VM_Name denotes the name of the resulting virtual machine). For example, for the ClonedVM virtual machine, this directory is /vz/ClonedVM.pvm . To store the files of the ClonedVM virtual machine in a custom directory, you can run the following command:

    # pctl clone MyVM --name ClonedVM --location /vz/VM_directory

    In this case all virtual machine files will be placed to the /vz/VM_directory directory. Notice that the specified directory must exist on the server; otherwise, the command will fail.

  • /vz/private/< dest_CTID > and /vz/root/<dest_CTID> defining the Container private area and root paths, respectively (where < dest_CTID > denotes the ID of the resulting Container). In the case of Container 111, these paths are /vz/private/111 and /vz/root/111 . To define custom private area and root paths for Container 111, you can execute the following command:

    # vzmlocal -C 101:111:/vz/private/dir_111/:/vz/root/ct111

    Moving/copying Container#101 -> Container#111, [], [] ...

    Syncing private area '/vz/private/101'->'/vz/private/dir_111'

    ...

    Successfully completed

    # ls /vz/private

    1 101 dir_111

    # ls /vz/root

    1 101 ct111