How to Restore Oracle VM Manager without Database Backup or Admin Password – Part 12


In our previous post (Part 8) we have discussed how to recover the Oracle VM Manager using MySQL database. For that we need MySQL backup and admin & weblogic user password. But sometimes we might have chance to forget the admin or weblogic user password and also no backup of Oracle VM Manager MySQL database. In that case, we need to follow the below steps to recover the Oracle VM Manager.

Before starting our VM manager installation we need the existing Manager UUID value. The Oracle VM Manager UUID is located in Oracle VM Manager server (/u01/app/oracle/ovm-manager-3/.config) file and as well as in each server pool’ .ovsrepo file (OVS_REPO_MGR_UUID=UUID) located in the pool file system.

[root@mgmtsrv ~]# cat /repo2/.ovsrepo
OVS_REPO_UUID=0004fb000003000082b0d717e2f9871d
OVS_REPO_VERSION=3.0
OVS_REPO_MGR_UUID=0004fb00000100009157557324ed168d
OVS_REPO_ALIAS=OraRepo

Step 1: Move the OVS agent db directory

This step is not required, however we need to perform if we get any ownership error or warning during discovering the Oracle Virtual Server.

[root@ovs01 ~]# /etc/init.d/ovs-agent stop
Stopping Oracle VM Agent: [ OK ]

[root@ovs01 ~]# mv /etc/ovs-agent/db /etc/ovs-agent/db_bak20171223

[root@ovs01 ~]# /etc/init.d/ovs-agent start
Starting Oracle VM Agent: [ OK ]

Step 2: Login to Oracle VM Manager as admin

[root@mgmtsrv ~]# ssh -l admin ovm.lab.local -p 10000
admin@ovm.lab.local's password:
OVM>

Step 3: Discover one Oracle VM Server from each server pool

OVM> discoverServer ipaddress=ovs01.lab.local password=********** takeOwnership=Yes
Command: discoverServer ipaddress=ovs01.lab.local password=**** takeOwnership=Yes
Status: Success
Time: 2017-12-23 03:47:27,748 EST
JobId: 1514018774243

Step 4: Discover the storage that contains the server pool file system. Present it to the newly discovered Oracle VM Server. Refresh the storage.

OVM> create FileServer plugin="Oracle Generic Network File System" accessHost=mgmtsrv.lab.local adminServers="ovs01.lab.local" name=MYSANRec
Command: create FileServer plugin="Oracle Generic Network File System" accessHost=mgmtsrv.lab.local adminServers="ovs01.lab.local" name=MYSANRec
Status: Success
Time: 2017-12-23 03:50:08,007 EST
JobId: 1514019007499
Data:
id:0004fb0000090000371a9d6db792e728 name:MYSANRec

OVM> addAdminServer FileServer name=MYSANRec server=ovs01.lab.local
Command: addAdminServer FileServer name=MYSANRec server=ovs01.lab.local
Status: Success
Time: 2017-12-23 03:50:33,884 EST
JobId: 1514019033629

OVM> addRefreshServer FileServer name=MYSANRec server=ovs01.lab.local
Command: addRefreshServer FileServer name=MYSANRec server=ovs01.lab.local
Status: Success
Time: 2017-12-23 03:50:58,303 EST
JobId: 1514019058085

OVM> refresh FileServer name=MYSANRec
Command: refresh FileServer name=MYSANRec
Status: Success
Time: 2017-12-23 03:51:24,544 EST
JobId: 1514019082774

Step 5: Refresh the file systems or physical disks that contain the server pool file system

OVM> list FileSystem
Command: list FileSystem
Status: Success
Time: 2017-12-23 03:51:33,554 EST
Data:
id:9f4e1109-2c5b-4bae-834b-0ccc203e5ab6 name:nfs on mgmtsrv.lab.local:/repo2
id:f3834a16-6fcb-4f82-9a2a-b3d3ed936ae3 name:nfs on mgmtsrv.lab.local:/repo1

OVM> refresh FileSystem name="nfs on mgmtsrv.lab.local://repo1"
Command: refresh FileSystem name="nfs on mgmtsrv.lab.local://repo1"
Status: Success
Time: 2017-12-23 03:52:49,786 EST
JobId: 1514019168044

Step 6: Refresh the file systems or physical disks that contain the repositories used by server pool

OVM> refresh FileSystem name="nfs on mgmtsrv.lab.local://repo2"
Command: refresh FileSystem name="nfs on mgmtsrv.lab.local://repo2"
Status: Success
Time: 2017-12-23 03:52:54,608 EST
JobId: 1514019173387

Step 7: Present the repositories to the Oracle VM Server

OVM> add Server name=ovs01.lab.local to ServerPool name=Pool_01
Command: add Server name=ovs01.lab.local to ServerPool name=Pool_01
Status: Success
Time: 2017-12-23 03:57:10,904 EST
JobId: 1514019424928

OVM> list ServerPool
Command: list ServerPool
Status: Success
Time: 2017-12-23 03:57:18,884 EST
Data:
id:0004fb00000200002d1d67487c79ed89 name:Pool_01

OVM> add ServerPool name=Pool_01 to Repository name=OraRepo
Command: add ServerPool name=Pool_01 to Repository name=OraRepo
Status: Success
Time: 2017-12-23 03:59:06,197 EST
JobId: 1514019545102

Step 8: Refresh the repositories

OVM> refresh Repository name=OraRepo
Command: refresh Repository name=OraRepo
Status: Success
Time: 2017-12-23 03:59:20,625 EST
JobId: 1514019559448

Step 9: Check the VM list

OVM> list vm
Command: list vm
Status: Success
Time: 2017-12-23 04:04:50,724 EST
Data:
id:0004fb0000060000524f9d3e43fd71f3 name:FirstVM

OVM> start vm name=FirstVM
Command: start vm name=FirstVM
Status: Failure
Time: 2017-12-23 04:05:36,388 EST
JobId: 1514019936121
Error Msg: Job failed on Core: OVMRU_005053E: Virtual Machine: FirstVM, is not associated with any server pool [Sat Dec 23 04:05:36 EST 2017]

In above command, I’m trying to start the Virtual Machine but it failed because the VM “FirstVM” is not associated with any server pool. So we need to move this VM to corresponding Server Pool.

OVM> migrate Vm name=FirstVM destServerPool=Pool_01
Command: migrate Vm name=FirstVM destServerPool=Pool_01
Status: Success
Time: 2017-12-23 04:13:31,390 EST
JobId: 1514020411131

OVM> start vm name=FirstVM
Command: start vm name=FirstVM
Status: Success
Time: 2017-12-23 04:13:45,270 EST
JobId: 1514020416903

How to upgrade Oracle VM Manager – Part 9


Step 1: Mount the required ISO into VM Manager.

[root@ovm ~]# mount -t iso9660 /dev/sr0 /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only

Step 2: Trigger the upgrade command

[root@ovm ~]# cd /mnt

As part of precautionary action, it is recommended to take the Manual backup of Oracle VM Manager before execute the Upgrade task. In case of any failure, we can restore from backup. Please check my previous post for Oracle VM Manager Backup and Restore steps.

Before proceed to upgrade the Oracle VM Manager, please make sure you have valid MySQL database, admin and weblogic user password. If you set a system-wide password during the original installation and have not changed the user password at any stage, admin password should work for above users.

Since this is my lab purpose here I ignored the prerequisites check. But don’t use -n parameter if you are doing in Production server.

[root@ovm mnt]# ./runInstaller.sh --installtype Upgrade -n

Oracle VM Manager Release 3.3.5 Installer

Oracle VM Manager Installer log file:
/var/log/ovmm/ovm-manager-3-install-2017-12-19-041925.log

Ignoring prerequisites check ...
Starting Upgrade ...

Reading database parameters from config ...

==========================
Typically the current Oracle VM Manager database password will be the same as the Oracle VM Manager application password.

==========================
Database Repository
==========================
Please enter the current Oracle VM Manager database password for user ovs: ##Enter OVS MySQL database password##

Oracle VM Manager application
=============================
Please enter the current Oracle VM Manager application password for user admin: ##Enter Oracle VM Manager admin password##

Oracle Weblogic Server 12c
==========================
Please enter the current password for the WebLogic domain administrator: ##Enter weblogic user password##

Please enter your fully qualified domain name, e.g. ovs123.us.oracle.com, (or IP address) of your management server for SSL certification generation 10.10.10.151 [ovm.lab.local]:

Verifying configuration ...

Upgrading from version 3.3.3.1085 to version 3.3.5.1109

Start upgrading Oracle VM Manager:
1: Continue
2: Abort

Select Number (1-2): 1

Running full database backup ...
Successfully backed up database as 3.3.3_preUpgradeBackup-20171219_042023
Running ovm_preUpgrade script, please be patient this may take a long time ...
Exporting weblogic embedded LDAP users
Stopping service on Linux: ovmcli ...
Stopping service on Linux: ovmm ...
Exporting core database, please be patient this may take a long time ...
NOTE: To monitor progress, open another terminal session and run: tail -f /var/log/ovmm/ovm-manager-3-install-2017-12-19-041925.log

Product component : Java in '/u01/app/oracle/java'
Java is installed ...

Removing Java installation ...

Installing Java ...

DB component : MySQL RPM package
MySQL RPM package installed by OVMM was found...
Removing MySQL RPM package installation ...

Installing Database Software...
Retrieving MySQL Database 5.6 ...
Unzipping MySQL RPM File ...
Installing MySQL 5.6 RPM package ...
Configuring MySQL Database 5.6 ...
Installing MySQL backup RPM package ...

Product component : Oracle VM Manager in '/u01/app/oracle/ovm-manager-3/'
Oracle VM Manager is installed ...
Removing Oracle VM Manager installation ...

Product component : Oracle WebLogic Server in '/u01/app/oracle/Middleware/'
Oracle WebLogic Server is installed

Removing Oracle WebLogic Server installation ...
Service ovmm is deleted.
Service ovmcli is deleted.

Retrieving Oracle WebLogic Server 12c and ADF ...
Installing Oracle WebLogic Server 12c and ADF ...
Applying patches to Weblogic ...
Applying patch to ADF ...

Installing Oracle VM Manager Core ...
Retrieving Oracle VM Manager Application ...
Extracting Oracle VM Manager Application ...

Retrieving Oracle VM Manager Upgrade tool ...
Extracting Oracle VM Manager Upgrade tool ...
Installing Oracle VM Manager Upgrade tool ...

Creating Oracle WebLogic Server domain ...
Starting Oracle WebLogic Server 12c ...
Importing weblogic embedded LDAP users
Upgrading core database, please be patient this may take a long time ...
NOTE: To monitor progress, open another terminal session and run: tail -f /var/log/ovmm/ovm-manager-3-install-2017-12-19-041925.log

Retrieving Oracle VM Manager CLI tool ...
Extracting Oracle VM Manager CLI tool...
Installing Oracle VM Manager CLI tool ...

Configuring Existing Https Identity and Trust...
Deploying Oracle VM Manager Core container ...
Configuring Client Cert Login...
Deploying Oracle VM Manager UI Console ...
Deploying Oracle VM Manager Help ...
Disabling HTTP access ...

Retrieving Oracle VM Manager Shell & API ...
Extracting Oracle VM Manager Shell & API ...
Installing Oracle VM Manager Shell & API ...

Retrieving Oracle VM Manager Wsh tool ...
Extracting Oracle VM Manager Wsh tool ...
Installing Oracle VM Manager Wsh tool ...

Retrieving Oracle VM Manager Tools ...
Extracting Oracle VM Manager Tools ...
Installing Oracle VM Manager Tools ...
Copying Oracle VM Manager shell to '/usr/bin/ovm_shell.sh' ...
Installing ovm_admin.sh in '/u01/app/oracle/ovm-manager-3/bin' ...
Installing ovm_upgrade.sh in '/u01/app/oracle/ovm-manager-3/bin' ...

Enabling Oracle VM Manager service ...
Shutting down Oracle VM Manager instance ...
Starting Oracle VM Manager instance ...
Waiting for the application to initialize ...
Oracle VM Manager is running ...

Please wait while WebLogic configures the applications...

Installation Summary
--------------------
Database configuration:
Database type : MySQL
Database host name : localhost
Database name : ovs
Database listener port : 49500
Database user : ovs

Weblogic Server configuration:
Administration username : weblogic

Oracle VM Manager configuration:
Username : admin
Core management port : 54321
UUID : 0004fb00000100009157557324ed168d

Passwords:
There are no default passwords for any users. The passwords to use for Oracle VM Manager, Database, and Oracle WebLogic Server have been set by you during this installation. In the case of a default install, all passwords are the same.

Oracle VM Manager UI:
https://ovm.lab.local:7002/ovm/console
Log in with the user 'admin', and the password you set during the installation.

Note that you must install the latest ovmcore-console package for your Oracle Linux distribution to gain VNC and serial console access to your Virtual Machines (VMs).
Please refer to the documentation for more information about this package.

For more information about Oracle Virtualization, please visit:
http://www.oracle.com/virtualization/

Oracle VM Manager upgrade complete.

Please remove configuration file /tmp/ovm_configTpvifE.

Backup and Restore Oracle VM Manager – Part 8


Step 1: Copy the Oracle VM Manager configuration file

[root@mgmtsrv ~]# ssh root@ovm.lab.local
root@ovm.lab.local's password:
Last login: Sun Dec 17 02:59:42 2017 from 10.10.10.1

[root@ovm ~]# mkdir /opt/OVM_Backup


[root@ovm ~]# cp /u01/app/oracle/ovm-manager-3/.config /opt/OVM_Backup/

Step 2: Backup MySQL database repository

[root@ovm ~]# /u01/app/oracle/ovm-manager-3/ovm_tools/bin/BackupDatabase -w
Enter your OVM Manager username: admin
Enter your OVM Manager password: ## Enter VM Manager admin password ##

INFO: Backup job starting with destination:
/u01/app/oracle/mysql/dbbackup/ManualBackup-20171217_053626

Job Id = 'Start Backup to: ManualBackup(1513506985746) Uri: https://localhost:7002/ovm/core/wsapi/rest/Job/1513506985746'
Job Name = 'Start Backup to: ManualBackup'

INFO: Backup job finished

[root@ovm ~]# cp -r /u01/app/oracle/mysql/dbbackup/ManualBackup-20171217_053626 /opt/OVM_Backup/

Don’t forget to take backup of Oracle VM Manager UUID is persisted in the /etc/sysconfig/ovmm file

[root@ovm ~]# cp /etc/sysconfig/ovmm /opt/OVM_Backup/

Please make sure that you have taken above necessary backup before upgrade/reinstall or migrate the Oracle VM Manager.

[root@ovm ~]# ls -a /opt/OVM_Backup/
. .. .config ManualBackup-20171217_053626 ovmm

Step 3: Uninstall the Oracle VM Manager

Make sure you have MySQL repository backup before you start the uninstallation.

[root@ovm mnt]# ls -l /u01/app/oracle/mysql/dbbackup/
drwxr-xr-x 5 oracle dba 4096 Dec 12 04:52 ManualBackup-20171217_053626

Stop VM manager related services

[root@ovm mnt]# /etc/init.d/ovmcli stop
Stopping Oracle VM Manager CLI [ OK ]
[root@ovm mnt]# /etc/init.d/ovmm_mysql stop
Shutting down OVMM MySQL.... SUCCESS!
[root@ovm mnt]# /etc/init.d/ovmm stop
Stopping Oracle VM Manager [ OK ]

Uninstall the VM Manager

[root@ovm mnt]# ./runInstaller.sh -n

Oracle VM Manager Release 3.3.3 Installer

Oracle VM Manager Installer log file:
/var/log/ovmm/ovm-manager-3-install-2017-12-14-024725.log

Please select an installation type:
1: Install
2: Upgrade
3: Uninstall
4: Help

Select Number (1-4): 3

Begin uninstalling Oracle VM Manager:
1: Continue
2: Abort

Select Number (1-2): 1

Uninstall Oracle VM Manager

DB component : MySQL RPM package
MySQL RPM package installed by OVMM was found...
Removing MySQL RPM package installation ...

Product component : Java in '/u01/app/oracle/java/'
Java is installed ...

Removing Java installation ...

Product component : Oracle VM Manager in '/u01/app/oracle/ovm-manager-3/'
Oracle VM Manager is installed ...
Removing Oracle VM Manager installation ...

Product component : Oracle WebLogic Server in '/u01/app/oracle/Middleware/'
Oracle WebLogic Server is installed

Removing Oracle WebLogic Server installation ...
Service ovmm is deleted.
Service ovmcli is deleted.

Uninstall completed ...

Step 4: Re-Install the Oracle VM Manager

Note down the old VM Manager UUID value

[root@ovm ~]# cat /etc/sysconfig/ovmm
RUN_OVMM=YES
USETLS1=YES
DBBACKUP_CMD=/opt/mysql/meb-3.12/bin/mysqlbackup
JVM_MAX_PERM=512m
JVM_MEMORY_MAX=4096m
DBBACKUP=/u01/app/oracle/mysql/dbbackup
UUID=0004fb000001000060c2c1d955c85575

Reuse the same usernames and password for the database schema, Oracle WebLogic Server and Oracle VM Manager administration user.

[root@ovm mnt]# ./runInstaller.sh -n --uuid 0004fb000001000060c2c1d955c85575

Oracle VM Manager Release 3.3.3 Installer

Oracle VM Manager Installer log file:
/var/log/ovmm/ovm-manager-3-install-2017-12-14-025058.log

Please select an installation type:
1: Install
2: Upgrade
3: Uninstall
4: Help

Select Number (1-4): 1

Starting production with local database installation ...

Ignoring prerequisites check ...

One password is used for all users created and used during the installation.
Enter a password for all logins used during the installation: ##Enter Oracle VM Manager admin password##
Enter a password for all logins used during the installation (confirm): ##Re-enter Oracle VM Manager admin password##

Please enter your fully qualified domain name, e.g. ovs123.us.oracle.com, (or IP address) of your management server for SSL certification generation 10.10.10.151 [ovm.lab.local]:

Verifying configuration ...

Start installing Oracle VM Manager:
1: Continue
2: Abort

Select Number (1-2): 1

Step 1 of 9 : Database Software...
......
......

Please wait while WebLogic configures the applications...
Oracle VM Manager installed.

Installation Summary
--------------------
Database configuration:
Database type : MySQL
Database host name : localhost
Database name : ovs
Database listener port : 49500
Database user : ovs

Weblogic Server configuration:
Administration username : weblogic

Oracle VM Manager configuration:
Username : admin
Core management port : 54321
UUID : 0004fb000001000060c2c1d955c85575

Passwords:
There are no default passwords for any users. The passwords to use for Oracle VM Manager, Database, and Oracle WebLogic Server have been set by you during this installation. In the case of a default install, all passwords are the same.

Oracle VM Manager UI:
https://ovm.lab.local:7002/ovm/console
Log in with the user 'admin', and the password you set during the installation.

Note that you must install the latest ovmcore-console package for your Oracle Linux distribution to gain VNC and serial console access to your Virtual Machines (VMs).
Please refer to the documentation for more information about this package.

For more information about Oracle Virtualization, please visit:
http://www.oracle.com/virtualization/

Oracle VM Manager installation complete.

Step 5: Restore Oracle VM Manager from backup

Before restoring the backup, First we need to stop Oracle VM Manager related services.

[root@ovm ~]# /etc/init.d/ovmcli stop
Stopping Oracle VM Manager CLI [ OK ]
[root@ovm ~]# /etc/init.d/ovmm_mysql stop
Shutting down OVMM MySQL.... SUCCESS!
[root@ovm ~]# /etc/init.d/ovmm stop
Stopping Oracle VM Manager [ OK ]

Before restore the database, we need to make sure that no database files already exist on the Oracle VM Manager host.

[root@ovm ~]# cd /u01/app/oracle/mysql/data/
[root@ovm data]# rm -rf appfw ibdata1 ib_logfile0 ib_logfile1 mysql ovs performance_schema


[root@ovm data]# ls -a
. .. auto.cnf my.cnf .mysqlconfig mysqld.err

Switch to oracle user to start the restore process.

[root@ovm ~]# su - oracle
[oracle@ovm ~]$ bash /u01/app/oracle/ovm-manager-3/ovm_tools/bin/RestoreDatabase.sh ManualBackup-20171217_053626
INFO: Restore area already exist... Cleaning up...
INFO: Expanding the backup image...
INFO: Applying logs to the backup snapshot...
INFO: Restoring the backup...
INFO: Restoring OVM keystores and certificates
INFO: Success - Done!
INFO: Log of operations performed is available at: /u01/app/oracle/mysql/dbbackup/ManualBackup-20171217_053626/Restore.log

IMPORTANT:

As 'root', please start the OVM Manager database and application using:
service ovmm_mysql start; service ovmm start; service ovmcli start

[oracle@ovm ~]$ exit
logout

Start the Oracle VM Manager related services

[root@ovm ~]# /etc/init.d/ovmm_mysql start
Starting OVMM MySQL..... SUCCESS!
[root@ovm ~]# /etc/init.d/ovmm start
Starting Oracle VM Manager [ OK ]
[root@ovm ~]# /etc/init.d/ovmcli start
Starting Oracle VM Manager CLI [ OK ]

Regenerate the Certificate to authenticate the Oracle VM Manager Web Interface and Oracle VM Manager Command Line Interface.

[root@ovm ~]# export MW_HOME=/u01/app/oracle/Middleware
[root@ovm ~]# /u01/app/oracle/ovm-manager-3/ovm_upgrade/bin/ovmkeytool.sh setupWebLogic
libdir is /u01/app/oracle/ovm-manager-3/ovm_upgrade/bin/../lib
Updating keystore information in WebLogic
Oracle MiddleWare Home (MW_HOME): [/u01/app/oracle/Middleware]
WebLogic domain directory: [/u01/app/oracle/ovm-manager-3/domains/ovm_domain]
WebLogic server name: [AdminServer]
WebLogic username: [weblogic]
WebLogic password: [********] ## Enter VM Manager admin password ##
WLST session logged at: /tmp/wlst-session5880304361437212296.log

[root@ovm ~]# /etc/init.d/ovmm restart
Stopping Oracle VM Manager [ OK ]
Starting Oracle VM Manager [ OK ]

Execute client certificate configuration script and restart OVMM daemon

[root@ovm ~]# /u01/app/oracle/ovm-manager-3/bin/configure_client_cert_login.sh

Please enter the OVM Manager username: admin
Please enter the OVM Manager password: ## Enter VM Manager admin password ##

CLASSPATH=/u01/app/oracle/java/lib/tools.jar:/u01/app/oracle/Middleware/wlserver/server/lib/weblogic_sp.jar:/u01/app/oracle/Middleware/wlserver/server/lib/weblogic.jar:/u01/app/oracle/Middleware/wlserver/server/lib/webservices.jar:/u01/app/oracle/Middleware/oracle_common/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/u01/app/oracle/Middleware/oracle_common/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:/u01/app/oracle/Middleware/wlserver/modules/features/oracle.wls.common.nodemanager_1.0.0.0.jar:

PATH=/u01/app/oracle/Middleware/wlserver/server/bin:/u01/app/oracle/Middleware/oracle_common/modules/org.apache.ant_1.7.1/bin:/u01/app/oracle/java/jre/bin:/u01/app/oracle/java/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/u01/app/oracle/Middleware/oracle_common/modules/org.apache.maven_3.0.4/bin

.....
.....

BUILD SUCCESSFUL
Total time: 25 seconds

Client certificate login configuration complete

[root@ovm ~]# /etc/init.d/ovmm restart
Stopping Oracle VM Manager [ OK ]
Starting Oracle VM Manager [ OK ]

How to restore files from Bacula – Part 4


Below command used to restore the files from Bacula Director server

[root@client ~]# bconsole
Connecting to Director mgmtsrv.lguru.local:9101
1000 OK: bacula-dir Version: 5.0.0 (26 January 2010)
Enter a period to cancel a command.
*restore
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"

First you select one or more JobIds that contain files
to be restored. You will be presented several methods
of specifying the JobIds. Then you will be allowed to
select which files from those JobIds are to be restored.

To select the JobIds, you have the following choices:
1: List last 20 Jobs run
2: List Jobs where a given File is saved
3: Enter list of comma separated JobIds to select
4: Enter SQL list command
5: Select the most recent backup for a client
6: Select backup for a client before a specified time
7: Enter a list of files to restore
8: Enter a list of files to restore before a specified time
9: Find the JobIds of the most recent backup for a client
10: Find the JobIds for a backup for a client before a specified time
11: Enter a list of directories to restore for found JobIds
12: Select full restore to a specified Job date
13: Cancel
Select item: (1-13): 5
Automatically selected Client: bacula-fd
Automatically selected FileSet: Full Set
+-------+-------+----------+----------+---------------------+-----------------+
| JobId | Level | JobFiles | JobBytes | StartTime | VolumeName |
+-------+-------+----------+----------+---------------------+-----------------+
| 1 | F | 4 | 909 | 2017-09-13 03:29:53 | Vol-20170913 |
+-------+-------+----------+----------+---------------------+-----------------+
You have selected the following JobIds: 1

Building directory tree for JobId(s) 1 ...
3 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: /
$ ls
opt/
$ mark opt
4 files marked.
$ lsmark
*opt/
*group
*passwd
*shadow
$ done
Bootstrap records written to /var/spool/bacula/bacula-dir.restore.1.bsr

The job will require the following
Volume(s) Storage(s) SD Device(s)
===========================================================================

Vol-20170913 File FileStorage

Volumes marked with "*" are online.

4 files selected to be restored.

Run Restore job
JobName: RestoreFiles
Bootstrap: /var/spool/bacula/bacula-dir.restore.1.bsr
Where: /tmp/bacula-restores
Replace: always
FileSet: Full Set
Backup Client: bacula-fd
Restore Client: bacula-fd
Storage: File
When: 2017-09-13 03:36:05
Catalog: MyCatalog
Priority: 10
Plugin Options: *None*
OK to run? (yes/mod/no): yes
Job queued. JobId=3
*
13-Sep 03:36 bacula-dir JobId 2: Start Restore Job RestoreFiles.2017-09-13_03.36.08_07
13-Sep 03:36 bacula-dir JobId 2: Using Device "FileStorage"
13-Sep 03:36 bacula-sd JobId 2: Ready to read from volume "Vol-20170913" on device "FileStorage" (/tmp).
13-Sep 03:36 bacula-sd JobId 2: Forward spacing Volume "Vol-20170913" to file:block 0:692.
13-Sep 03:36 bacula-sd JobId 2: End of Volume at file 0 on device "FileStorage" (/tmp), Volume "Vol-20170913"
13-Sep 03:36 bacula-sd JobId 2: End of all volumes.
13-Sep 03:36 bacula-dir JobId 2: Bacula bacula-dir 5.0.0 (26Jan10): 13-Sep-2017 03:36:10
Build OS: x86_64-redhat-linux-gnu redhat
JobId: 2
Job: RestoreFiles.2017-09-13_03.36.08_07
Restore Client: bacula-fd
Start time: 13-Sep-2017 03:36:10
End time: 13-Sep-2017 03:36:10
Files Expected: 4
Files Restored: 4
Bytes Restored: 1,994
Rate: 0.0 KB/s
FD Errors: 0
FD termination status: OK
SD termination status: OK
Termination: Restore OK

13-Sep 03:36 bacula-dir JobId 2: Begin pruning Jobs older than 47 years 2 months 27 days 7 hours 36 mins 10 secs.
13-Sep 03:36 bacula-dir JobId 2: No Jobs found to prune.
13-Sep 03:36 bacula-dir JobId 2: Begin pruning Jobs.
13-Sep 03:36 bacula-dir JobId 2: No Files found to prune.
13-Sep 03:36 bacula-dir JobId 2: End auto prune.

*exit

Now we have successfully restored the files from Director Server to client machine in below path.

[root@client ~]# ls -l /tmp/bacula-restores/opt/
total 12
-rw-r--r-- 1 root root 456 Sep 13 03:18 group
-rw-r--r-- 1 root root 924 Sep 13 03:18 passwd
---------- 1 root root 614 Sep 13 03:18 shadow

Take Backup of remote machine- Part 3


In previous two post we have seen how to setup bacula backup server and client agent. Now it’s time to take the backup of remote linux machine from Bacula Director server.

[root@mgmtsrv ~]# bconsole
Connecting to Director mgmtsrv.lguru.local:9101
1000 OK: bacula-dir Version: 5.0.0 (26 January 2010)
Enter a period to cancel a command.
*label
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
Automatically selected Storage: File
Enter new Volume name: Vol-20170913
Defined Pools:
1: Default
2: File
3: Scratch
Select the Pool (1-3): 2
Connecting to Storage daemon File at mgmtsrv.lguru.local:9103 ...
Sending label command for Volume "Vol-20170913" Slot 0 ...
3000 OK label. VolBytes=208 DVD=0 Volume="Vol-20170913" Device="FileStorage" (/tmp)
Catalog record for Volume "Vol-20170913", Slot 0 successfully created.
Requesting to mount FileStorage ...
3906 File device "FileStorage" (/tmp) is always mounted.
*run
A job name must be specified.
The defined Job resources are:
1: BackupClient1
2: BackupCatalog
3: RestoreFiles
Select Job resource (1-3): 1
Run Backup job
JobName: BackupClient1
Level: Incremental
Client: bacula-fd
FileSet: Full Set
Pool: File (From Job resource)
Storage: File (From Job resource)
When: 2017-09-13 03:29:48
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=1
*
13-Sep 03:29 bacula-dir JobId 1: Start Backup JobId 1, Job=BackupClient1.2017-09-13_03.29.51_05
13-Sep 03:29 bacula-dir JobId 1: Using Device "FileStorage"
13-Sep 03:19 bacula-fd JobId 1: Warning: DIR and FD clocks differ by -601 seconds, FD automatically compensating.
13-Sep 03:29 bacula-sd JobId 1: Volume "Client-20170917" previously written, moving to end of data.
13-Sep 03:29 bacula-sd JobId 1: Ready to append to end of Volume "Vol-20170913" size=692
13-Sep 03:29 bacula-sd JobId 1: Job write elapsed time = 00:00:01, Transfer rate = 1.247 K Bytes/second
13-Sep 03:29 bacula-dir JobId 1: Bacula bacula-dir 5.0.0 (26Jan10): 13-Sep-2017 03:29:53
Build OS: x86_64-redhat-linux-gnu redhat
JobId: 1
Job: BackupClient1.2017-09-13_03.29.51_05
Backup Level: Incremental, since=2017-09-13 03:25:16
Client: "bacula-fd" 5.0.0 (26Jan10) x86_64-redhat-linux-gnu,redhat,
FileSet: "Full Set" 2017-09-13 03:25:13
Pool: "File" (From Job resource)
Catalog: "MyCatalog" (From Client resource)
Storage: "File" (From Job resource)
Scheduled time: 13-Sep-2017 03:29:48
Start time: 13-Sep-2017 03:29:53
End time: 13-Sep-2017 03:29:53
Elapsed time: 0 secs
Priority: 10
FD Files Written: 4
SD Files Written: 4
FD Bytes Written: 909 (909 B)
SD Bytes Written: 1,247 (1.247 KB)
Rate: 0.0 KB/s
Software Compression: 54.4 %
VSS: no
Encryption: no
Accurate: no
Volume name(s): Vol-20170913
Volume Session Id: 2
Volume Session Time: 1505287395
Last Volume Bytes: 2,459 (2.459 KB)
Non-fatal FD errors: 0
SD Errors: 0
FD termination status: OK
SD termination status: OK
Termination: Backup OK


13-Sep 03:29 bacula-dir JobId 1: Begin pruning Jobs older than 47 years 2 months 27 days 7 hours 29 mins 53 secs.
13-Sep 03:29 bacula-dir JobId 1: No Jobs found to prune.
13-Sep 03:29 bacula-dir JobId 1: Begin pruning Jobs.
13-Sep 03:29 bacula-dir JobId 1: No Files found to prune.
13-Sep 03:29 bYou have new mail in /var/spool/mail/root
*exit

[root@mgmtsrv ~]# ls -l /tmp/Vol-*
-rw-r----- 1 root root 208 Sep 13 03:29 /tmp/Vol-20170913