Previous page

Next page

Locate page in Contents

Print this page

Creating Container Instances

Note: Before creating an instance, you may want to list available images with yum groupinfo ez-catalog.

As an example, we shall create a Wordpress container instance named wordpress-ct.

  1. Search for the Wordpress image.

    # yum search bitnami-wordpress

  2. Create a container, specifying the image name as an OS template:

    # prlctl create wordpress-ct --vmtype ct --ostemplate ubuntu-14.04-x86_64-bitnami_wordpress --config vswap.2048MB

    Virtuozzo will automatically download the image and spawn a container. Once container is up, it may take a few seconds to configure the Bitnami application.

  3. Connect the container to the external network and access Wordpress via browser.

    # prlctl set wordpress-ct --device-add net --dhcp yes --network Bridged

  4. Start the container. To wait until the configuration is complete, use the --wait parameter:

    # prlctl start wordpress-ct --wait

    The instance is up and running.

  5. Access end user credentials for the created application:

    # prlctl exec wordpress-ct cat bitnami_credentials.txt

    The password is generated automatically by Bitnami during provisioning (for details, see Password Management). Provide the credentials from the file to the application user.

Bitnami images are nearly identical to OS templates and you do not need to learn any additional commands to work with them. For example, to speed up container creation, you can use yum to download the image to the node and cache it:

# yum install ubuntu-14.04-x86_64-bitnami_wordpress

Creating a container will be significantly faster now. For example:

  1. Create a container from a cached template:

    # prlctl create wordpress-ct-cached --vmtype ct --ostemplate \

    ubuntu-14.04-x86_64-bitnami_wordpress --config vswap.2048MB

  2. Configure network in the container:

    # prlctl set wordpress-ct-cached --device-add net --dhcp yes --network Bridged

  3. Set a Wordpress password. To do this:
    1. Mount container file system to the host:

      # prlctl mount wordpress-ct-cached

    2. Copy the EnvID value from the output:

      # prlctl list -i wordpress-ct-cached

    3. Create a file with a new Wordpress password:

      # echo vz6catalog > /vz/root/<env_ID>/opt/bitnami/var/data/metadata_applications_password

  4. Start the container:

    # prlctl start wordpress-ct-cached --wait

  5. Obtain container's IP address:

    # prlctl exec wordpress-ct-cached ifconfig

  6. Access Wordpress in a browser at the obtained IP address and verify that you can login with the following credentials: username user, password vz6catalog.