OpenStack Example

Using the scan_plugin via Command Line to Setup OpenStack Backups

In the example presented below, the Scan Plugin will contact the OpenStack server via the OpenStack Plugin installed on the bacula-proxy-vm-rhel9-fd. For each instance detected in the OpenStack server, a separate Job and Fileset will be created. Also, it will use the JobDefs BackupsToDisk in the new Jobs created. By using the --exclude bacula-proxy-vm-rhel9 option, a backup job for the bacula-proxy-vm-rhel9 will not be created.

# sudo -u bacula /opt/bacula/bin/scan_plugin --jobdefs BackupsToDisk --client bacula-proxy-vm-rhel9-fd --plugin openstack --plugin_option proxy_server=bacula-proxy-vm-rhel9 --scan_option proxy_server=bacula-proxy-vm-rhel9 --exclude bacula-proxy-vm-rhel9 --commit_and_reload

Report for scan_plugin 0.8 bacula-proxy-vm-rhel9-fd:openstack
----------------------------------------------
Client:         bacula-proxy-vm-rhel9-fd
Plugin:         openstack
Objects Added:  2
---------------------------------------------
 ~ updated, = kept, + added, X removed, D disabled
---------------------------------------------
 + J_bacula-proxy-vm-rhel9-fd_openstack_cirros-instance2
 + J_bacula-proxy-vm-rhel9-fd_openstack_cirros-instance1

----------------------------------------------
Status: Configuration applied and reloaded

The following configuration will be created:

# cat /opt/bacula/etc/conf.d/Director/am-r9-bee-bweb-openstack-tst-dir/Job/J_bacula-proxy-vm-rhel9-fd_openstack_cirros-instance1.cfg
Job {
  Name = "J_bacula-proxy-vm-rhel9-fd_openstack_cirros-instance1"
  Description = "{\"description\":\"Generated by scan_plugin. Do not edit.\",\"id\":\"bacula-proxy-vm-rhel9-fd:openstack\",\"parameter\":\"server\",\"plugin\":\"openstack\",\"server\":\"cirros-instance1\",\"uuid\":\"uuid=c37c9c5d-4296-41fc-9fc0-b8047ba2737b\",\"version\":\"0.8\"}"
  Type = "Backup"
  Client = "bacula-proxy-vm-rhel9-fd"
  Fileset = "F_bacula-proxy-vm-rhel9-fd_openstack_cirros-instance1"
  JobDefs = "BackupsToDisk"
}

# cat /opt/bacula/etc/conf.d/Director/am-r9-bee-bweb-openstack-tst-dir/Fileset/F_bacula-proxy-vm-rhel9-fd_openstack_cirros-instance1.cfg
Fileset {
  Name = "F_bacula-proxy-vm-rhel9-fd_openstack_cirros-instance1"
  Description = "{\"description\":\"Generated by scan_plugin. Do not edit.\",\"id\":\"bacula-proxy-vm-rhel9-fd-openstack-1746790567\",\"parameter\":\"server\",\"plugin\":\"openstack\",\"server\":\"cirros-instance1\",\"uuid\":\"uuid=c37c9c5d-4296-41fc-9fc0-b8047ba2737b\",\"version\":\"0.8\"}"
  Include {
   Options {
   }
   Plugin = "openstack: server=\"cirros-instance1\"  neutron_network_backup=\"true\" proxy_server=\"bacula-proxy-vm-rhel9\""
  }
}

# cat /opt/bacula/etc/conf.d/Director/am-r9-bee-bweb-openstack-tst-dir/Job/J_bacula-proxy-vm-rhel9-fd_openstack_cirros-instance2.cfg
Job {
  Name = "J_bacula-proxy-vm-rhel9-fd_openstack_cirros-instance2"
  Description = "{\"description\":\"Generated by scan_plugin. Do not edit.\",\"id\":\"bacula-proxy-vm-rhel9-fd:openstack\",\"parameter\":\"server\",\"plugin\":\"openstack\",\"server\":\"cirros-instance2\",\"uuid\":\"uuid=10440235-d07a-442b-acad-9e68bcdf3752\",\"version\":\"0.8\"}"
  Type = "Backup"
  Client = "bacula-proxy-vm-rhel9-fd"
  Fileset = "F_bacula-proxy-vm-rhel9-fd_openstack_cirros-instance2"
  JobDefs = "BackupsToDisk"
}

# cat /opt/bacula/etc/conf.d/Director/am-r9-bee-bweb-openstack-tst-dir/Fileset/F_bacula-proxy-vm-rhel9-fd_openstack_cirros-instance2.cfg
Fileset {
  Name = "F_bacula-proxy-vm-rhel9-fd_openstack_cirros-instance2"
  Description = "{\"description\":\"Generated by scan_plugin. Do not edit.\",\"id\":\"bacula-proxy-vm-rhel9-fd-openstack-1746790567\",\"parameter\":\"server\",\"plugin\":\"openstack\",\"server\":\"cirros-instance2\",\"uuid\":\"uuid=10440235-d07a-442b-acad-9e68bcdf3752\",\"version\":\"0.8\"}"
  Include {
   Options {
   }
   Plugin = "openstack: server=\"cirros-instance2\"  neutron_network_backup=\"true\" proxy_server=\"bacula-proxy-vm-rhel9\""
  }
}

Using BWeb Automation to Setup OpenStack Backups

Using BWeb, it is possible to setup an Automation Job to run regularly, and add or remove Jobs from the instances found in the OpenStack server.

  1. Click in either the Create automation button or the New Automation left menu.

../../../../_images/bwebautomationcenter_openstack_1.png
  1. Select the OpenStack plugin and the Bacula proxy VM Client used to run the OpenStack backups, and choose “Add Connection Plugin Options” to setup connection parameters.

../../../../_images/bwebautomationcenter_openstack_2.png
  1. Enter the name or UUID of the Bacula proxy VM in the OpenStack server, and the check button to confirm the connection is successful. After the check button has reported a successful connection, submit the settings.

../../../../_images/bwebautomationcenter_openstack_3.png ../../../../_images/bwebautomationcenter_openstack_4.png
  1. An example of how the OpenStack Plugin line should look like in the Fileset, and click in Next.

../../../../_images/bwebautomationcenter_openstack_5.png
  1. In Step 2, Defining what to backup, there are a few options:

  1. using a regular expression to Include a set of instances

../../../../_images/bwebautomationcenter_openstack_6_1.png ../../../../_images/bwebautomationcenter_openstack_6_1_1.png ../../../../_images/bwebautomationcenter_openstack_6_1_2.png ../../../../_images/bwebautomationcenter_openstack_6_1_3.png
  1. using a regular expression to Exclude a set of instances

../../../../_images/bwebautomationcenter_openstack_6_2_1.png ../../../../_images/bwebautomationcenter_openstack_6_2_2.png ../../../../_images/bwebautomationcenter_openstack_6_2_3.png

Note

It is possible to use both the Include and Exclude options in the same automation Job.

  1. manually selecting the items to be included in the OpenStack backup

../../../../_images/bwebautomationcenter_openstack_6_3_1.png ../../../../_images/bwebautomationcenter_openstack_6_3_2.png
  1. In Step 3, the Job parameters can be configured:

../../../../_images/bwebautomationcenter_openstack_7.png
  1. In Step 4, the Automation name, a Schedule to run the Automation, and other options can be configured:

../../../../_images/bwebautomationcenter_openstack_8.png
  1. By clicking in Run now and save in Step 4, the Automation Job is saved, it runs, and it adds two Jobs for both the cirros_instance1 and the cirros_instance2 objects:

../../../../_images/bwebautomationcenter_openstack_9.png

Go back to: Examples.