added backup to virtual model

Change-Id: Ibbbe22b33cb52d568b1d70229ffa4791bcc15c73
diff --git a/classes/cluster/virtual-mcp-pike-dvr/infra/backup/client_common.yml b/classes/cluster/virtual-mcp-pike-dvr/infra/backup/client_common.yml
new file mode 100644
index 0000000..79b8f6b
--- /dev/null
+++ b/classes/cluster/virtual-mcp-pike-dvr/infra/backup/client_common.yml
@@ -0,0 +1,40 @@
+classes:
+- system.backupninja.client.single
+- system.openssh.client.root
+parameters:
+  _param:
+    backupninja_backup_host: ${_param:openstack_control_node03_address}
+    root_private_key: |
+      -----BEGIN RSA PRIVATE KEY-----
+      MIIEowIBAAKCAQEAxL6/rVgCetsETpZaUmXmkj8cZ1WN0eubH1FvMDOi/La9ZJyT
+      k0C6AYpJnIyEm93pMj5cLm08qRqMW+2pdOhYjcH69yg5MrX5SkRk8jCmIHIYoIbh
+      Qnwbnj3dd3I39ZdfU2FO7u2vlbglVou6ZoQxlJDItuLNtzq6EG+w9eF19e7+OsC6
+      6iUItp618zfw1l3J/8nKvCGe2RYDf7mJW6XwCl/DwryJmwwzvPgYJ3QMuDD8/HFj
+      lrJ3xjFTXj4b4Ws1XIoy78fFbtiLr4OwqCYkho03u2E5rOOP1qZxZB63sivHMLMO
+      MM5bOAQKbulFNoyALADGYfc7sf0bZ4u9XXDXxQIDAQABAoIBAQCfmc2MJRT97KW1
+      yqpCpX9BrAiymuiNHf+cjEcSZxEUyHkjIRFmJt+9WB0W7ba1anM92vCUiPDojSzH
+      dig9Oi578JxR20NrK8uqv4jUHzrknynzLveVI3CUEcOSnglfJQijbxDFKfOCFPvV
+      FUyE1UATMNBh6+LNfMprgu+exuMWOPnDyUiYQ+WZ0JfuZY8fuaZte4woJJOb9LUu
+      5rsMG/smIzjpgZ0Z9ZVDMurfq565qhpaXRAqKeIuyht8pacTo31iMQdHB78AvY/3
+      g0z21Gk8k3z0Kr/YFKr2r4FmXY5m/gAUvZly2ZrVQM5XsbTVCzq/JpI5fssNvSbU
+      AKmXzf4RAoGBAOO3d4/cstxERzW6hyOTjZIN1ppR52CsnZTsVPbfd0pCtmzmVZce
+      CtHKdcXSbTwZvvkK09QSWAp3MoSpd0gIOiLU8Wx/R/RIZsu9BlhTS3r3EQLnk72d
+      H/1TTA+j4T/LIYLSojQ1RxvIrHetAD44j732aTwKAHj/SybEAVqNkOB/AoGBAN0u
+      gLcrgqIHGrk4VjWSvlCGymfF40equcx+ud7XhfZDGETUOSahW4dPZ52cjPAkrCBQ
+      MMfcDwSVGsOAjd+mNt11BHUKobnhXwFaWWuyqyn9NmWFbjMbICVh7E3Of5aVN38o
+      lrmo/7LuKMVG7XRwphCv5NkaJmQG4njDyUQWlaW7AoGADCd8wDb9bPhP/LQqBmIX
+      ylXmwHHisaxE9O/wUQT4bwREjGd25gv6c9wkkRx8LBsLsGs9hzI7dMOL9Ly+2x9l
+      SvqmsC3S/1zl77X1Ir2/Z57MT6Vgo1xBmtnZU3Rhz2/eKAdqFPNLClaZrgGT475N
+      HcyLLWMzR0IJFtabY+Puea0CgYA8Zb5wRkldxWLewSuJZZDinGwY+kieAVjLJq/K
+      0j+ah6fQ48LXcah0wpIgz+cMjHcUO9GWQdk3/x9X03rqX5EL2DBnZYfUIl63F9zj
+      M97ZkHOSNWVqPzX//0Vv2butewG0j3jZKfTo/2/SrxOYgEpYtC9huWpSVi7xm0US
+      erhSkQKBgFIf9JEsfgE57ANhvITZ3ZI0uZXNxZkXQaVg8jvScDi79IIhy9iPzhKC
+      aIIQoDNIlWv1ftCRZ5AlBvVXgvQ/QNrwy48JiQTzWZlb9Ezg8w+olQmSbG6fq7Y+
+      7r3i+QUZ7RBdOb24QcQ618q54ozNTCB7OywY78ptFzeoBeptiNr1
+      -----END RSA PRIVATE KEY-----
+  # for salt-master backup
+  backupninja:
+    client:
+      target:
+        home_dir: /srv/volumes/backup/backupninja
+        engine_opts: "-av --delete --recursive --safe-links"
diff --git a/classes/cluster/virtual-mcp-pike-dvr/infra/backup/client_mysql.yml b/classes/cluster/virtual-mcp-pike-dvr/infra/backup/client_mysql.yml
new file mode 100644
index 0000000..9d0cace
--- /dev/null
+++ b/classes/cluster/virtual-mcp-pike-dvr/infra/backup/client_mysql.yml
@@ -0,0 +1,37 @@
+classes:
+- system.xtrabackup.client.single
+parameters:
+  _param:
+    xtrabackup_remote_server: ${_param:openstack_control_node03_address}
+    root_private_key: |
+      -----BEGIN RSA PRIVATE KEY-----
+      MIIEowIBAAKCAQEAxL6/rVgCetsETpZaUmXmkj8cZ1WN0eubH1FvMDOi/La9ZJyT
+      k0C6AYpJnIyEm93pMj5cLm08qRqMW+2pdOhYjcH69yg5MrX5SkRk8jCmIHIYoIbh
+      Qnwbnj3dd3I39ZdfU2FO7u2vlbglVou6ZoQxlJDItuLNtzq6EG+w9eF19e7+OsC6
+      6iUItp618zfw1l3J/8nKvCGe2RYDf7mJW6XwCl/DwryJmwwzvPgYJ3QMuDD8/HFj
+      lrJ3xjFTXj4b4Ws1XIoy78fFbtiLr4OwqCYkho03u2E5rOOP1qZxZB63sivHMLMO
+      MM5bOAQKbulFNoyALADGYfc7sf0bZ4u9XXDXxQIDAQABAoIBAQCfmc2MJRT97KW1
+      yqpCpX9BrAiymuiNHf+cjEcSZxEUyHkjIRFmJt+9WB0W7ba1anM92vCUiPDojSzH
+      dig9Oi578JxR20NrK8uqv4jUHzrknynzLveVI3CUEcOSnglfJQijbxDFKfOCFPvV
+      FUyE1UATMNBh6+LNfMprgu+exuMWOPnDyUiYQ+WZ0JfuZY8fuaZte4woJJOb9LUu
+      5rsMG/smIzjpgZ0Z9ZVDMurfq565qhpaXRAqKeIuyht8pacTo31iMQdHB78AvY/3
+      g0z21Gk8k3z0Kr/YFKr2r4FmXY5m/gAUvZly2ZrVQM5XsbTVCzq/JpI5fssNvSbU
+      AKmXzf4RAoGBAOO3d4/cstxERzW6hyOTjZIN1ppR52CsnZTsVPbfd0pCtmzmVZce
+      CtHKdcXSbTwZvvkK09QSWAp3MoSpd0gIOiLU8Wx/R/RIZsu9BlhTS3r3EQLnk72d
+      H/1TTA+j4T/LIYLSojQ1RxvIrHetAD44j732aTwKAHj/SybEAVqNkOB/AoGBAN0u
+      gLcrgqIHGrk4VjWSvlCGymfF40equcx+ud7XhfZDGETUOSahW4dPZ52cjPAkrCBQ
+      MMfcDwSVGsOAjd+mNt11BHUKobnhXwFaWWuyqyn9NmWFbjMbICVh7E3Of5aVN38o
+      lrmo/7LuKMVG7XRwphCv5NkaJmQG4njDyUQWlaW7AoGADCd8wDb9bPhP/LQqBmIX
+      ylXmwHHisaxE9O/wUQT4bwREjGd25gv6c9wkkRx8LBsLsGs9hzI7dMOL9Ly+2x9l
+      SvqmsC3S/1zl77X1Ir2/Z57MT6Vgo1xBmtnZU3Rhz2/eKAdqFPNLClaZrgGT475N
+      HcyLLWMzR0IJFtabY+Puea0CgYA8Zb5wRkldxWLewSuJZZDinGwY+kieAVjLJq/K
+      0j+ah6fQ48LXcah0wpIgz+cMjHcUO9GWQdk3/x9X03rqX5EL2DBnZYfUIl63F9zj
+      M97ZkHOSNWVqPzX//0Vv2butewG0j3jZKfTo/2/SrxOYgEpYtC9huWpSVi7xm0US
+      erhSkQKBgFIf9JEsfgE57ANhvITZ3ZI0uZXNxZkXQaVg8jvScDi79IIhy9iPzhKC
+      aIIQoDNIlWv1ftCRZ5AlBvVXgvQ/QNrwy48JiQTzWZlb9Ezg8w+olQmSbG6fq7Y+
+      7r3i+QUZ7RBdOb24QcQ618q54ozNTCB7OywY78ptFzeoBeptiNr1
+      -----END RSA PRIVATE KEY-----
+  xtrabackup:
+    server:
+      enabled: false
+      backup_dir: /srv/volumes/backup/xtrabackup
diff --git a/classes/cluster/virtual-mcp-pike-dvr/infra/backup/server.yml b/classes/cluster/virtual-mcp-pike-dvr/infra/backup/server.yml
new file mode 100644
index 0000000..8f84903
--- /dev/null
+++ b/classes/cluster/virtual-mcp-pike-dvr/infra/backup/server.yml
@@ -0,0 +1,15 @@
+classes:
+- system.backupninja.server.single
+- system.xtrabackup.server.single
+- system.glusterfs.client.cluster
+- system.glusterfs.client.volume.backup
+parameters:
+  _param:
+    backupninja_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEvr+tWAJ62wROllpSZeaSPxxnVY3R65sfUW8wM6L8tr1knJOTQLoBikmcjISb3ekyPlwubTypGoxb7al06FiNwfr3KDkytflKRGTyMKYgchighuFCfBuePd13cjf1l19TYU7u7a+VuCVWi7pmhDGUkMi24s23OroQb7D14XX17v46wLrqJQi2nrXzN/DWXcn/ycq8IZ7ZFgN/uYlbpfAKX8PCvImbDDO8+BgndAy4MPz8cWOWsnfGMVNePhvhazVcijLvx8Vu2Iuvg7CoJiSGjTe7YTms44/WpnFkHreyK8cwsw4wzls4BApu6UU2jIAsAMZh9zux/Rtni71dcNfF
+    xtrabackup_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEvr+tWAJ62wROllpSZeaSPxxnVY3R65sfUW8wM6L8tr1knJOTQLoBikmcjISb3ekyPlwubTypGoxb7al06FiNwfr3KDkytflKRGTyMKYgchighuFCfBuePd13cjf1l19TYU7u7a+VuCVWi7pmhDGUkMi24s23OroQb7D14XX17v46wLrqJQi2nrXzN/DWXcn/ycq8IZ7ZFgN/uYlbpfAKX8PCvImbDDO8+BgndAy4MPz8cWOWsnfGMVNePhvhazVcijLvx8Vu2Iuvg7CoJiSGjTe7YTms44/WpnFkHreyK8cwsw4wzls4BApu6UU2jIAsAMZh9zux/Rtni71dcNfF
+  backupninja:
+    server:
+      home_dir: /srv/volumes/backup/backupninja
+  xtrabackup:
+    server:
+      backup_dir: /srv/volumes/backup/xtrabackup
\ No newline at end of file
diff --git a/classes/cluster/virtual-mcp-pike-dvr/infra/config.yml b/classes/cluster/virtual-mcp-pike-dvr/infra/config.yml
index 348f713..0bf344e 100644
--- a/classes/cluster/virtual-mcp-pike-dvr/infra/config.yml
+++ b/classes/cluster/virtual-mcp-pike-dvr/infra/config.yml
@@ -3,7 +3,7 @@
 - system.linux.system.single
 - system.linux.system.repo.mcp.salt
 - system.linux.system.repo.mcp.apt_mirantis.openstack
-- system.openssh.client.lab
+#- system.openssh.client.lab
 - system.salt.master.api
 - system.salt.master.pkg
 - system.reclass.storage.salt
@@ -25,6 +25,7 @@
 - system.reclass.storage.system.openstack_gateway_single
 - system.reclass.storage.system.openstack_dashboard_single
 - system.reclass.storage.system.stacklightv2_server_cluster
+- cluster.virtual-mcp-pike-dvr.infra.backup.client_common
 - cluster.virtual-mcp-pike-dvr.openstack.proxy
 - cluster.virtual-mcp-pike-dvr.stacklight.proxy
 - cluster.virtual-mcp-pike-dvr
@@ -59,9 +60,12 @@
           enabled: false
   salt:
     master:
+      backup: true
       reactor:
         reclass/minion/classify:
         - salt://reclass/reactor/node_register.sls
+    minion:
+      backup: true
   reclass:
     storage:
       class_mapping:
@@ -148,6 +152,7 @@
       node:
         openstack_control_node01:
           classes:
+          - cluster.virtual-mcp-pike-dvr.infra.backup.client_mysql
           - service.galera.master.cluster
           params:
             mysql_cluster_role: master
@@ -160,6 +165,7 @@
             linux_system_codename: xenial
         openstack_control_node03:
           classes:
+          - cluster.virtual-mcp-pike-dvr.infra.backup.server
           - service.galera.slave.cluster
           params:
             mysql_cluster_role: slave
diff --git a/classes/cluster/virtual-mcp-pike-dvr/openstack/control.yml b/classes/cluster/virtual-mcp-pike-dvr/openstack/control.yml
index 81c209a..a5837c7 100644
--- a/classes/cluster/virtual-mcp-pike-dvr/openstack/control.yml
+++ b/classes/cluster/virtual-mcp-pike-dvr/openstack/control.yml
@@ -14,6 +14,7 @@
 - system.glusterfs.client.volume.keystone
 - system.glusterfs.server.volume.glance
 - system.glusterfs.server.volume.keystone
+- system.glusterfs.server.volume.backup
 - system.glusterfs.server.cluster
 - system.glance.control.cluster
 - system.nova.control.cluster