Implementing Configuration

The files where you define behavior of your backup plugin are config.xmlplugin.rb, and hook-specific files. In this document, you can find an example of config.xml with a detailed description of its contents.

The support status of Xen compute resources changes to End of Support in OnApp 6.5. We will no longer develop features or provide full support for Xen. 

Create XML Configuration File


First essential component of your backup plugin is a config.xml file. This is a configuration file that controls many aspects of a backup plugin behavior. Below you can find an example of config.xml that you can refer to while creating your backup plugin. 

config.xml
<config>
  <agent>
    <xen>true</xen>
    <kvm>true</kvm>
    <vmware>true</vmware>
    <vcenter>true</vcenter>
  </agent>
  <plugin_capabilities>
    <pulling_interval>1800</pulling_interval>
    <full_machine recovery_mode='true'>true</full_machine>
    <per_vdisk>false</per_vdisk>
    <os_files_level>true</os_files_level>
	<disallow_multiple_joins>true</disallow_multiple_joins>
    <link_to_provider>true</link_to_provider>
  </plugin_capabilities>
  <auto_backup_presets>
    <schedule>
      <type>Hourly</type>
      <frequency>1</frequency>
      <max_recovery_points>7</max_recovery_points>
    </schedule>
  </auto_backup_presets>
  <configuration_parameters>
    <option>
      <name>Option 1</name>
      <unique_identifier>option_1</unique_identifier>
      <type>integer</type>
      <min>1</min>
      <max>10</max>
      <default>3</default>
    </option>
    <option>
      <name>Option 2</name>
      <unique_identifier>option_2</unique_identifier>
      <type>integer</type>
      <min>1</min>
      <max>10</max>
      <default>3</default>
    </option>
    <option>       
      <name>Option 3</name>
      <unique_identifier>option_3</unique_identifier>
      <type>string</type>
      <regex_check>\d+</regex_check>
      <min>1</min>
      <max>10</max>
      <default>3</default>     
    </option>
    <option>
      <name>Option 4</name>
      <unique_identifier>option_4</unique_identifier>
      <type>bool</type>
    </option>   
  </configuration_parameters>
  <scheduler_options max="1">
    <hourly max="1"/>
    <daily max="1">
      <frequency>true</frequency>
    </daily>
    <weekly max="1">
      <days_to_run>true</days_to_run>
    </weekly>
    <monthly max="1">
      <day_of_the_week_to_run>true</day_of_the_week_to_run>
      <week_of_the_month_to_run>true</week_of_the_month_to_run>
    </monthly>
    <yearly max="1"/>
  </scheduler_options>
</config>


In the following table, you can find details about configuration options that you can pass via config.xml.

Component

Element

Type

Required?

Description

agent

If at least one of
the agent elements
is set to true,
the install_agent and
uninstall_agent hooks
are required.



kvm

Boolean

Yes

The installation of a third-party agent is required on KVM-based compute resources.

xen

Boolean

YesThe installation of a third-party agent is required on Xen-based compute resources.
vmware

Boolean

YesThe installation of a third-party agent is required on VMware-based compute resources.
vcenter

Boolean

Yes

The installation of a third-party agent is required on vCenter-based compute resources.

plugin_capabilities

pulling_interval
IntegerYes

The time in seconds between pulling the status of backup jobs and the list of available recovery points.

full_machine
BooleanYes

If a provider supports a full virtual server backup and recovery, set to true, otherwise, set to false.

Attributes:

Before restoration from a recovery point, virtual servers should be rebooted in recovery mode. For this, set the recovery_mode attribute to true for VSs to be rebooted in recovery mode. The reboot in recovery mode is currenly available for virtual servers that are built on KVM and Xen compute resources.

per_vdisk
BooleanYesIf a provider supports backup and recovery for each vDisk on a virtual server, set to true, otherwise, set to false.
os_files_level
BooleanYes

If a provider supports backup and recovery at an OS file level, set to true, otherwise, set to false. When set to true, the os_files_level element requires the following hooks:

  • file_entries
  • restore_file_entries

disallow_multiple_joins
BooleanNoTo forbid adding multiple resources to a virtual server, set to true, otherwise, set to false.
link_to_provider
BooleanNoTo add a button to OnApp Control Panel UI that would allow to access a provider backup console, set to true, otherwise, set to false. If the parameter is set to true, the link_to_provider.rb file is required.
space_used
BooleanNoIf a provider can return total disk space taken by all backups on a particular virtual server, set to true, otherwise, set to false. If the parameter is set to true, the space_used.rb file is required.
remove_resource_from_server_on_owner_changeBooleanNoTo remove the backup resources using backup plugin attached to VS after the VS's owner is changed set to true, otherwise, set to false.

auto_backup_presets

schedules
Array<schedule>Yes

The component allows setting default schedules for auto backup presets. The schedules included into auto_backup_presets are created automatically on a backup resource.

schedule

type 
StringYes

The type of a schedule that can be the following:

  • Hourly
  • Daily
  • Weekly

  • Monthly

  • Yearly

start_time
IntegerYesThe start time for running backups specified using the military time, for example, 1600 that corresponds to 4:00 pm.
frequency
IntegerNoThe frequency of how often to run daily backups. For example, set 1 to run backups every day, 2 - every second day, 3 - every third day, etc. 
days_to_run
Array<day>NoThe day or days of the week when to run weekly backups.
day_of_the_week_to_run
StringNoThe days of the week when to run monthly backups (e.g. Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday).
week_of_the_month_to_run
StringNoThe week of the month when to run monthly backups (e.g. First/Second/Third/Fourth).
max_recovery_points
IntegerYesThe maximum number of recovery points for a particular schedule. The recovery point represents a point-in-time backup from which users can restore a virtual server. The max_recovery_points option is used to set a total amount of recovery points that can be created and kept for a particular backup job. When the maximum limit is reached, new recovery points overwrite the existing ones.

day

day
StringYes

The days of the week when to run weekly backups (e.g. Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday).

configuration_parameters

options
Array<option>No

The configuration_parameters component allows setting custom options for a global configuration of your backup plugin. The options that you can use here are software-specific and unique for a particular backup service. For example, you can provide an option to set a data retention period. The retention period determines the amount of time to store the historical data that can be used in data views and reports on the backup service side.

option

name
StringYesThe name of the field that will be displayed in UI for this option.
unique_identifier
StringYesThe unique identifier that will be used in the database to save this option when it is set.
type
StringYes

The following types can be used:

  • integer
  • string
  • bool
regex_check
StringNoThe RegExp check for values entered in a text box if the type is set to string. By default, it is blank that presupposes no check.
min
IntegerNo

The minimum value to be used for the slider if the type is set to integer. By default, it is '1'.

max
IntegerNoThe maximum value to be used for the slide if the type is set to integer. By default, it is '100'.        
default
IntegerNoThe default value to be set for the option. The value is converted to integer if the type is set to integer or to string that is shown in the text box if the type is set to string.

scheduler_options

Attributes:

You can use the max
attribute to determine
the total amount of
schedules that can be
created for a single
virtual server.
If the attribute is missing,
the amount of schedules
is unlimited.




daily
SchedulerOptionsDaily No

The daily schedule options that the backup system can handle.

Attributes:

You can use the max attribute to determine the total amount of daily schedules that can be created for a single virtual server. If the attribute is missing, the amount of schedules is unlimited.

weekly 
SchedulerOptionsWeeklyNo

The weekly schedule options that the backup system can handle.

Attributes:

You can use the max attribute to determine the total amount of weekly schedules that can be created for a single virtual server. If the attribute is missing, the amount of schedules is unlimited.

monthly 
SchedulerOptionsMonthlyNo

The monthly schedule options that the backup system can handle.

Attributes:

You can use the max attribute to determine the total amount of monthly schedules that can be created for a single virtual server. If the attribute is missing, the amount of schedules is unlimited.

daily

frequency 
BooleanNoSet to true for the backup system to allow setting frequency for daily backups, otherwise, set to false.

weekly

days_to_run
BooleanNoSet to true for the backup system to allow setting days of the week when to run weekly backups, otherwise, set to false.

monthly

day_of_the_week_to_run
BooleanNoSet to true for the backup system to allow setting days of the week when to run monthly backups, otherwise, set to false.
week_of_the_month_to_run
BooleanNoSet to true for the backup system to allow setting weeks of the month when to run monthly backups, otherwise, set to false.


What's Next?