CloudBees Jenkins Enterprise AWS Cross Region Migration

Issue

Migration of CJE AWS to an alternative AWS region for a variety or reasons such as geographic or regulatory purposes.

CJE in conjunction with AWS provides a method to migrate a CJE cluster using a combination of CJE and AWS steps.

Then migration process caters for CJE-OC and Master configuration data including job history, it does not however migrate Elastic Search analytics data

Environment

Requirements

Access to the current and target AWS regions via the AWS UI or AWS CLI with the ability to create resources.
The target AWS region must have at least the same number of Availabilty Zones as the existing region.
Access to the existing CJE project configuration.

Limitations

  • Elasticsearch Data - Data is not migrated
  • Encryption - It is not possible to migrate from a non encrypted installation to a encrypted installation, its is however possible to migrate from an encrypted installation to a target encrypted installation.

Resolution

Prepare existing cluster

  • Take a backup of your CJE project
  • Take a backup of both the CJE-OC and Masters using CJE-OC Cluster Operations job as a precaution. Use CloudBees Backup plugin.
  • Stop all Masters from the UI, this ensures that no jobs are in process and data is migrated.
  • Login into AWS console and select the current region.
  • From AWS services select ‘EC2’.
  • Select ‘Snapshots’ from the left hand side panel under ‘ELASTIC BLOCK STORE’.
  • In the filter panel at the top of the screen enter the cluster_name for your current cluster.
  • Stop CJE-OC (dna stop cjoc)
  • A number of snapshots will be shown, at least one for CJE-OC and each master, ensure the latest start time for each is later than when the masters were stopped.

Copy snapshots and apply labels

  • Take a copy of the AWS snapshots, anything with the tag cloudbees:pse:cluster to the new region, see for detail on how to achieve this EBS Copy Snapshot guide in AWS.
  • Tags are not copied to a new region, you must go in and create corresponding tags in the new region, CJE needs the tags cluster, account, cloudbees:pse:cluster, cloudbees:pse:account for the migration, refer to existing region for tag values.

Create new CJE project in the target region

  • Create a new cluster (cje init-project) with the same cluster_name and similar configuration as the previous one, ensuring you specify the new region. You should ensure you edit cluster-init.secrets with the existing cjoc_username and cjoc_password.

Provided you copied the EBS snapshots earlier, the cluster will boot using your existing data.

Check target environment

  • Once the project has been applied and created, login to CJE-OC.
  • Check to ensure configuration should be as per the origin region (Masters etc), start masters and ensure that job information and history are available.
  • If for any reason the masters do not start or give an error such as “connection off-line, cannot check licence”, select restart on the troublesome master which should resolve the issue.
  • Check any backup jobs configured run successfully.
  • Ensure snapshots are being created successfully.

Have more questions?

0 Comments

Please sign in to leave a comment.