
Bareosã䜿çšããããã¯ã¢ãããªãã·ã§ã³ã«é¢ããäžé£ã®åºçç©ãç¶ç¶ããŠããŸãã ãã®èšäºã§ã¯ãBareosã䜿çšããVM ESXiã®ããã¯ã¢ããã«ã€ããŠèª¬æããŸãã
以åã®æçš¿ïŒ
ããªãŒãã³ãœãŒã¹ãœãªã¥ãŒã·ã§ã³ã䜿çšããããã¯ã¢ãã-Bareosãä»®æ³ãã·ã³ãããã¯ã¢ããããããã«ãVMware ESXiã¯å€ãã®å ŽåãVeeamãghettovcbã¹ã¯ãªãããªã©ã®ããŒã«ã䜿çšããŸãã ãã®èšäºã§ã¯ãBareos 16.2ã䜿çšããŠä»®æ³ãã·ã³ãããã¯ã¢ããããæ¹æ³ãæ€èšããŸããã€ãŸããBareosã®æ©èœãæ¡åŒµã§ãããã©ã°ã€ã³ã®1ã€ã§ããvmware-pluginã䜿çšããŸãã 16çªç®ã®ããŒãžã§ã³ã§ã¯ãæ§æãã¡ã€ã«ã®å Žæãå€æŽãããåãªãœãŒã¹ïŒããŒã«ãã¯ã©ã€ã¢ã³ãããžã§ããªã©ïŒãç¬èªã®ãã£ã¬ã¯ããªã«åæ£ãããWeb UIã®å€èšèªæ§ãè¿œå ãããMySQLãã©ã°ã€ã³ãæ¹åããããã詳现ãªããã¥ã¡ã³ãã
ããã§è¡šç€ºã§ã
ãŸã ã
ãã®äŸã§ã¯ãESXi 6.0ïŒãã©ã°ã€ã³ãæ©èœããã«ã¯è©äŸ¡ã©ã€ã»ã³ã¹ã§ååã§ãïŒãšãBareosãã€ã³ã¹ããŒã«ãããCentOS 7ã®ãµãŒããŒããããŸãã
ãªããžããªãè¿œå ããŸãã
wget http://download.bareos.org/bareos/release/16.2/CentOS_7/bareos.repo -O /etc/yum.repos.d/bareos.repo
å¿
èŠãªã³ã³ããŒãã³ããã€ã³ã¹ããŒã«ããŸãã
yum install -y bareos-client bareos-database-tools bareos-filedaemon bareos-database-postgresql bareos bareos-bconsole bareos-database-common bareos-storage bareos-director bareos-common
ããŒã¿ããŒã¹ãã€ã³ã¹ããŒã«ããŸãã
yum install -y postgresql-server postgresql-contrib
ã€ã³ã¹ããŒã«åŸã次ãå®è¡ããŸãã
# postgresql-setup initdb
Bareosãšå
±ã«ã€ã³ã¹ããŒã«ãããããŒã¿ããŒã¹æºåã¹ã¯ãªãããå®è¡ããŸãã
su postgres -c /usr/lib/bareos/scripts/create_bareos_database su postgres -c /usr/lib/bareos/scripts/make_bareos_tables su postgres -c /usr/lib/bareos/scripts/grant_bareos_privileges
ã€ã³ã¹ããŒã«ã®è©³çŽ°ãšã³ã³ããŒãã³ãã®èª¬æãããã³äž»èŠãªãã£ã¬ã¯ãã£ãã®èª¬æã¯ã
ããã«ãããŸããããŒãžã§ã³16ã®ãã£ã¬ã¯ããªã®ãªã¹ãã¯æ¬¡ã®ããã«ãªããŸãã /bareos-dir-export /bareos-dir.d /catalog /client /console /counter /director /fileset /job /jobdefs /messages /pool /profile /schedule /storage /bareos-fd.d /client /director /messages /bareos-sd.d /autochanger /device /director /messages /ndmp /storage /tray-monitor.d /client /director /storage bconsole.conf
åãµããã£ã¬ã¯ããªã«ã¯ããã£ã¬ã¯ããªã®ååã«å¯Ÿå¿ãããªãœãŒã¹ãæ
åœããç¬èªã®æ§æãã¡ã€ã«ããããŸãã
èšå®ãè¡ãåã«ãVMwareãã©ã°ã€ã³ã®åäœã«é¢ãããã¹ãŠã®èŠä»¶ãæºããããŠããããšã確èªããå¿
èŠããããŸãã èŠä»¶ã®å
¬åŒãªã¹ãã¯ã
ããã§è¡šç€ºã§ã
ãŸã ã
ãã©ã°ã€ã³ãã€ã³ã¹ããŒã«ããåã«ããã¹ãŠã®äŸåé¢ä¿ãã€ã³ã¹ããŒã«ããå¿
èŠããããŸã
EPELãªããžããªã®1ã€ã次ã®ããã«è¿œå ããŸã ããã«ã€ã³ã¹ããŒã«ããããã«ããã€ãã®ããã±ãŒãžãå¿
èŠã«ãªããŸãã
rpm -ivh yum install python yum install python-pip yum install python-wheel pip install --upgrade pip pip install pyvmomi yum install python-pyvmomi : yum install bareos-vmware-plugin
åææ¡ä»¶ã¯ãESXiäžã®VMãCBTïŒå€æŽãããã¯è¿œè·¡ïŒããµããŒãããã³æå¹ã«ããããšã§ãã VMware Webãµã€ãã§ã¯ããã®ãªãã·ã§ã³ãæå¹ã«ããæ¹æ³ã瀺ãããŠããŸãããããç°¡åãªæ¹æ³-ã¹ã¯ãªããã䜿çšããæ¹æ³ããããŸãã ã¹ã¯ãªããèªäœã¯vmware_cbt_toolãšåŒã°ããGitHubã§å
¥æã§ããŸãã
BareOSãµãŒããŒã«ããŠã³ããŒãããã¹ã¯ãªãããã£ã¬ã¯ããªã«ç§»åããåŸã次ãå®è¡ããå¿
èŠããããŸãã
./vmware_cbt_tool.py -s 172.17.10.1 -u bakuser -p kJo@
ãªãã·ã§ã³ã§ïŒ
-s-ãµãŒããŒã¢ãã¬ã¹
-u-ESXiã®ãŠãŒã¶ãŒïŒç¹å¥ã«ãŠãŒã¶ãŒbakuserãå°å
¥ïŒ
-pã¯åœŒã®ãã¹ã¯ãŒãã§ã
-dã¯ESXiã®ãããŒã¿ã»ã³ã¿ãŒãã®ååã§ãããã©ã«ãã§ã¯ãha-datacenterã
-f-VMããããã©ã«ããŒãããã©ã«ãã§ã¯ã«ãŒã
-vã¯VMèªäœã®ååã§ã
--info-VMã®çŸåšã®CBTèšå®ã衚瀺ããŸã

ã³ãã³ããå®è¡ãããšã以äžã衚瀺ãããŸãã
INFO: VM ubuntu CBT supported: True INFO: VM ubuntu CBT enabled: False
ã€ãŸããCBTã¯ãµããŒããããŠããŸãããçŸåšæå¹åãããŠããªããããã³ãã³ãã®æåŸã«--enablecbtãªãã·ã§ã³ãè¿œå ããŠåãã¹ã¯ãªããã§æå¹ã«ããŸã
./vmware_cbt_tool.py -s 172.17.10.1 -u bakuser -p kJo@
ãã®çµæã次ã®ããã«è¡šç€ºãããŸãã
INFO: VM ubuntu CBT supported: True INFO: VM ubuntu CBT enabled: False INFO: VM ubuntu trying to enable CBT now INFO: VM ubuntu trying to create and remove a snapshot to activate CBT INFO: VM ubuntu successfully created and removed snapshot
CBTã¯æ£åžžã«æå¹åãããŸããã
ããã§ãBareOSèªäœã®èšå®ã«ç§»åããå¿
èŠããããŸãããŸããå
¬åŒããã¥ã¡ã³ããåç
§ããããšãã§ããŸãã
æ§æã®å
容ã¯æ¬¡ã®ãšããã§ãã
/etc/bareos/bareos-dir.d/client/bareos-fd.conf Client { Name = vmware # localhost Address = localhost Password = "wai2Aux0" } /etc/bareos/bareos-dir.d/director/bareos-dir.conf Director { Name = "bareos-dir" QueryFile = "/usr/lib/bareos/scripts/query.sql" Maximum Concurrent Jobs = 10 Password = "wai2Aux0" Messages = Standard Auditing = yes }
ãã®äŸã®æ¬¡ã®ãã¡ã€ã«ã¯ãæãéèŠãªãã¡ã€ã«ã®1ã€ã§ãã ãã©ã°ã€ã³ã®ãªãã·ã§ã³ãæå®ããŸã
/etc/bareos/bareos-dir.d/fileset/SelfTest.conf FileSet { Name = "vm-ubuntu" Include { Options { signature = MD5 Compression = GZIP } Plugin = "python:module_path=/usr/lib64/bareos/plugins/vmware_plugin:module_name=bareos-fd-vmware:dc=ha-datacenter:folder=/:vmname=ubuntu:vcserver=172.17.10.1:vcuser=bakuser:vcpass=kJo@#!a" } }
pythonïŒmodule_path = / usr / lib64 / bareos / plugins / vmware_plugin-ãã©ã°ã€ã³ã®å Žæã瀺ããŸã
module_name = bareos-fd-vmware-ãã®ååãæå®
dc-ESXiã®ããŒã¿ã»ã³ã¿ãŒå
folder-VMã®ãããã©ã«ããŒãããã©ã«ãã§ã¯root
vmname-ä»®æ³ãã·ã³å
vcserver-ãµãŒããŒã¢ãã¬ã¹
vcuser-ããã¯ã¢ããã䜿çšããããã«ç¹å¥ã«èšå®ããããŠãŒã¶ãŒãã°ã€ã³
vcpass-圌ã®ãã¹ã¯ãŒã
ããã¯ã¢ããã®ãžã§ãã®èª¬æïŒ /etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf Job { Name = "vm-ubuntu-backup-job" JobDefs = "DefaultJob" Client = "vmware" } /etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf JobDefs { Name = "DefaultJob" Type = Backup Level = Incremental FileSet = "vm-ubuntu" Schedule = "WeeklyCycle" Storage = bareos-sd Messages = Standard Pool = Incremental Priority = 10 Write Bootstrap = "/var/lib/bareos/%c.bsr" Full Backup Pool = Full Differential Backup Pool = Differential Incremental Backup Pool = Incremental }
ãªã«ããªãŒã®ãžã§ãèšè¿°ïŒ
/etc/bareos/bareos-dir.d/job/RestoreFiles.conf Job { Name = "RestoreFiles" Type = Restore Client = vmware FileSet = "vm-ubuntu" Storage = bareos-sd Pool = Incremental Messages = Standard Where = /tmp/ }
ã¢ã©ãŒãèšå®ïŒ
/etc/bareos/bareos-dir.d/messages/Standard.conf Messages { Name = Standard # email mailcommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" operator = root@localhost = mount # mail = admin@testdomain.com = alert,error,fatal,terminate, !skipped # console = all, !skipped, !saved # , , .. append = "/var/log/bareos/bareos.log" = all, !skipped # catalog = all }
å°çããæçŽã®çš®é¡ã¯ãããããããããããã«åŸã§è¡šç€ºãããŸãã
ããŒã«ã®èª¬æïŒ
/etc/bareos/bareos-dir.d/pool/Full.conf Pool { Name = Full Pool Type = Backup Recycle = yes AutoPrune = yes Volume Retention = 365 days Maximum Volume Bytes = 50G Maximum Volumes = 100 Label Format = "Full-" } /etc/bareos/bareos-dir.d/pool/Incremental.conf Pool { Name = Incremental Pool Type = Backup Recycle = yes AutoPrune = yes Volume Retention = 30 days Maximum Volume Bytes = 1G Maximum Volumes = 100 Label Format = "Incremental-" }
å·®åããŒã«ã®äŸã¯ç€ºããŸããããªããªãã JobDefsã§æå®ãããŠããŸããã䜿çšããŸããã
ã¹ã±ãžã¥ãŒã«èšå®ïŒ
/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf Schedule { Name = "WeeklyCycle" # 21:00 Run = Full on 1 at 21:00 # 31 Run = Full 2-31 at 01:00 # 2 31 10,15 19:00 Run = Incremental on 2-31 at 10:00 Run = Incremental on 2-31 at 15:00 Run = Incremental on 2-31 at 19:00 }
ãµã€ããžã®æ¥ç¶ã®èª¬æïŒ
/etc/bareos/bareos-dir.d/storage/File.conf Storage { Name = bareos-sd Address = localhost Password = "wai2Aux0" Device = FileStorage Media Type = File }
ããŒãžèªäœã®èšå®ïŒ
/etc/bareos/bareos-sd.d/device/FileStorage.conf Device { Name = FileStorage Media Type = File Archive Device = /opt/backup LabelMedia = yes; Random Access = yes; AutomaticMount = yes; RemovableMedia = no; AlwaysOpen = no; }
ããŒãããã£ã¬ã¯ã¿ãŒã«æ¥ç¶ããããã®ãã©ã¡ãŒã¿ãŒïŒ
/etc/bareos/bareos-sd.d/director/bareos-dir.conf Director { Name = bareos-dir Password = "wai2Aux0" }
䜿çšãããéç¥ãã©ã¡ãŒã¿ãŒïŒ
/etc/bareos/bareos-sd.d/messages/Standard.conf Messages { Name = Standard Director = bareos-dir = all } /etc/bareos/bareos-sd.d/storage/bareos-sd.conf Storage { Name = bareos-sd Maximum Concurrent Jobs = 20 }
ãµãŒããŒåŽã§ãã©ã°ã€ã³ãæ¥ç¶ããããšã絶察ã«å¿
èŠã§ããããã¯æ¬¡ã®æ§æã§è¡ãããŸãã
/etc/bareos/bareos-fd.d/client/myself.conf Client { Name = vmware Maximum Concurrent Jobs = 20 # Plugin Directory = /usr/lib64/bareos/plugins Plugin Names = "python" }
ãã£ã¬ã¯ã¿ãŒãžã®æ¥ç¶ïŒ
/etc/bareos/bareos-fd.d/director/bareos-dir.conf Director { Name = bareos-dir Password = "wai2Aux0" }
ãã£ã¬ã¯ã¿ãŒã«éä¿¡ãããéç¥ã®ã¿ã€ãïŒ
/etc/bareos/bareos-fd.d/messages/Standard.conf Messages { Name = Standard Director = bareos-dir = all, !skipped, !restored }
匷å¶çãªæåããã¯ã¢ãããå®è¡ãããŸãããã®ãããbconsoleãå
¥åããŸã
*run Automatically selected Catalog: MyCatalog Using Catalog "MyCatalog" A job name must be specified. The defined Job resources are: 1: RestoreFiles 2: vm-ubuntu-backup-job Select Job resource (1-2): 2 Run Backup job JobName: vm-ubuntu-backup-job Level: Incremental Client: vmware Format: Native FileSet: vm-ubuntu Pool: Incremental (From Job IncPool override) Storage: bareos-sd (From Job resource) When: 2016-11-14 07:22:11 Priority: 10 OK to run? (yes/mod/no): yes
ã¡ãã»ãŒãžã³ãã³ãã䜿çšãããšãã¿ã¹ã¯ã§äœãèµ·ãã£ãŠãããã確èªã§ããããã»ã¹ãæ£åžžã«éå§ãããããšãããããŸãã
14-Nov 07:22 vmware JobId 66: python-fd: Starting backup of /VMS/ha-datacenter/ubuntu/[datastore1] ubuntu/ubuntu.vmdk_cbt.json 14-Nov 07:22 vmware JobId 66: python-fd: Starting backup of /VMS/ha-datacenter/ubuntu/[datastore1] ubuntu/ubuntu.vmdk
ESXiåŽã§ã®ã¿ã¹ã¯ã®å®è¡äžã«ãä»®æ³ãã·ã³ã®ãã£ã¹ã¯ã«ã¢ã¯ã»ã¹ããŠããããšã瀺ãã¡ãã»ãŒãžåºåã³ã³ãœãŒã«ã«å¯Ÿå¿ããéç¥ã衚瀺ãããæåŸã«äžæã¹ãããã·ã§ãããåé€ãããããšã確èªã§ããŸãã

çä¿¡ã¡ãã»ãŒãžã¯æ¬¡ã®ããã«ãªããŸãã 13-Nov 22:47 bareos-dir JobId 36: No prior Full backup Job record found. 13-Nov 22:47 bareos-dir JobId 36: No prior or suitable Full backup found in catalog. Doing FULL backup. 13-Nov 22:47 bareos-dir JobId 36: Start Backup JobId 36, Job=vm-ubuntu-backup-job.2016-11-13_22.47.47_04 13-Nov 22:47 bareos-dir JobId 36: Using Device "FileStorage" to write. 13-Nov 22:47 bareos-sd JobId 36: Volume "Full-0001" previously written, moving to end of data. 13-Nov 22:47 bareos-sd JobId 36: Ready to append to end of Volume "Full-0001" size=583849836 13-Nov 22:47 vmware JobId 36: python-fd: Starting backup of /VMS/ha-datacenter/ubuntu/[datastore1] ubuntu/ubuntu.vmdk_cbt.json 13-Nov 22:47 vmware JobId 36: python-fd: Starting backup of /VMS/ha-datacenter/ubuntu/[datastore1] ubuntu/ubuntu.vmdk 13-Nov 22:51 bareos-sd JobId 36: Elapsed time=00:04:01, Transfer rate=2.072 M Bytes/second 13-Nov 22:51 bareos-dir JobId 36: Bareos bareos-dir 16.2.4 (01Jul16): Build OS: x86_64-redhat-linux-gnu redhat CentOS Linux release 7.0.1406 (Core) JobId: 36 Job: vm-ubuntu-backup-job.2016-11-13_22.47.47_04 Backup Level: Full (upgraded from Incremental) Client: "vmware" 16.2.4 (01Jul16) x86_64-redhat-linux-gnu,redhat,CentOS Linux release 7.0.1406 (Core) ,CentOS_7,x86_64 FileSet: "vm-ubuntu" 2016-11-13 22:47:47 Pool: "Full" (From Job FullPool override) Catalog: "MyCatalog" (From Client resource) Storage: "bareos-sd" (From Job resource) Scheduled time: 13-Nov-2016 22:47:45 Start time: 13-Nov-2016 22:47:50 End time: 13-Nov-2016 22:51:51 Elapsed time: 4 mins 1 sec Priority: 10 FD Files Written: 2 SD Files Written: 2 FD Bytes Written: 499,525,599 (499.5 MB) SD Bytes Written: 499,527,168 (499.5 MB) Rate: 2072.7 KB/s Software Compression: 73.1 % (gzip) VSS: no Encryption: no Accurate: no Volume name(s): Full-0001 Volume Session Id: 9 Volume Session Time: 1479067525 Last Volume Bytes: 1,083,996,610 (1.083 GB) Non-fatal FD errors: 0 SD Errors: 0 FD termination status: OK SD termination status: OK Termination: Backup OK
ã芧ã®ãšãããããã¯ã¢ãããæ£åžžã«å®äºããããšã瀺ãã¡ãã»ãŒãžã衚瀺ãããŸããããã¯ã¢ããã¿ã€ãã¯ãã«ã§ã499.5 Mbãèšé²ãããŸããïŒESXiåŽã§ã¯vmdkãã¡ã€ã«ã560 Mãå æããŸãïŒã FileSetèšå®ã§ã¯ãgzipå§çž®ã¿ã€ããèšå®ããŸãããã®ã¡ãã»ãŒãžã§ã¯ãSoftware Compressionè¡ã«ã衚瀺ãããŸãã
ãšã©ãŒã¡ãã»ãŒãžã¯æ¬¡ã®ããã«ãªããŸãã ãã®äŸã§ã¯ãã芧ã®ãšãããVMã®CBTã¢ãŒããã¢ã¯ãã£ãã«ããŠããªãå Žåã«ãšã©ãŒãã·ãã¥ã¬ãŒããããŸãããããã¯ãåã®æé ã§ç¹å¥ãªã¹ã¯ãªããã䜿çšããŠãªã³ã«ãããã®ã§ãã
å±éãã 14-Nov 01:17 vmware JobId 39: Fatal error: python-fd: Error VM VMBitrix5.1.8 is not CBT enabled 14-Nov 01:17 vmware JobId 39: Fatal error: fd_plugins.c:654 Command plugin "python:module_path=/usr/lib64/bareos/plugins/vmware_plugin:module_name=bareos-fd-vmware:dc=ha-datacenter:folder=/:vmname=VMBitrix5.1.8:vcserver=172.17.10.1:vcuser=bakuser:vcpass=kJo@#!a" requested, but is not loaded. 14-Nov 01:17 bareos-dir JobId 39: Error: Bareos bareos-dir 16.2.4 (01Jul16): Build OS: x86_64-redhat-linux-gnu redhat CentOS Linux release 7.0.1406 (Core) JobId: 39 Job: vm-bitrix-backup-job.2016-11-14_01.17.51_04 Backup Level: Full (upgraded from Incremental) Client: "vmware" 16.2.4 (01Jul16) x86_64-redhat-linux-gnu,redhat,CentOS Linux release 7.0.1406 (Core) ,CentOS_7,x86_64 FileSet: "vm-bitrix-fileset" 2016-11-14 01:17:51 Pool: "vm-bitrix-Full" (From Job FullPool override) Catalog: "MyCatalog" (From Client resource) Storage: "bareos-sd" (From Job resource) Scheduled time: 14-Nov-2016 01:17:47 Start time: 14-Nov-2016 01:17:53 End time: 14-Nov-2016 01:17:54 Elapsed time: 1 sec Priority: 10 FD Files Written: 0 SD Files Written: 0 FD Bytes Written: 0 (0 B) SD Bytes Written: 0 (0 B) Rate: 0.0 KB/s Software Compression: None VSS: no Encryption: no Accurate: no Volume name(s): Volume Session Id: 12 Volume Session Time: 1479067525 Last Volume Bytes: 0 (0 B) Non-fatal FD errors: 1 SD Errors: 0 FD termination status: Fatal Error SD termination status: Canceled Termination: *** Backup Error ***
ã¹ã±ãžã¥ãŒã«ã«åŸã£ãŠããã£ã¬ã¯ã¿ãŒã®Schedule {}ãã£ã¬ã¯ãã£ãã§ã1æ¥ã®ãã¡ã«3åã®å¢åããã¯ã¢ãããå®è¡ãããŸããïŒãã«ãªã¹ãã®æåŸã®ããã¯ã¢ããã¯æåã§è¡ãããŸããïŒã bconsoleã§ã¯ããstatus dirãã³ãã³ãã䜿çšããŠãå¢åããã¯ã¢ããã®ãµã€ãºãå®å
šããã¯ã¢ãããšã©ãã ãç°ãªããã確èªã§ããŸãã

ãªã«ããªã«é¢ããŠã¯ãESXiãæèŒãããã¹ãã§ããã©ã«ãã§å®è¡ãããŸããããã®ããã«ã¯ä»®æ³ãã·ã³èªäœããªãã«ããå¿
èŠããããŸãã ãŸãã¯ãBareOSã䜿çšããŠãµãŒããŒã§ãªã«ããªãå®è¡ã§ããŸãã äž¡æ¹ã®ãªãã·ã§ã³ãæ€èšããŠãã ããã
BareOSã䜿çšããŠãµãŒããŒã«ããŒã«ã«ã§ãªã«ããªããå Žåã bconsoleã«ç§»åããŸãã *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): 3 Enter JobId(s), comma separated, to restore: 66 Building directory tree for JobId(s) 66 ... 1 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 VMS/ $ mark * 1 file marked. $ done Defined Clients: 1: vmware ... Select the Client (1-4): 1 Using Catalog "MyCatalog" Client "bareos-fd" not found. Automatically selected Client: vmware Restore Client "bareos-fd" not found. Automatically selected Client: vmware Run Restore job JobName: RestoreFiles Bootstrap: /var/lib/bareos/bareos-dir.restore.1.bsr Where: /tmp/ Replace: Always FileSet: vm-ubuntu Backup Client: bareos-fd Restore Client: vmware Format: Native Storage: bareos-sd When: 2016-11-14 07:37:57 Catalog: MyCatalog Priority: 10 Plugin Options: *None* OK to run? (yes/mod/no): mod Parameters to modify: 1: Level 2: Storage 3: Job 4: FileSet 5: Restore Client 6: Backup Format 7: When 8: Priority 9: Bootstrap 10: Where 11: File Relocation 12: Replace 13: JobId 14: Plugin Options Select parameter to modify (1-14): 14 Please enter Plugin Options string: python:localvmdk=yes Run Restore job JobName: RestoreFiles Bootstrap: /var/lib/bareos/bareos-dir.restore.1.bsr Where: /tmp/ Replace: Always FileSet: vm-ubuntu Backup Client: vmware Restore Client: vmware Format: Native Storage: bareos-sd When: 2016-11-14 07:37:57 Catalog: MyCatalog Priority: 10 Plugin Options: python:localvmdk=yes OK to run? (yes/mod/no): yes
ãã®åŸã/ tmpãã©ã«ããŒã«ç§»åããŠã埩å
ãããvmdkãã¡ã€ã«ã確èªã§ããŸãã
cd /tmp/" [datastore1] ubuntu" ls ubuntu.vmdk
ESXiã«ããã«åŸ©å
ããå Žåã埩å
ãå®è¡ããåã«å€æŽãå ããå¿
èŠã¯ãããŸããããåè¿°ã®ãšããããšã©ãŒãçºçããåã«ä»®æ³ãã·ã³ããªãã«ããå¿
èŠããããŸãã
JobId 80: Fatal error: python-fd: Error VM VMBitrix5.1.8 must be poweredOff for restore, but is poweredOn
ãã¹ããšããŠãä»®æ³ãã·ã³ã«ããã€ãã®ãã¹ããã¡ã€ã«ãäœæããããã¯ã¢ããã§ãžã§ããå®è¡ããã ãã§ååã§ãã ãããã®ãã¡ã€ã«ãåé€ãããã·ã³ã®é»æºãåããåã®äŸã®ããã«å€æŽãå ããã«åŸ©å
ã³ãã³ãã§åŸ©å
ããŸããååãšããŠãåé€ããããã¡ã€ã«ã¯åãå Žæã«ãããŸãã
次ã«ãå¥ã®VMã®ããã¯ã¢ãããè¿œå ããããšãæ€èšããŠãã ããããã®ååã¯ãVMBitrix5.1.8ãã§ã
éèŠïŒ ãŸãã/ etc / bareos / bareos-dir.d / director / bareos-dir.confãã¡ã€ã«ã®directorã®èšå®ã§ãVMwareãæäœããããã«ãã©ã°ã€ã³ãæ¥ç¶ããå¿
èŠããããŸããããããªããšãVMããã¯ã¢ããã®è¿œå ã¿ã¹ã¯ãæ¥ç¶ãããšãã«ããã©ã°ã€ã³ãããŒããããªããšãããšã©ãŒã衚瀺ãããŸãïŒ
äŸïŒ JobId 41: Fatal error: fd_plugins.c:654 Command plugin "python:module_path=/usr/lib64/bareos/plugins/vmware_plugin:module_name=bareos-fd-vmware:dc=ha-datacenter:folder=/:vmname=" requested, but is not loaded
ãã¡ã€ã«/etc/bareos/bareos-dir.d/director/bareos-dir.confã¯æ¬¡ã®ããã«ãªããŸãã
Director { # define myself Name = "bareos-dir" QueryFile = "/usr/lib/bareos/scripts/query.sql" Maximum Concurrent Jobs = 10 Password = "wai2Aux0" # Console password Messages = Standard Auditing = yes Plugin Directory = /usr/lib64/bareos/plugins Plugin Names = "python" }
以äžã®è¡ãèŠãŠããã©ã°ã€ã³æ¥ç¶ãå®äºããããã«ïŒ
Plugin Directory = /usr/lib64/bareos/plugins Plugin Names = "python"
次ã«ã2çªç®ã®ä»®æ³ãã·ã³ã®ããã¯ã¢ããçšã«FileSetãã£ã¬ã¯ãã£ã{}ãç·šéããŸã
/etc/bareos/bareos-dir.d/fileset/SelfTest.conf
VMBitrix5.1.8ä»®æ³ãã·ã³ã®ããã¯ã¢ããçšã«æ°ããè¡ãè¿œå ãããšããã¡ã€ã«ã¯æ¬¡ã®ããã«ãªããŸãã FileSet { Name = "vm-ubuntu" Include { Options { signature = MD5 Compression = GZIP } Plugin = "python:module_path=/usr/lib64/bareos/plugins/vmware_plugin:module_name=bareos-fd-vmware:dc=ha-datacenter:folder=/:vmname=ubuntu:vcserver=172.17.10.1:vcuser=bakuser:vcpass=qLpE1QQv" } } FileSet { Name = "vm-bitrix" Include { Options { signature = MD5 Compression = GZIP } Plugin = "python:module_path=/usr/lib64/bareos/plugins/vmware_plugin:module_name=bareos-fd-vmware:dc=ha-datacenter:folder=/:vmname=VMBitrix5.1.8:vcserver=172.17.10.1:vcuser=bakuser:vcpass=kJo@#!a" } }
æ°ããVMã®ããã¯ã¢ããçšã®æ°ãããžã§ãã®è¿œå ã«é²ã¿ã/ etc / bareos / bareos-dir.d / jobãã£ã¬ã¯ããªã«backup-bareos-bitrix.confãã¡ã€ã«ãäœæããŸãã ãã®ãã¡ã€ã«ã§ã¯ãæ°ãããžã§ãã®ãã©ã¡ãŒã¿ãŒãäœæããŸãïŒäœæããããã¹ãŠã®ãã¡ã€ã«ã®ã°ã«ãŒããšææè
ã¯ãbareosãã§ããå¿
èŠããããŸãïŒã
Job { Name = "vm-bitrix-backup-job" Client = "vmware" Type = Backup Level = Incremental FileSet = "vm-bitrix" Schedule = "WeeklyCycle" Storage = bareos-sd Messages = Standard Pool = vm-bitrix-Incremental Priority = 10 Write Bootstrap = "/var/lib/bareos/%c.bsr" Full Backup Pool = vm-bitrix-Full Incremental Backup Pool = vm-bitrix-Incremental }
2çªç®ã®VMBitrix5.1.8ä»®æ³ãã·ã³ã«å¿
èŠãªå Žåã¯ããªã«ããªçšã®ãžã§ããäœæããããšãå¿
èŠã§ãã ãã¡ã€ã«/etc/bareos/bareos-dir.d/job/restorefiles-vm-bitrix.confãäœæããŸãã
ãã®å
容ïŒ
Job { Name = "restorefiles-vm-bitrix" Type = Restore Client = vmware FileSet = "vm-bitrix" Storage = bareos-sd Pool = vm-bitrix-Incremental Messages = Standard Where = /tmp/ }
FileSetãšPoolã®éã®å¯Ÿå¿ãå¿
ã確èªããŠãã ããã
ã芧ã®ãšãããæ°ããããŒã«ãäœæããããšãå¿
èŠã§ãã /etc/bareos/bareos-dir.d/poolãã£ã¬ã¯ããªã«è¡ããŸããã
2ã€ã®ãã¡ã€ã«Full-vm-bitrix.confããã³Incremental-vm-bitrix.confãäœæããŸãã ããããã®å
容ããªã¹ãããŸãã
# cat /etc/bareos/bareos-dir.d/pool/Full-vm-bitrix.conf Pool { Name = vm-bitrix-Full Pool Type = Backup Recycle = yes AutoPrune = yes Volume Retention = 365 days Maximum Volume Bytes = 50G Maximum Volumes = 100 Label Format = "Full-vm-bitrix-" } # cat /etc/bareos/bareos-dir.d/pool/Incremental-vm-bitrix.conf Pool { Name = vm-bitrix-Incremental Pool Type = Backup Recycle = yes AutoPrune = yes Volume Retention = 30 days Maximum Volume Bytes = 1G Maximum Volumes = 100 Label Format = "Incremental-vm-bitrix-" }
ç¹°ãè¿ããŸãããåã®æé ãšåæ§ã«ãvmware_cbt_toolã¹ã¯ãªãããä»ããŠ2çªç®ã®VMã®CBTãã¢ã¯ãã£ãã«ããå¿
èŠããããŸã
æ§æã«å€æŽãå ããåŸããµãŒãã¹ãåèµ·åããå¿
èŠããããŸãã
systemctl restart bareos-fd systemctl restart bareos-dir
ãšã©ãŒãçºçããŠããªãå Žåã¯ãbconsoleã³ã³ãœãŒã«ã«æ»ã£ãŠãæ°ããVMã«è¿œå ããããžã§ãã確èªã§ããŸã
æ°ããä»äºã®ãªã¹ãïŒ

æ°ããã¿ã¹ã¯ãå®è¡ããŸãã

ããã¯ã¢ãããæåããåŸã®ãstatus dirãã³ãã³ãã®éšåçãªåºåïŒ

2çªç®ã®ä»®æ³ãã·ã³ã®å埩ã«é¢ããŠã¯ãæåã®ä»®æ³ãã·ã³ã®åŸ©å
ã®äŸãšéãã¯ãããŸããã è¿œå ã®VMãããã¯ã¢ããããã¿ã¹ã¯ãè¿œå ããããšã¯ã2çªç®ã®VMãããã¯ã¢ããããã¿ã¹ã¯ãè¿œå ããããšã«äŒŒãŠããŸãã

SIM-CLOUD-ãã€ãã®ãã§ãŒã«ãªãŒããŒã¯ã©ãŠããã€ãã®ä¿¡é Œã§ããããŒã¿ã»ã³ã¿ãŒã®å°çšãµãŒããŒïŒããããæ§æãè¿
éãªçµã¿ç«ãŠãç¡æã€ã³ã¹ããŒã«