Instance packages are preconfigured CPU/RAM/Disk/Bandwidth packages that can be selected during the VS creation process. You can add multiple instance packages specifying different values for the parameters to suit your customer's needs. Resources that are not set when creating an instance package (for example, swap disk size) are calculated automatically. 

Instance packages make it easier for users to create virtual servers. The users simply need to select one of the instance packages available to them in the wizard. However, it is still possible to set the VS resources manually if required. Instance packages apply only to virtual servers created on KVM compute resources.

To provide your users with the ability to choose VS resources from the predefined instance package(s), add the necessary packages to the users' bucket(s). After that, instance packages will appear in the server creation wizard, on the Resources step.


Set Up Instance Packages for Cloud

To enable your users to create virtual servers using instance packages, you need to perform the following configurations:

Enable the instance packages permission

In OnApp, there are two permissions that control how resources are selected during virtual server creation: Select resources manually on virtual server creation and Select instance package on virtual server creation. You can enable one or both of these permissions for your users. By default, users with the role User have the Select resources manually on virtual server creation enabled. If you want your users to be able to select instance packages during virtual server creation, you need to enable the Select instance package on virtual server creation permission. Depending on the permissions, the Resources step of the virtual server creation wizard can be different:

  • If both the Select resources manually on virtual server creation and Select instance package on virtual server creation permissions are enabled, the user will be able to choose whether to create a VS using an instance package or by setting resources manually.
  • If you disable the Select resources manually on virtual server permission and enable the Select instance package on virtual server creation permission, the user will be able to select VS resources only from the instance package(s) available to that user.
  • If you disable the Select instance package on virtual server creation permission and enable the Select resources manually on virtual server permission, the user will only be able to select resources manually.

If you are adding a custom role, make sure to enable either the Select resources manually on virtual server creation or the Select instance package on virtual server creation permission or both if required. If the user does not have any of these permissions enabled, they will not be able to create virtual servers.

For the list of OnApp permissions, refer to the Permissions List section.

Add instance packages to your cloud

After you enable the necessary permissions for your user(s), you need to add instance packages to your cloud. When you add a new instance package, you set CPU/RAM/Disk/Bandwidth. You can add multiple instance packages to provide your customers with a number of predefined packages to choose from. Resources that are not set when creating an instance package are calculated automatically.

To create an instance package:

  1. Go to your Control Panel > Admin > Instance packages menu.
  2. The screen that appears shows the list of all instance packages. Click button at the top of the screen.
  3. Complete the form on the screen that follows:
    • Label - fill in the name of the instance package.
    • CPUs - move the slider to set the number of CPU cores available in the instance package. The maximum CPUs value is 8.

    • Memory - move the slider to set the RAM size available in the instance package. The maximum value is 16384 MB by default.

    • Disk Size - move the slider to set the Disk size available in the instance package. The maximum value is 100 GB by default. The maximum disk size cannot be larger than the largest data store size in your cloud.
    • Bandwidth - move the slider to set the bandwidth available in the instance package, the maximum value is 450 GB by default. Otherwise, tick the check box to set bandwidth to unlimited.

      If the user exhausts the bandwidth limit, the resources they overuse will be calculated according to the bucket's Overused Bandwidth price in the Limits for Instance packages section.

      You can change the default minimum and/or maximum values for memory, disk size and bandwidth by adding the following parameters to the config/on_app.yml file and restarting OnApp services together with httpd service:

      • instance_package_min_disk_size (GB)
      • instance_package_max_disk_size (GB)
      • instance_package_max_memory (MB)
      • instance_package_min_bandwidth (GB)

      You can change the default maximum value for CPU by making updates to the info_hub.yml file.

             1. Open the info_hub.yml file which can be found at /onapp/interface/config/:

       vi /onapp/interface/config/info_hub.yml
      CODE

             2. Navigate to the virtual_machine section:

      virtual_machine: 
       min_cpus: 1 
       max_cpus: 8 
       min_memory: 128 
       min_swap_size: 1 
       max_swap_size: 3 
       cpu_sockets_min: 1 
       cpu_sockets_max: 16 
       cpu_threads_min: 1 
       cpu_threads_max: 16 
       cores_per_socket_min: 1 
       cores_per_socket_max: 32 
       vcloud: 
        min_memory: 4 
        max_memory: 1048576 
        max_cpus: 32
      CODE

              3. These changes will be overwritten by any OnApp update. Thus, the permanent file with the changes should be created and named info_hub.local:

      Virtual_machine:   
         max_cpus: 8
      CODE

              4. Edit the following values to the required ones and restart OnApp services:

       service monit stop
      service crond stop
      service onapp stop
      service httpd stop
      service httpd start
      service onapp start
      service crond start
      service monit start
      CODE
  4. Click Save to finish. Now you have a configured instance package. In order for it to be available to a user in VS Creation wizard, you have to add it to the user's bucket.

 How are other VS resources calculated?

The following resources are set automatically for instance packages:

  • CPU Priority - CPU priority is automatically set to 100
  • Swap disk size - swap disk size can have the size of 1/2/3 GB. Its size is calculated by multiplying the RAM by two. If the calculated value is larger than three, the swap disk size is set to 3. If the calculated value is smaller than three, it is rounded to the closest value from the 1/2/3 range that is larger than the calculated size. If the calculated value is larger than the disk size set for the instance package, the swap disk is not added to the VS.
  • IP address - the first available IP address is selected
  • Port speed - depends on the bucket limit. If the port speed Max limit in the bucket is set to unlimited, the port speed in the instance package will also be set to unlimited. If the port speed Max limit in the bucket is set to a certain value, the port speed in the instance package will be set to that same value.

Add the instance package(s) to the users' bucket

Once you created the instance packages, they can be added to bucket(s). This step is required to bundle the instance packages with the specific compute/data store/network zones. To add limits for instance packages:

  1. Go to the Admin > Buckets list and click the label of the bucket to which you want to add instance or create a new bucket
  2. Click + button in the upper right corner of the Limits for Instance packages box.
  3. In the window that pops up, select the target instance package and the compute zone(s), data store zone(s) and network zone(s) to which the instance package will apply. Click Add Resource.

  4. Set the price that will be charged per VS powered on/off  for each appropriate instance package. You can also set the pricing for overused bandwidth per GB/hr.

Instance packages apply only to KVM compute zones. If you select a vCloud Director or VMware compute zone, the instance package will not be displayed in the virtual server creation wizard.

If you do not select any compute/data store/network zones, the instance package will apply to all compute/data store/network zones available for the user.

It is advisable that you limit the user's bucket by the compute zones that have enough resources to support the instance package(s) you add to the user's bucket. If the user selects a compute zone that does not have enough resources during virtual server creation, they will see all instance packages available to them, but those that have resources incompatible with the chosen compute zone will be greyed out. Greyed out instance packages cannot be selected.

Note that Instance package VSs can only be created on compute resources within compute zones where all compute resources are assigned the same amount of CPU units. If there are compute resources with different amount of CPU units set in a zone, it will not be possible to create Instance package VSs in such zones. The reason is that CPU priority for Instance package VSs in this configuration cannot be set to 100%, which is the default value for such virtual servers.


If required, you can edit the zones to which the instance package applies:

  1. Go to the Admin > Buckets list and click the label of the bucket you are interested in.
  2. Click the Actions button next to the instance package you are interested in and select Edit.
  3. In the window that pops up, edit the compute resource/data store/network zone(s) and click Update.

If there is a VS created on a compute/data store/network zone which you remove while editing the bucket, the VS will still be billed according to the instance package.

Also, you can delete instance packages from the bucket:

  1. Go to the Buckets list and click the label of the bucket you are interested in.
  2. Click the Actions button next to the instance package you want to remove and select Delete. You will be asked for confirmation before the instance package is removed from the bucket.

You cannot delete the Instance packages that are used for existing VSs.

After you add instance packages to the user's bucket, they will be available in the virtual server creation wizard at the Resources step.

Interface configuration

After you add instance packages to the user's bucket, you can configure how instance packages will be displayed in the virtual server creation wizard. This step is optional.

Instance packages can be displayed either in card or list view. Displaying instance packages in card view is convenient if there is one or several instance packages available to the user.

However, if the user can choose among a large number of instance packages, it is more convenient to view instance packages in list view.

To change the layout of instance packages in the virtual server creation wizard:

  1. Go to your Control Panel Admin > Settings menu, and click the Configuration icon.
  2. The page that loads is the System tab. At the bottom of this page, set the Instance packages number parameter. The default value is 3.

  3. Click Save Configuration.

Build Virtual Server Using Instance packages

Once you have performed the above configurations, the instance packages can be selected during a virtual server creation.

Depending on the permissions, users will be able to select an instance package, set resources manually or choose one of these options on the Resources step.

If the user selects a compute zone that does not have enough resources during VS creation, the instance packages that have resources incompatible with the chosen compute zone will be grayed out and unavailable.
If there are no available IP addresses during VS creation, all instance packages will be grayed out in the wizard. 

Check production_allocation.log to see why some resources are not suitable for a particular virtual server while adding/editing this VS using an instance package.

From this tab, you can choose one of the predefined instance packages for your virtual server. For each of the instance packages the following details are displayed:

  • Memory - the RAM size (GB) available in the instance package
  • CPUs - the number of CPU cores available in this instance package
  • Disk Size - the disk size available in this instance package
  • Bandwidth - the bandwidth available in this instance package
  • Price per Hour:
    • Mode ON - hourly instance package price for the VS powered on
    • Mode OFF - hourly instance package price for the VS powered off
  • Price per Month:
    • Mode ON - monthly instance package price for the VS powered on
    • Mode OFF - monthly instance package price for the VS powered on

Click the instance package to select it. After that, the instance package you have chosen will be highlighted in green.

Click Next to proceed to the following step of the wizard.

You are forwarded to the next step from the tab you are currently on. If you select an instance package and then click the Create Your Own tab (where you set the resources manually) and proceed to the next step, the system will set the resources from the Create Your Own tab even if you did not configure any resources there.

Virtual servers created using instance packages do not support autoscaling.

The virtual servers you create using the Instance packages tab will be billed according to one of your preconfigured instance packages.


Billing for Instance Packages

Virtual servers that are built using instance packages are billed differently than VSs built by configuring resources manually. To set up billing for instance packages, you need to perform two steps:

Add an instance package to your cloud and configure resources available to VS that will be built on the basis of this instance package.

Add the instance package to the bucket's Access Control and set prices charged for the instance package VS in the Rate Card. 


Add instance packages to your cloud

To set up billing for instance packages, at first configure the number of resources available in the package at the AdminInstance packages > Create Instance package menu. The users who build a VS applying that instance package will be limited to:

  • CPUs - the number of CPU cores available in the instance package. The maximum CPUs value is 8.

  • Memory - the RAM size (GB) available in the instance package. The maximum value is 16384 MB by default.

  • Disk Size -  the disk size available in the instance package. The maximum value is 100 GB by default. The maximum disk size cannot be larger than the largest data store size in your cloud.
  • Bandwidth - the bandwidth available in the instance package. The maximum value is 450 GB by default. Otherwise, tick the checkbox to set bandwidth to unlimited.

    Bandwidth calculation is based on max_network_interface_port_speed configuration parameter in on_app.yml file. Example:
    If you have the max port speed equal to 2000 Mbit/second, bandwidth could not be more than 2000*3600(seconds in one hour)/(1000*8)=900 GB per hour.

You can change the default minimum and/or maximum values for memory, disk size and bandwidth by adding the following parameters to the config/on_app.ymlfile and restarting OnApp services:

  • instance_package_min_disk_size (GB)
  • instance_package_max_disk_size (GB)
  • instance_package_max_memory (MB)
  • instance_package_min_bandwidth (GB)

You can change the default maximum value for CPU by making updates to the info_hub.yml file.

       1. Open the info_hub.yml file which can be found at /onapp/interface/config/:

 vi /onapp/interface/config/info_hub.yml
CODE

       2. Navigate to the virtual_machine section:

virtual_machine: 
 min_cpus: 1 
 max_cpus: 8 
 min_memory: 128 
 min_swap_size: 1 
 max_swap_size: 3 
 cpu_sockets_min: 1 
 cpu_sockets_max: 16 
 cpu_threads_min: 1 
 cpu_threads_max: 16 
 cores_per_socket_min: 1 
 cores_per_socket_max: 32 
 vcloud: 
  min_memory: 4 
  max_memory: 1048576 
  max_cpus: 32
CODE

        3. These changes will be overwritten by any OnApp update. Thus, the permanent file with the changes should be created and named info_hub.local:

Virtual_machine:   
   max_cpus: 8
CODE

        4. Edit the following values to the required ones and restart OnApp services:

 service monit stop
service crond stop
service onapp stop
service httpd stop
service httpd start
service onapp start
service crond start
service monit start
CODE


Add instance packages to the bucket

After you create instance packages in your cloud, you need to add them to the bucket. You give users under the bucket access to the instance package(s) in the Access Control and set a price for each instance package per powered on/off VSs and per overused bandwidth in the Rate Card. In the Access Control, you can select the instance package and zone(s) in which this package will be available for users. If no zones are selected for the instance package that you added to the Access Control, the instance package will be available in all compute, network, and data store zones.

There is also a number of VS resources that are not configured during the instance package creation but are set automatically or differ from the standard procedure.

Resource typeResourceDefault ValueAdditional Information
Limits for Compute Zones

CPU Priority100CPU priority is automatically set to 100.
The Free bucket limits for compute zones N/AThe Free bucket limits for compute zones do not apply to Instance package VSs. 
The Max bucket limits for compute zones configurableMax limits for compute zone resources apply to Instance package VSs. The CPUs and Memory limits set in the instance package cannot exceed the corresponding limits in the bucket. If you create an instance package that exceeds the bucket limits, you will be able to add this instance package to a bucket and it will appear as available in the VS creation wizard. However, if this instance package is selected in the wizard, an error will occur after you try to proceed to the next step of the wizard.
Limits for Data Store Zones



The Free bucket limits for data store zonesN/AThe Free bucket limits for data store zones do not apply to Instance package VSs. 
The Max bucket limits for data store zonesconfigurableMax limits for data store resources apply to Instance package VSs. The Disk Size limit set in the instance package cannot exceed the corresponding limit in the bucket. If you create an instance package that exceeds the bucket limit, you will be able to add this instance package to a bucket and it will appear as available in the VS creation wizard. However, if this instance package is selected in the wizard, an error will occur after you try to proceed to the next step of the wizard.
Data Read/writtenN/AThe VSs disk size will be defined by the disk size indicated in the selected instance package.
Input/output RequestsN/AThe VSs disk size will be defined by the disk size indicated in the selected instance package.
Swap Disk Size1/2/3 GBThe size is calculated by multiplying the RAM by two. If the calculated value is larger than three, the swap disk size is set to 3. If the calculated value is smaller than three, it is rounded to the closest value from the 1/2/3 range that is larger than the calculated size. If the calculated value is larger than the disk size set for the instance package, the swap disk is not added to the VS.
Limits for Network Zones

IP Addressthe first available IP address is assignedOne IP address is assigned to the Instance package VS for free. If a user wants to assign an additional IP address to such a VS:
  • In case there are available units according to the Free IP address limit in the bucket, the additional IP address will be assigned for free.
  • In case the Free IP address limit is exhausted the additional IP address will be added and billed according to the On/Off bucket price per IP/hour.

If there are no available IP addresses during VS creation, all instance packages will be grayed out in the wizard.

Data Received/WrittenN/AThese limits do not apply to Instance package virtual servers. The VSs port speed, data sent and data received are not billed until the VS overuses the instance package's bandwidth limit. After that, the data the VS sends and receives will be billed according to the bucket's Overused Bandwidth price in the Limits for Instance packages section.
Port Speed depends on the bucket limit

If the port speed Max limit in the bucket is set to unlimited, the port speed in the instance package will also be set to unlimited.

If the port speed Max limit in the bucket is set to a certain value, the port speed in the instance package will be set to that same value.


Edit Instance Package

You can edit all the resources set for an instance package. 

To edit an instance package:

  1. Go to your Control Panel > Admin > Instance packages menu.
  2. The screen that appears, shows the list of all instance packages. Click the Actions button next the instance package you are interested in and select Edit.

    Only those instance packages that are not used in a bucket and during VS creation can be edited. If you try to edit an instance package that is used an error message will appear.

  3. On the page that loads, you can edit the following details:
    • Label - edit the name of the instance package.
    • CPUs - move the slider to set the number of CPU cores available in the instance package. The maximum CPUs value is 8.
    • Memory - move the slider to set the RAM size (MB) available in the instance package. The maximum value is 16384 MB by default.
    • Disk Size - move the sider to set the Disk size (GB) available in the instance package. The maximum value is 100 GB by default.
    • Bandwidth - move the slider to set the bandwidth (GB) available in the instance package. The maximum value is 450 GB by default. Otherwise, tick the check box to set bandwidth to unlimited.
  4. Click Save to finish.


You can change the default maximum value for CPU by making updates to the info_hub.yml file.

       1. Open the info_hub.yml file which can be found at /onapp/interface/config/:

 vi /onapp/interface/config/info_hub.yml
CODE

       2. Navigate to the virtual_machine section:

virtual_machine: 
 min_cpus: 1 
 max_cpus: 8 
 min_memory: 128 
 min_swap_size: 1 
 max_swap_size: 3 
 cpu_sockets_min: 1 
 cpu_sockets_max: 16 
 cpu_threads_min: 1 
 cpu_threads_max: 16 
 cores_per_socket_min: 1 
 cores_per_socket_max: 32 
 vcloud: 
  min_memory: 4 
  max_memory: 1048576 
  max_cpus: 32
CODE

        3. These changes will be overwritten by any OnApp update. Thus, the permanent file with the changes should be created and named info_hub.local:

Virtual_machine:   
   max_cpus: 8
CODE

        4. Edit the following values to the required ones and restart OnApp services:

 service monit stop
service crond stop
service onapp stop
service httpd stop
service httpd start
service onapp start
service crond start
service monit start
CODE

Delete Instance Package

  1. Go to your Control Panel > Admin > Instance packages menu.
  2. The screen that appears, show the list of all instance packages. Click the Actions button next the instance package you are interested in and select Delete. You will be asked for confirmation before the instance package is removed.

    Only those instance packages that are not used in a bucket and during VS creation can be deleted. If you try to delete an instance package that is used an error message will appear.