Skip to main content
Version: 2.0

Create a volume mirror

Pre-task:#

  • Make sure the two cluster has same user name
  • Make sure the two cluster has same project name
  • cluster1 - IP: 10.32.20.241
  • cluster2 - IP: 10.32.20.242

cluster1: CLI > cluster > check#

cluster1:cluster> check          Service  Status  Report      ClusterLink      ok  [ link(v) ]  ClusterSettings      ok  [ etcd(v) ]        HaCluster      ok  [ hacluster(v) ]         MsgQueue      ok  [ rabbitmq(v) ]           IaasDb      ok  [ mysql(v) ]        VirtualIp      ok  [ vip(v) haproxy_ha(v) ]          Storage      ok  [ ceph(v) ceph_mon(v) ceph_mgr(v) ceph_mds(v) ceph_osd(v) ceph_rgw(v) rbd_target(v) ]       ApiService      ok  [ haproxy(v) httpd(v) lmi(v) memcache(v) ]     SingleSignOn      ok  [ keycloak(v) ]          Compute      ok  [ nova(v) ]        Baremetal      ok  [ ironic(v) ]          Network      ok  [ neutron(v) ]            Image      ok  [ glance(v) ]        BlockStor      ok  [ cinder(v) ]         FileStor      ok  [ manila(v) ]       ObjectStor      ok  [ swift(v) ]    Orchestration      ok  [ heat(v) ]            LBaaS      ok  [ octavia(v) ]           DNSaaS      ok  [ designate(v) ]           K8SaaS      ok  [ k3s(v) rancher(v) ]       InstanceHa      ok  [ masakari(v) ] DisasterRecovery      ok  [ freezer(v) ]    BusinessLogic      ok  [ mistral(v) murano(v) cloudkitty(v) ]         DataPipe      ok  [ zookeeper(v) kafka(v) ]          Metrics      ok  [ monasca(v) telegraf(v) grafana(v) ]     LogAnalytics      ok  [ filebeat(v) auditbeat(v) logstash(v) es(v) kibana(v) ]    Notifications      ok  [ influxdb(v) kapacitor(v) ]

cluster2: CLI > cluster > check#

cluster2:cluster> check          Service  Status  Report      ClusterLink      ok  [ link(v) ]  ClusterSettings      ok  [ etcd(v) ]        HaCluster      ok  [ hacluster(v) ]         MsgQueue      ok  [ rabbitmq(v) ]           IaasDb      ok  [ mysql(v) ]        VirtualIp      ok  [ vip(v) haproxy_ha(v) ]          Storage      ok  [ ceph(v) ceph_mon(v) ceph_mgr(v) ceph_mds(v) ceph_osd(v) ceph_rgw(v) rbd_target(v) ]       ApiService      ok  [ haproxy(v) httpd(v) lmi(v) memcache(v) ]     SingleSignOn      ok  [ keycloak(v) ]          Compute      ok  [ nova(v) ]        Baremetal      ok  [ ironic(v) ]          Network      ok  [ neutron(v) ]            Image      ok  [ glance(v) ]        BlockStor      ok  [ cinder(v) ]         FileStor      ok  [ manila(v) ]       ObjectStor      ok  [ swift(v) ]    Orchestration      ok  [ heat(v) ]            LBaaS      ok  [ octavia(v) ]           DNSaaS      ok  [ designate(v) ]           K8SaaS      ok  [ k3s(v) rancher(v) ]       InstanceHa      ok  [ masakari(v) ] DisasterRecovery      ok  [ freezer(v) ]    BusinessLogic      ok  [ mistral(v) murano(v) cloudkitty(v) ]         DataPipe      ok  [ zookeeper(v) kafka(v) ]          Metrics      ok  [ monasca(v) telegraf(v) grafana(v) ]     LogAnalytics      ok  [ filebeat(v) auditbeat(v) logstash(v) es(v) kibana(v) ]    Notifications      ok  [ influxdb(v) kapacitor(v) ]

Launch three VM on project admin of cluster1#

/assets/volumes/vm-1.png

Enable storage mirroring#

cluster1(primary)#

CLI > storage > mirror > site

cluster1> storage mirrorcluster1:mirror> siteSelect action:1: Configure2: Add Site3: Delete Site4: Update SiteEnter index: 1Enable the site:1: Enabled2: DisabledEnter index: 1Enter site name (required): primaryApplying policy changes.Policy changes were successfully applied.

cluster2(secondary)#

CLI > storage > mirror > site

cluster2> storage mirrorcluster2:mirror> siteSelect action:1: Configure2: Add Site3: Delete Site4: Update SiteEnter index: 1Enable the site:1: Enabled2: DisabledEnter index: 1Enter site name (required): secondaryApplying policy changes.Policy changes were successfully applied.

Config remote peer#

cluster1(primary)#

CLI > storage > mirror > site

cluster1:mirror> siteSelect action:1: Configure2: Add Site3: Delete Site4: Update SiteEnter index: 2Enter site name (required): secondaryEnter IP address (required): 10.32.20.242Enter remote secret (required): adminApplying policy changes.Policy changes were successfully applied.cluster1:mirror> listenabled: yessite name: primary
peers: enabled                       peer name            ip address---------------------------------------------------------------     [x]                       secondary          10.32.20.242
rules: enabled                                                volume---------------------------------------------------------------

cluster2(secondary)#

CLI > storage > mirror > site

cluster2:mirror> siteSelect action:1: Configure2: Add Site3: Delete Site4: Update SiteEnter index: 2Enter site name (required): primaryEnter IP address (required): 10.32.20.241Enter remote secret (required): adminApplying policy changes.Policy changes were successfully applied.cluster2:mirror> listenabled: yessite name: secondary
peers: enabled                       peer name            ip address---------------------------------------------------------------     [x]                         primary          10.32.20.241
rules: enabled                                                volume---------------------------------------------------------------

Select instance volume on cluster1 for sync-ing to all remote peers#

cluster1:mirror> ruleSelect action:1: Add2: Delete3: UpdateEnter index: 1Select domain:1: defaultEnter index: 1Select tenant:1: adminEnter index: 1Select volume:1: volume: 2f0ee00a-00ca-4ab3-826d-3c143fee1f1e, status: in-use, size: 1GB, attach: /dev/sda on cirros-a-22: volume: 06ac175a-bc8d-480c-b8e0-200d1567b80a, status: in-use, size: 1GB, attach: /dev/sda on cirros-a-33: volume: ba0867af-caef-4441-b24a-58b8a55360e4, status: in-use, size: 1GB, attach: /dev/sda on cirros-a-1Enter index: 1Apply the changes?Enter 'YES' to confirm: YESApplying policy changes.Policy changes were successfully applied.

Watch sync status until done on cluster1(primary)#

CLI > storage > mirror > status

cluster1:mirror> statusupdated: 16:52:11primary-site: OK                                      volume  primary   synced         state----------------------------------------------------------------------------- volume-2f0ee00a-00ca-4ab3-826d-3c143fee1f1e      yes      n/a    up+stopped
cluster1:mirror> listenabled: yessite name: primary
peers: enabled                       peer name            ip address---------------------------------------------------------------     [x]                       secondary          10.32.20.242
rules: enabled                                                volume---------------------------------------------------------------     [x]                  2f0ee00a-00ca-4ab3-826d-3c143fee1f1e

Watch sync status until done on cluster2(secondary)#

CLI > storage > mirror > status

cluster2:mirror> statusupdated: 16:52:17secondary-site: WARNING                                      volume  primary   synced         state----------------------------------------------------------------------------- volume-2f0ee00a-00ca-4ab3-826d-3c143fee1f1e       no       no    up+syncing
cluster2:mirror> statusupdated: 16:52:28secondary-site: OK                                      volume  primary   synced         state----------------------------------------------------------------------------- volume-2f0ee00a-00ca-4ab3-826d-3c143fee1f1e       no       no  up+replaying

Verify a new volume entry is automatically created on cluster2#

/assets/volumes/vm-2.png

Make some changes on the mirroring volume on cirros-a-2 of cluster1#

/assets/volumes/vm-3.png

Check cluster2(secondary) status for making sure the data has been synced#

cluster2:mirror> statusupdated: 16:56:33secondary-site: OK                                      volume  primary   synced         state----------------------------------------------------------------------------- volume-2f0ee00a-00ca-4ab3-826d-3c143fee1f1e       no      yes  up+replaying

Demote images on cluster1(primary)#

CLI > storage > mirror > demote

cluster1:mirror> demote1: normal2: forceEnter index: 1Image demoted to non-primary

Promote images on cluster2(secondary)#

CLI > storage > mirror > promote

cluster2:mirror> promote1: normal2: forceEnter index: 1Image promoted to primary

Check mirroring status on cluster1(primary)#

CLI > storage > mirror > status

cluster1:mirror> statusupdated: 16:57:46primary-site: WARNING                                      volume  primary   synced         state----------------------------------------------------------------------------- volume-2f0ee00a-00ca-4ab3-826d-3c143fee1f1e       no       no    up+unknown
cluster1:mirror> statusupdated: 16:58:09primary-site: OK                                      volume  primary   synced         state----------------------------------------------------------------------------- volume-2f0ee00a-00ca-4ab3-826d-3c143fee1f1e       no       no  up+replaying

Check mirroring status on cluster2(secondary)#

CLI > storage > mirror > status

cluster2:mirror> statusupdated: 16:57:48secondary-site: WARNING                                      volume  primary   synced         state----------------------------------------------------------------------------- volume-2f0ee00a-00ca-4ab3-826d-3c143fee1f1e      yes      n/a    up+unknown
cluster2:mirror> statusupdated: 16:58:05secondary-site: OK                                      volume  primary   synced         state----------------------------------------------------------------------------- volume-2f0ee00a-00ca-4ab3-826d-3c143fee1f1e      yes      n/a    up+stopped

Call up a VM attached to the mirrored image on cluster2(secondary)#

/assets/volumes/vm-4.png

Call up a VM attached to the mirrored image on cluster2(secondary)#

/assets/volumes/vm-5.png

Last updated on by Roy Tan