Difference between revisions of "Using Virtuozzo in the Microsoft Azure"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
Line 1: Line 1:
Release Notes
+
==Release Notes==
  
 
To allow customers to familiarize themselves with containers technology of Virtuozzo 6 and to maximize AWS instance utilization along with security and isolation we introduce Virtuozzo 6 image for Amazon EC2. Virtuozzo 6 supports only container technology then deployed on Amazon EC2.
 
To allow customers to familiarize themselves with containers technology of Virtuozzo 6 and to maximize AWS instance utilization along with security and isolation we introduce Virtuozzo 6 image for Amazon EC2. Virtuozzo 6 supports only container technology then deployed on Amazon EC2.
Line 6: Line 6:
 
#Virtuozzo 6 BYOL Bring Your Own License version
 
#Virtuozzo 6 BYOL Bring Your Own License version
  
Steps to Deploy
+
==Steps to Deploy==
  
 
Log into the AWS Marketplace, search for the AMI from Odin as the publisher, then click the selected product.
 
Log into the AWS Marketplace, search for the AMI from Odin as the publisher, then click the selected product.
 +
 
Check the product description to verify it suits your needs. Then click the "Continue" button.
 
Check the product description to verify it suits your needs. Then click the "Continue" button.
You can choose the Manual Launch with EC2 console by the pressing corresponding tab, or continue with the 1-Click Launch using predefined settings (the 1-Click Launch option does not allow you to modify the default storage size and type when creating the instance: 30 GB magnetic storage. To change disk storage after deployment, see the Amazon AWS documentation: Expanding the Storage Space of a Volume.)
+
 
 +
You can choose the Manual Launch with EC2 console by the pressing corresponding tab, or continue with the 1-Click Launch using predefined settings (the 1-Click Launch option does not allow you to modify the default storage size and type when creating the instance: 30 GB magnetic storage. To change disk storage after deployment, see the Amazon AWS documentation: [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html Expanding the Storage Space of a Volume]).
 +
 
 
1-Click Launch (predefined settings):
 
1-Click Launch (predefined settings):
Select the "Region" to deploy the instance and the EC2 Instance Type depending on your needs (Note: the price is different for different regions).
+
#Select the "Region" to deploy the instance and the EC2 Instance Type depending on your needs (Note: the price is different for different regions).
In VPC settings, select where your instance will be deployed: EC2 classic (recommended) or your personal Virtual Private Cloud. If the VPC network is selected, please make sure that your virtual network is configured to provide internet access to the instance is being deployed. The main differences between EC2-classic and VPC are described in Amazon EC2 and Amazon Virtual Private Cloud (VPC). Find more information about VPC in the Amazon VPC documentation.
+
#In VPC settings, select where your instance will be deployed: EC2 classic (recommended) or your personal Virtual Private Cloud. If the VPC network is selected, please make sure that your virtual network is configured to provide internet access to the instance is being deployed. The main differences between EC2-classic and VPC are described in [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.html Amazon EC2 and Amazon Virtual Private Cloud (VPC)]. Find more information about VPC in the [http://aws.amazon.com/documentation/vpc/ Amazon VPC documentation].
Select the default options or create a new Security Group based on seller settings. Pay special attention to the ports that are required for Plesk - see Knowledgebase article KB391: Which ports need to be opened for all Plesk services to work with a firewall?
+
#Select the default options or create a new Security Group based on seller settings. Pay special attention to the ports that are required for Plesk - see Knowledgebase article [http://kb.odin.com/en/391 KB391: Which ports need to be opened for all Plesk services to work with a firewall?]
Select the Key Pair to be used for connection to the instance (an existing Key Pair is required for connection to the Virtuozzo 6 instance). A Key Pair can be generated in the AWS Management Console.
+
#Select the Key Pair to be used for connection to the instance (an existing Key Pair is required for connection to the OpenVZ instance). A Key Pair can be generated in the [https://console.aws.amazon.com/ec AWS Management Console].
Click the Launch with 1-Click button.
+
#Click the Launch with 1-Click button.
 
By default, instances are deployed with small root storage (30 GB). It allows you deploy around 10 containers depends on container OS and installed packages. To deploy instances with bigger storage, use Manual Launch with EC2 console.
 
By default, instances are deployed with small root storage (30 GB). It allows you deploy around 10 containers depends on container OS and installed packages. To deploy instances with bigger storage, use Manual Launch with EC2 console.
To change the disk storage after deployment, check the Amazon AWS documentation: Expanding the Storage Space of a Volume.
+
To change the disk storage after deployment, check the Amazon AWS documentation: [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html Expanding the Storage Space of a Volume].
 +
 
 
Manual Launch with EC2 console (adjust additional settings such as disk space before launch):
 
Manual Launch with EC2 console (adjust additional settings such as disk space before launch):
Click on the Manual Launch tab.
+
#Click on the Manual Launch tab.
Click the Launch with EC2 Console button in the Region the instance is to be deployed.
+
#Click the Launch with EC2 Console button in the Region the instance is to be deployed.
In the opened EC2 Console, choose an Instance Type depending on your requirements. Then, click the Next: Configure Instance Details button.
+
#In the opened EC2 Console, choose an Instance Type depending on your requirements. Then, click the Next: Configure Instance Details button.
Set instance details. Here, you can select how many instances to deploy and select a Network (EC2-classic or VPC).If the VPC network is selected, please make sure that your virtual network is configured to provide internet access to the instance is being deployed.
+
#Set instance details. Here, you can select how many instances to deploy and select a Network (EC2-classic or VPC).If the VPC network is selected, please make sure that your virtual network is configured to provide internet access to the instance is being deployed. The main differences between EC2-classic and VPC are described in [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.html Amazon EC2 and Amazon Virtual Private Cloud (VPC)]. Find more information about VPC in the [http://aws.amazon.com/documentation/vpc/ Amazon VPC documentation].
The main differences between EC2-classic and VPC are described in Amazon EC2 and Amazon Virtual Private Cloud (VPC). Find more information about VPC in the Amazon VPC documentation.
+
#Change other options if required, then click Next: Add Storage
Change other options if required, then click Next: Add Storage
+
#Add storage to your instance. It is recommended that you increase your disk storage from the default values - your disk will be automatically resized when the instance is deployed. To change disk storage after deployment, check the Amazon AWS documentation: [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html Expanding the Storage Space of a Volume]. You can also add more storages to your instance and change the storage volume types to increase performance. Find more information about the storage type and pricing in the Amazon AWS documentaion: [http://aws.amazon.com/ebs/details/ Amazon EBS Product Details]. Click Next: Tag Instance
Add storage to your instance. It is recommended that you increase your disk storage from the default values - your disk will be automatically resized when the instance is deployed.
+
#Add Tags for the instance. For example, you can define a tag with key = Name and value = openvz. Learn more about tagging your Amazon EC2 resources. Click Next: Configure Security Group
To change disk storage after deployment, check the Amazon AWS documentation: Expanding the Storage Space of a Volume. You can also add more storages to your instance and change the storage volume types to increase performance. Find more information about the storage type and pricing in the Amazon AWS documentaion: Amazon EBS Product Details.
+
#Configure the security group. A security group is a set of firewall rules that control the traffic for your instance. It is recommended that you configure the security group depending on services you are going to serve. You can find the basic recommendations here https://openvz.org/Setting_up_an_iptables_firewall. Click Next: Review Instance Launch
Click Next: Tag Instance
+
#Review your instance launch details. You can go back to edit changes for each section. Click Launch to assign a key pair to your instance and complete the launch process.
Add Tags for the instance. For example, you can define a tag with key = Name and value = virtuozzo.
+
 
Learn more about tagging your Amazon EC2 resources.
+
When the instance is deployed, click the Visit Your Software link. The page with your subscription will be opened.
Click Next: Configure Security Group
+
 
Configure the security group. A security group is a set of firewall rules that control the traffic for your instance. It is recommended that you configure the security group depending on services you are going to serve. You can find the basic recommendations here https://openvz.org/Setting_up_an_iptables_firewall.  
+
Select [https://console.aws.amazon.com/ec2/v2/ Manage in the AWS console]. In the opened AWS Management Console, open your instances list (using the Instances link in the left menu) and select the instance.
Click Next: Review Instance Launch
+
 
Review your instance launch details. You can go back to edit changes for each section. Click Launch to assign a key pair to your instance and complete the launch process.
+
(Recommended) After every stop/start, your instance changes the external and internal IP pair. Thus we recommend to attach special Elastic IP to the instance. In the left menu, select Elastic IPs and Allocate New Address or select any existing unassociated address to be allocated to your instance. After Elastic IP attachment, reboot the instance and perform additional actions to configure Plesk (see the Changing IP Address section). Please find more information about Elastic IP on Amazon AWS documentation: [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html Elastic IP Addresses].
When the instance is deployed, click the Visit Your Software link. The page with your subscription will be opened:
+
 
Select Manage in the AWS console. In the opened AWS Management Console, open your instances list (using the Instances link in the left menu) and select the instance.
 
(Recommended) After every stop/start, your instance changes the external and internal IP pair. Thus we recommend to attach special Elastic IP to the instance. In the left menu, select Elastic IPs and Allocate New Address or select any existing unassociated address to be allocated to your instance. After Elastic IP attachment, reboot the instance and perform additional actions to configure Plesk (see the Changing IP Address section).
 
Please find more information about Elastic IP on Amazon AWS documentation: Elastic IP Addresses
 
 
To connect your instance please use connection via SSH as ec2-user with the private key of the Keys Pair you deployed the instance with. For example:
 
To connect your instance please use connection via SSH as ec2-user with the private key of the Keys Pair you deployed the instance with. For example:
# ssh -i <path to private key> ec2user@<elastic or public IP>
+
# ssh -i <path to private key> ec2user@<elastic or public IP>
If you use Virtuozzo 6 AMI your instance must to have valid Internet connection to automatically get a license from our license server. You can not login to the instance until it get a valid license. If you use Virtuozzo 6 BYOL AMI you need to proceed to the next step.
+
 
 
To operate with OpenVZ you need to enter sudo mode:
 
To operate with OpenVZ you need to enter sudo mode:
# sudo -i
+
# sudo -i
  
 
==How to install a license to the Virtuozzo 6 BYOL instance==
 
==How to install a license to the Virtuozzo 6 BYOL instance==
Line 55: Line 56:
 
  # vzlicload -p <Your License Key>
 
  # vzlicload -p <Your License Key>
  
Configuring the external IP address for the container
+
==Configuring an external IP address for the container==
To access to your container through the Internet you can attach additional Private IPs and Elastic IPs to the instance and then attach every Private IP to the specific container.  
+
 
 +
To access to your container through the Internet you can attach additional Private IPs and Elastic IPs to the instance and then attach every Private IP to the specific container.
 +
 
 
Please review this article to learn how to assign additional Elastic IPs to the instance http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/MultipleIP.html. If you need additional information on IP addressing in Amazon EC2 please see this article http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html
 
Please review this article to learn how to assign additional Elastic IPs to the instance http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/MultipleIP.html. If you need additional information on IP addressing in Amazon EC2 please see this article http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html
 +
 
Login to the Amazon EC2 Management Console.
 
Login to the Amazon EC2 Management Console.
 +
 
Assign new Private IP to your Instance:
 
Assign new Private IP to your Instance:
Choose your instance;
+
#Choose your instance;
Click Actions > Networking > Manage Private IP Addresses;
+
#Click Actions > Networking > Manage Private IP Addresses;
Click Assigh New IP;
+
#Click Assigh New IP;
Click Yes, Update.
+
#Click Yes, Update.
 +
 
 
Assign new Elastic IP to corresponding Private IP of your instance:
 
Assign new Elastic IP to corresponding Private IP of your instance:
Choose Elastic IP section in the menu;
+
#Choose Elastic IP section in the menu;
Click Allocate New Addresses;
+
#Click Allocate New Addresses;
Choose just created Elastic IP and click Actions > Associate Address;
+
#Choose just created Elastic IP and click Actions > Associate Address;
Choose your instance;
+
#Choose your instance;
Choose corresponding Private IP of your instance;
+
#Choose corresponding Private IP of your instance;
Click Associate.
+
#Click Associate.
 +
 
 
Connect to your OpenVZ instance via SSH.
 
Connect to your OpenVZ instance via SSH.
 +
 
Create example container:
 
Create example container:
# prlctl create 100700 --vmtype ct
+
# prlctl create 100700 --vmtype ct
 
Assign Private IP and DNS server to the container:
 
Assign Private IP and DNS server to the container:
# prlctl set 100700 --ipadd <Private IP address>/24
+
# prlctl set 100700 --ipadd <Private IP address>/24
# prlctl set 100700 --nameserver 8.8.8.8
+
# prlctl set 100700 --nameserver 8.8.8.8
 
Start the container:
 
Start the container:
# prlctl start 100700
+
# prlctl start 100700
 
Enter the container and set root password:
 
Enter the container and set root password:
# prlctl enter 100700
+
# prlctl enter 100700
# passwd
+
# passwd
 
Connect to the container via SSH:
 
Connect to the container via SSH:
# ssh root@<Elastic IP Address>
+
# ssh root@<Elastic IP Address>
Configuring NAT on the instance
+
 
If you do not want to attach multiple Elastic IPs to your instance you may also to configure NAT on your Virtuozzo 6 instance. Please follow instructions in this article: https://openvz.org/Using_NAT_for_container_with_private_IPs
+
==Configuring NAT on the instance==
+
 
Search words:
+
If you do not want to attach multiple Elastic IPs to your instance you may also to configure internal NAT on your OpenVZ instance. Please follow instructions in this article: https://openvz.org/Using_NAT_for_container_with_private_IPs
virtuozzo ec2 amazon aws
 

Revision as of 22:46, 10 September 2015

Release Notes

To allow customers to familiarize themselves with containers technology of Virtuozzo 6 and to maximize AWS instance utilization along with security and isolation we introduce Virtuozzo 6 image for Amazon EC2. Virtuozzo 6 supports only container technology then deployed on Amazon EC2. Virtuozzo 6 image is shipped in two editions:

  1. Virtuozzo 6 Amazon Billable
  2. Virtuozzo 6 BYOL Bring Your Own License version

Steps to Deploy

Log into the AWS Marketplace, search for the AMI from Odin as the publisher, then click the selected product.

Check the product description to verify it suits your needs. Then click the "Continue" button.

You can choose the Manual Launch with EC2 console by the pressing corresponding tab, or continue with the 1-Click Launch using predefined settings (the 1-Click Launch option does not allow you to modify the default storage size and type when creating the instance: 30 GB magnetic storage. To change disk storage after deployment, see the Amazon AWS documentation: Expanding the Storage Space of a Volume).

1-Click Launch (predefined settings):

  1. Select the "Region" to deploy the instance and the EC2 Instance Type depending on your needs (Note: the price is different for different regions).
  2. In VPC settings, select where your instance will be deployed: EC2 classic (recommended) or your personal Virtual Private Cloud. If the VPC network is selected, please make sure that your virtual network is configured to provide internet access to the instance is being deployed. The main differences between EC2-classic and VPC are described in Amazon EC2 and Amazon Virtual Private Cloud (VPC). Find more information about VPC in the Amazon VPC documentation.
  3. Select the default options or create a new Security Group based on seller settings. Pay special attention to the ports that are required for Plesk - see Knowledgebase article KB391: Which ports need to be opened for all Plesk services to work with a firewall?
  4. Select the Key Pair to be used for connection to the instance (an existing Key Pair is required for connection to the OpenVZ instance). A Key Pair can be generated in the AWS Management Console.
  5. Click the Launch with 1-Click button.

By default, instances are deployed with small root storage (30 GB). It allows you deploy around 10 containers depends on container OS and installed packages. To deploy instances with bigger storage, use Manual Launch with EC2 console. To change the disk storage after deployment, check the Amazon AWS documentation: Expanding the Storage Space of a Volume.

Manual Launch with EC2 console (adjust additional settings such as disk space before launch):

  1. Click on the Manual Launch tab.
  2. Click the Launch with EC2 Console button in the Region the instance is to be deployed.
  3. In the opened EC2 Console, choose an Instance Type depending on your requirements. Then, click the Next: Configure Instance Details button.
  4. Set instance details. Here, you can select how many instances to deploy and select a Network (EC2-classic or VPC).If the VPC network is selected, please make sure that your virtual network is configured to provide internet access to the instance is being deployed. The main differences between EC2-classic and VPC are described in Amazon EC2 and Amazon Virtual Private Cloud (VPC). Find more information about VPC in the Amazon VPC documentation.
  5. Change other options if required, then click Next: Add Storage
  6. Add storage to your instance. It is recommended that you increase your disk storage from the default values - your disk will be automatically resized when the instance is deployed. To change disk storage after deployment, check the Amazon AWS documentation: Expanding the Storage Space of a Volume. You can also add more storages to your instance and change the storage volume types to increase performance. Find more information about the storage type and pricing in the Amazon AWS documentaion: Amazon EBS Product Details. Click Next: Tag Instance
  7. Add Tags for the instance. For example, you can define a tag with key = Name and value = openvz. Learn more about tagging your Amazon EC2 resources. Click Next: Configure Security Group
  8. Configure the security group. A security group is a set of firewall rules that control the traffic for your instance. It is recommended that you configure the security group depending on services you are going to serve. You can find the basic recommendations here https://openvz.org/Setting_up_an_iptables_firewall. Click Next: Review Instance Launch
  9. Review your instance launch details. You can go back to edit changes for each section. Click Launch to assign a key pair to your instance and complete the launch process.

When the instance is deployed, click the Visit Your Software link. The page with your subscription will be opened.

Select Manage in the AWS console. In the opened AWS Management Console, open your instances list (using the Instances link in the left menu) and select the instance.

(Recommended) After every stop/start, your instance changes the external and internal IP pair. Thus we recommend to attach special Elastic IP to the instance. In the left menu, select Elastic IPs and Allocate New Address or select any existing unassociated address to be allocated to your instance. After Elastic IP attachment, reboot the instance and perform additional actions to configure Plesk (see the Changing IP Address section). Please find more information about Elastic IP on Amazon AWS documentation: Elastic IP Addresses.

To connect your instance please use connection via SSH as ec2-user with the private key of the Keys Pair you deployed the instance with. For example:

# ssh -i <path to private key> ec2user@<elastic or public IP>

To operate with OpenVZ you need to enter sudo mode:

# sudo -i

How to install a license to the Virtuozzo 6 BYOL instance

To use Virtuozzo 6 BYOL instance you need to install a license acquired from Odin. Connect to your Virtuozzo 6 instance via SSH. For example:

# ssh -i <path to private key> ec2user@<elastic or public IP>

Enter sudo mode:

# sudo -i

Install the license:

# vzlicload -p <Your License Key>

Configuring an external IP address for the container

To access to your container through the Internet you can attach additional Private IPs and Elastic IPs to the instance and then attach every Private IP to the specific container.

Please review this article to learn how to assign additional Elastic IPs to the instance http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/MultipleIP.html. If you need additional information on IP addressing in Amazon EC2 please see this article http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html

Login to the Amazon EC2 Management Console.

Assign new Private IP to your Instance:

  1. Choose your instance;
  2. Click Actions > Networking > Manage Private IP Addresses;
  3. Click Assigh New IP;
  4. Click Yes, Update.

Assign new Elastic IP to corresponding Private IP of your instance:

  1. Choose Elastic IP section in the menu;
  2. Click Allocate New Addresses;
  3. Choose just created Elastic IP and click Actions > Associate Address;
  4. Choose your instance;
  5. Choose corresponding Private IP of your instance;
  6. Click Associate.

Connect to your OpenVZ instance via SSH.

Create example container:

# prlctl create 100700 --vmtype ct

Assign Private IP and DNS server to the container:

# prlctl set 100700 --ipadd <Private IP address>/24
# prlctl set 100700 --nameserver 8.8.8.8

Start the container:

# prlctl start 100700

Enter the container and set root password:

# prlctl enter 100700
# passwd

Connect to the container via SSH:

# ssh root@<Elastic IP Address>

Configuring NAT on the instance

If you do not want to attach multiple Elastic IPs to your instance you may also to configure internal NAT on your OpenVZ instance. Please follow instructions in this article: https://openvz.org/Using_NAT_for_container_with_private_IPs