Restore
The OpenStack Plugin provides two targets for restore operations:
Restore to the OpenStack hypervisor as a new or the original Nova server.
Restore the Nova server to a local directory to the Bacula proxy server as
.bvmdk
,.conf
,.sha
and.bmp
files.
Restore to OpenStack
To use this method, the where=/
restore option should be used.
When using where=/
in the Restore Job, the Nova server is restored in the OpenStack server as
the original Nova server, provided it does not already exist. In cases where a Nova server
with the same name exists in the OpenStack server, the restore process will create a new Nova server using the
original Nova server name plus the -<number>
suffix to avoid the current Nova server
to be overwritten by the restore.
It is always possible to setup a server_restore_name
during the restore process for the restored Nova server name.
See also
For more details on server_restore_*
parameters, see: ref:RestoreParametersOpenstack.
This is an example, using bconsole, how to restore a Nova server to the OpenStack server:
* restore where=/ client=bacula-proxy-vm-rhel9-fd
...
You have selected the following JobId: 166
Building directory tree for JobId(s) 166 ...
6 files inserted into the tree.
You are now entering file selection mode where you add (mark) and
remove (unmark) files to be restored. No files are initially added, unless
you used the "all" keyword on the command line.
Enter "done" to leave this mode.
cwd is: /
$ mark *
6 files marked.
$ lsmark
+@openstack/
+nova/
*flavor/
*cirros256_c1
*server/
*257a54e7-73ac-4c10-bd01-a37f61f9a05d_cirros-instance1.name
*cirros-instance1_257a54e7-73ac-4c10-bd01-a37f61f9a05d/
*257a54e7-73ac-4c10-bd01-a37f61f9a05d.conf
*485b7cec-2c92-4d77-a1f8-ea981d6192cc.bmp
*485b7cec-2c92-4d77-a1f8-ea981d6192cc.bmpsha
*485b7cec-2c92-4d77-a1f8-ea981d6192cc.bvmdk
$ done
Bootstrap records written to /opt/bacula/working/bacula-dir.restore.21.bsr
The Job will require the following (*=>InChanger):
Volume(s) Storage(s) SD Device(s)
===========================================================================
Vol-0001 DiskAutochanger DiskAutochanger
Volumes marked with "*" are in the Autochanger.
6 files selected to be restored.
Run Restore job
JobName: Restore
Bootstrap: /opt/bacula/working/bacula-dir.restore.11.bsr
Where: /
Replace: Always
FileSet: BaculaConfigs
Backup Client: bacula-proxy-vm-rhel9-fd
Restore Client: bacula-proxy-vm-rhel9-fd
Storage: DiskAutochanger
When: 2025-05-09 15:06:29
Catalog: BaculaCatalog
Priority: 10
Plugin Options: *None*
OK to run? (Yes/mod/no): yes
Job queued. JobId=207
and then set any other required parameter.
The OpenStack plugin restores data as a new Nova server.
Obtain the configuration metadata file.
Acquire the raw disk data file(s).
Add a new virtual volume on the proxy server (hotadd).
Write all data regions back onto the volume(s).
Detach all restored volumes from the proxy server.
Once all volumes have been restored, create a new Nova server from the metadata configuration file. This step includes block device mapping for the restored volumes.
Here is an example of a successful restore job of a Nova server, where the plugin identifies an existing Nova server with the same cirros-instance1
name.
Consequently, the new Nova server is restored as cirros-instance1-1
:
bacula-dir JobId 207: Start Restore Job Restore.2025-05-09_15.06.35_33
bacula-dir JobId 207: Restoring files from JobId(s) 166
bacula-dir JobId 207: Connected to Storage "DiskAutochanger" at 10.0.99.131:9103 with TLS
bacula-dir JobId 207: Using Device "DiskAutochanger_Dev0" to read.
bacula-dir JobId 207: Connected to Client "bacula-proxy-vm-rhel9-fd" at 10.0.100.35:9102 with TLS
bacula-proxy-vm-rhel9-fd JobId 207: Connected to Storage at 10.0.99.131:9103 with TLS
bacula-sd JobId 207: Ready to read from volume "Vol-0001" on File device "DiskAutochanger_Dev0" (/opt/bacula/archive).
bacula-sd JobId 207: Forward spacing Volume "Vol-0001" to addr=2149713765
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Plugin log of this job available in: "/opt/bacula/working/openstack-0.log"
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Trying to get OSClient for endpoint=http://10.0.100.35/identity/v3 user=admin password=********** domain=Default project=demo
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Starting new server restore for "257a54e7-73ac-4c10-bd01-a37f61f9a05d"
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Nova flavor restore START
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Nova flavor with ID=c1 has the same characteristics as original is already on on the system Skip flavor restore
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Nova flavor restore END
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Restoring cinder volume "485b7cec-2c92-4d77-a1f8-ea981d6192cc" from server "cirros-instance1 (257a54e7-73ac-4c10-bd01-a37f61f9a05d)"
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Starting new unmatch volume restore for "485b7cec-2c92-4d77-a1f8-ea981d6192cc"
bacula-sd JobId 207: Elapsed time=00:06:54, Transfer rate=2.594 M Bytes/second
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Creating volume from configuration to restore
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Attach restore volume to proxy server
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Volume creation and attach for restore SUCCESS
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Restoring volume "485b7cec-2c92-4d77-a1f8-ea981d6192cc" as "a74434a4-aece-431e-aaa3-dbbc06b86313"
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Cinder volume restore SUCCESS
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Finalizing server restore
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Starting pairing between server restore and unmatch volumes
bacula-proxy-vm-rhel9-fd JobId 207: openstack: After unmatch volume pair all there are still 0 volumes without a match
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Detach all restored volume from proxy server
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Restore volume detach SUCCESS
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Restoring nova server "cirros-instance1 (257a54e7-73ac-4c10-bd01-a37f61f9a05d)" 1 volumes to attach
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Start server restore for "cirros-instance1 (257a54e7-73ac-4c10-bd01-a37f61f9a05d)" as "cirros-instance1-1"
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Orignal flavor lookup success
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Restoring server network: generic network creation
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Restoring server network: create associtaed subnet
bacula-proxy-vm-rhel9-fd JobId 207: openstack: A generic network "cirros-instance1-1 (65190167-d2ad-4cfb-abab-48ddff1b297b)" and its associtated subnet "cirros-instance1-1 (dace49cf-1b41-442e-b870-a10731b13aa2)" has been created
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Network associated with restored server "cirros-instance1-1 (257a54e7-73ac-4c10-bd01-a37f61f9a05d)" is "cirros-instance1-1 (65190167-d2ad-4cfb-abab-48ddff1b297b)"
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Restoring server network: generic network creation
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Restoring server network: create associtaed subnet
bacula-proxy-vm-rhel9-fd JobId 207: openstack: A generic network "cirros-instance1-1 (e9b9f2a7-7dbd-484c-b8db-72e12c1f8908)" and its associtated subnet "cirros-instance1-1 (4fddfed4-b7ab-4440-9daa-0cf2bc35bf6a)" has been created
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Server build
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Server creation/boot
bacula-proxy-vm-rhel9-fd JobId 207: openstack: Server restore for "cirros-instance1 (257a54e7-73ac-4c10-bd01-a37f61f9a05d)" success new server is "cirros-instance1-1" ("1f83ab5a-afa6-4214-9acb-aa157d0ad23b")
bacula-dir JobId 207: Bacula Enterprise bacula-dir 18.1.4 (02May25):
Build OS: x86_64-redhat-linux-gnu-bacula-enterprise redhat (Blue
JobId: 207
Job: Restore.2025-05-09_15.06.35_33
Restore Client: "bacula-proxy-vm-rhel9-fd" 18.1.4 (02May25) x86_64-redhat-linux-gnu-bacula-enterprise,redhat,(Blue
Where: /
Replace: Always
Start time: 09-May-2025 15:06:37
End time: 09-May-2025 15:15:32
Elapsed time: 8 mins 55 secs
Files Expected: 6
Files Restored: 6
Bytes Restored: 1,073,778,385 (1.073 GB)
Rate: 2007.1 KB/s
FD Errors: 0
FD termination status: OK
SD termination status: OK
Termination: Restore OK
Restore to a Local Directory
It is possible to restore a Nova server to a local directory without transferring the data
to the OpenStack server. To do so, the where
restore option must point to a directory on the proxy server
where the OpenStack Plugin is installed:
This is an example on how to restore a Nova server to a local directory using bconsole:
*restore jobid=166 where=/opt/bacula/archive/bacula-restores client=bacula-proxy-vm-rhel9-fd
You have selected the following JobId: 166
Building directory tree for JobId(s) 166 ...
6 files inserted into the tree.
You are now entering file selection mode where you add (mark) and
remove (unmark) files to be restored. No files are initially added, unless
you used the "all" keyword on the command line.
Enter "done" to leave this mode.
cwd is: /
$ mark *
6 files marked.
$ done
Bootstrap records written to /opt/bacula/working/bacula-dir.restore.21.bsr
The Job will require the following (*=>InChanger):
Volume(s) Storage(s) SD Device(s)
===========================================================================
Vol-0001 DiskAutochanger DiskAutochanger
Volumes marked with "*" are in the Autochanger.
6 files selected to be restored.
Run Restore job
JobName: Restore
Bootstrap: /opt/bacula/working/bacula-dir.restore.21.bsr
Where: /opt/bacula/archive/bacula-restores
Replace: Always
FileSet: BaculaConfigs
Backup Client: bacula-proxy-vm-rhel9-fd
Restore Client: bacula-proxy-vm-rhel9-fd
Storage: DiskAutochanger
When: 2025-05-09 16:08:37
Catalog: BaculaCatalog
Priority: 10
Plugin Options: *None*
OK to run? (Yes/mod/no): yes
Job queued. JobId=209
If the path specified for the where
option does not exist, it will be created by the Bacula OpenStack Plugin.
This is a successful restore joblog:
bacula-dir JobId 209: Start Restore Job Restore.2025-05-09_16.08.44_33
bacula-dir JobId 209: Restoring files from JobId(s) 166
bacula-dir JobId 209: Connected to Storage "DiskAutochanger" at 10.0.99.131:9103 with TLS
bacula-dir JobId 209: Using Device "DiskAutochanger_Dev0" to read.
bacula-dir JobId 209: Connected to Client "bacula-proxy-vm-rhel9-fd" at 10.0.100.35:9102 with TLS
bacula-proxy-vm-rhel9-fd JobId 209: Connected to Storage at 10.0.99.131:9103 with TLS
bacula-sd JobId 209: Ready to read from volume "Vol-0001" on File device "DiskAutochanger_Dev0" (/opt/bacula/archive).
bacula-sd JobId 209: Forward spacing Volume "Vol-0001" to addr=2149713765
bacula-proxy-vm-rhel9-fd JobId 209: openstack: Plugin log of this job available in: "/opt/bacula/working/openstack-0.log"
bacula-proxy-vm-rhel9-fd JobId 209: openstack: Trying to get OSClient for endpoint=http://10.0.100.35/identity/v3 user=admin password=********** domain=Default project=demo
bacula-proxy-vm-rhel9-fd JobId 209: openstack: Restoring Nova server configuration "257a54e7-73ac-4c10-bd01-a37f61f9a05d-cirros-instance1" at "/opt/baculaarchive//bacula-restores/nova/server/cirros-instance1_257a54e7-73ac-4c10-bd01-a37f61f9a05d/257a54e7-73ac-4c10-bd01-a37f61f9a05d.conf"
bacula-proxy-vm-rhel9-fd JobId 209: openstack: Starting new server restore for "257a54e7-73ac-4c10-bd01-a37f61f9a05d"
bacula-proxy-vm-rhel9-fd JobId 209: openstack: Nova flavor restore START
bacula-proxy-vm-rhel9-fd JobId 209: openstack: Restoring Nova Flavor "c1-cirros256" locally at "/opt/bacula/archive/bacula-restores/nova/flavor/cirros256_c1"
bacula-proxy-vm-rhel9-fd JobId 209: openstack: Nova flavor restore END
bacula-proxy-vm-rhel9-fd JobId 209: openstack: Restoring server volume configuration "485b7cec-2c92-4d77-a1f8-ea981d6192cc-" at "/opt/bacula/archive/bacula-restores/nova/server/cirros-instance1_257a54e7-73ac-4c10-bd01-a37f61f9a05d/485b7cec-2c92-4d77-a1f8-ea981d6192cc.conf"
bacula-proxy-vm-rhel9-fd JobId 209: openstack: Restoring cinder volume "485b7cec-2c92-4d77-a1f8-ea981d6192cc" from server "cirros-instance1 (257a54e7-73ac-4c10-bd01-a37f61f9a05d)"
bacula-proxy-vm-rhel9-fd JobId 209: openstack: Starting new unmatch volume restore for "485b7cec-2c92-4d77-a1f8-ea981d6192cc"
bacula-sd JobId 209: Elapsed time=00:05:09, Transfer rate=3.475 M Bytes/second
bacula-proxy-vm-rhel9-fd JobId 209: openstack: Restoring volume "485b7cec-2c92-4d77-a1f8-ea981d6192cc" locally at /opt/bacula/archive/bacula-restores/nova/server/cirros-instance1_257a54e7-73ac-4c10-bd01-a37f61f9a05d/485b7cec-2c92-4d77-a1f8-ea981d6192cc.bvmdk
bacula-proxy-vm-rhel9-fd JobId 209: openstack: Cinder volume restore SUCCESS
bacula-dir JobId 209: Bacula Enterprise bacula-dir 18.1.4 (02May25):
Build OS: x86_64-redhat-linux-gnu-bacula-enterprise redhat (Blue
JobId: 209
Job: Restore.2025-05-09_16.08.44_33
Restore Client: "bacula-proxy-vm-rhel9-fd" 18.1.4 (02May25) x86_64-redhat-linux-gnu-bacula-enterprise,redhat,(Blue
Where: /opt/bacula/bacula-restores
Replace: Always
Start time: 09-May-2025 16:08:47
End time: 09-May-2025 16:14:33
Elapsed time: 5 mins 46 secs
Files Expected: 6
Files Restored: 6
Bytes Restored: 1,073,778,385 (1.073 GB)
Rate: 3103.4 KB/s
FD Errors: 0
FD termination status: OK
SD termination status: OK
Termination: Restore OK
The restore job log will report that the restore was completed to a local directory: locally at /opt/bacula/archive/bacula-restores
.
These are the files restored in the /opt/bacula/archive/bacula-restores
directory of the bacula-proxy-vm-rhel9
Bacula proxy instance for the cirros-instance1
instance:
# ls -lR bacula-restores/
bacula-restores/:
total 0
drwxr-x--x. 4 root bacula 34 May 9 14:43 nova
bacula-restores/nova:
total 0
drwxr-x--x. 2 root bacula 26 May 9 14:43 flavor
drwxr-x--x. 3 root bacula 67 May 9 14:43 server
bacula-restores/nova/flavor:
total 4
-rw-r-----. 1 root bacula 275 May 9 14:43 cirros256_c1
bacula-restores/nova/server:
total 4
drwxr-x--x. 2 root bacula 4096 May 9 14:47 cirros-instance1_257a54e7-73ac-4c10-bd01-a37f61f9a05d
bacula-restores/nova/server/cirros-instance1_257a54e7-73ac-4c10-bd01-a37f61f9a05d:
total 1048616
-rw-r-----. 1 root bacula 1221 May 9 14:43 257a54e7-73ac-4c10-bd01-a37f61f9a05d.conf
-rw-r-----. 1 root bacula 4609 May 9 14:47 485b7cec-2c92-4d77-a1f8-ea981d6192cc.bmp
-rw-r-----. 1 root bacula 1073741824 May 9 14:47 485b7cec-2c92-4d77-a1f8-ea981d6192cc.bvmdk
-rw-r-----. 1 root bacula 620 May 9 14:43 485b7cec-2c92-4d77-a1f8-ea981d6192cc.conf
-rw-r-----. 1 root bacula 21314 May 9 14:47 485b7cec-2c92-4d77-a1f8-ea981d6192cc.sha
Go back to: Operations.