Add the ability to provide "image based recovery" for setting up new environments#394
Open
simonpane wants to merge 1 commit intogoogle:masterfrom
Open
Add the ability to provide "image based recovery" for setting up new environments#394simonpane wants to merge 1 commit intogoogle:masterfrom
simonpane wants to merge 1 commit intogoogle:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: simonpane The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description:
The PR includes changes required to support the provisioning of new systems from storage level snapshot clones which may be applicable for a number of different possible use cases. Mostly with the aim of reducing installation and configuration time.
Solution Overview:
System configuration, software installation and patching, and database creation times can be minimized by building new environments from physical storage/disk clones. The toolkit can be used to re-configure Oracle Restart and databases on cloned storage by specifying the new
--disk-snapshot-clonecommand line argument to theinstall-oracle.shscript.In addition to the required enhancements for reconfiguring cloned Oracle software and/or databases, this PR includes:
active-copy.ymltask file into several new, smaller, and more purpose oriented task files - most of which to be called from several other current or upcoming tasks. Specifically, the new task files include:oracle-net-setup.yml,password-file-backup.yml,password-file-copy.yml.db-staterole for starting/stopping the Oracle database, putting the database in to or taking it out of backup mode, and setting the database's auto-start configuration. This role is called by tasks from the existing plays but can also be used independently through the new callingdb-state.shshell script. (Additional details below.)Possible Customer Use Cases:
Using the Toolkit with Disk Clones
New Shell Script and Ansible Role
db-stateCreating disk storage snapshots of Oracle Database systems often require changing the database state beforehand. For example, the database may have to be stopped or put into "backup mode" prior to taking snapshots and re-started or taken out of "backup mode" once the snapshots have been taken.
To facilitate this, a new shell script called
db-state.shand a new Ansible role, also calleddb-state, have been added.The
db-state.shscript requires at least one of the (self-explanatory) desired state argument:Additionally, an inventory file specifying the managed host target is mandatory:
Example typical workflow:
Or similarly:
Toolkit Usage when using Image Clones
A new command line argument to the installation shell script
--disk-snapshot-cloneis essential when working with systems restored from disk snapshots. Other arguments (preexisting) may also be required depending on the restoration scenario.Case 1: Restoring a system where all disks, including the boot device, were restored from snapshot clones:
The toolkit supports cloning all disks (which would include the boot device, disks where the Oracle software is installed, and disks containing the Oracle database files) to a new VM instance:
This may be useful in situations where you want to create a "golden image" of an entire system, including the OS boot device, the Oracle software, and the Oracle database (for example with initial or seed data), and restore that to another system at a later date.
Regardless of whether the restored system uses ASM or not, some degree of software reconfiguration (such as updating the host name in Oracle Net files for example) will be required as the new server name likely differs from that from which the disk snapshots were created.
Run the toolkit using the
--disk-snapshot-cloneargument at a minimum. Example:./install-oracle.sh \ --instance-ip-addr 10.0.1.100 \ --ora-version 19 \ --ora-swlib-bucket gs://[storage_bucket] \ --ora-data-mounts data_mounts_config.json \ --ora-asm-disks asm_disk_config.json \ --backup-dest "+RECO" \ --disk-snapshot-cloneIf confident that no OS adjustments are required (as the boot partition was cloned), then optionally limit the toolkit's tasks using the the
--install-swand--config-dbarguments:./install-oracle.sh \ --instance-ip-addr 10.0.1.100 \ --ora-version 19 \ --ora-swlib-bucket gs://[storage_bucket] \ --ora-data-mounts data_mounts_config.json \ --ora-asm-disks asm_disk_config.json \ --backup-dest "+RECO" \ --disk-snapshot-clone --install-sw --config-dbCase 2: Restoring a system where all disks, excluding the boot device, were restored from snapshot clones:
It may be desirable to attach all Oracle software disks, and Oracle database data disks to an already built VM instance. For example, in the case when cloning to an upgraded or patched OS is required:
Unlike with the previous scenario, when the boot device is not restored and consequently has no Oracle specific configuration, then the toolkit must be run as normal but with the inclusion of the
--disk-snapshot-cloneargument:./install-oracle.sh \ --instance-ip-addr 10.0.1.100 \ --ora-version 19 \ --ora-swlib-bucket gs://[storage_bucket] \ --ora-data-mounts data_mounts_config.json \ --ora-asm-disks asm_disk_config.json \ --backup-dest "+RECO" \ --disk-snapshot-cloneAgain, no special steps are required depending on whether the snapshot source was from a an Oracle Database that was shutdown (aka "offline" or "cold" backup) or in backup mode (aka "online" or "hot" backup).
Case 3: Restoring a system from a snapshot that included the software installation only, and no database
To save the time required to install and patch the Oracle software, only a snapshot clone of the boot disk and the Oracle software disk(s) can be restored to a new VM:
Or, if desired, only the Oracle software disk(s) can be cloned from a snapshot and attached to an existing VM with a pre-configured boot disk and OS:
In such scenarios, similar to the previous cases, the toolkit can be used to re-configure the Oracle software installation by using the
--disk-snapshot-cloneargument. However, since no Oracle Database exists on the restored system, this should be done including the--install-swargument to limit the toolkit's scope. For example:./install-oracle.sh \ --instance-ip-addr 10.0.1.100 \ --ora-version 19 \ --ora-swlib-bucket gs://[storage_bucket] \ --ora-data-mounts data_mounts_config.json \ --ora-asm-disks asm_disk_config.json \ --backup-dest "+RECO" \ --disk-snapshot-clone --install-swIf the system was built by attaching the disk with the Oracle software (again, without a database), but without also including the boot device, then simply also include the
--prep-hostargument:./install-oracle.sh \ --instance-ip-addr 10.0.1.100 \ --ora-version 19 \ --ora-swlib-bucket gs://[storage_bucket] \ --ora-data-mounts data_mounts_config.json \ --ora-asm-disks asm_disk_config.json \ --backup-dest "+RECO" \ --disk-snapshot-clone --prep-host --install-swAfter the software has been reconfigured for the new host, the rest of the toolkit can be run as per normal and critically, without the
--disk-snapshot-cloneargument. For example:./install-oracle.sh \ --instance-ip-addr 10.0.1.100 \ --ora-version 19 \ --ora-swlib-bucket gs://[storage_bucket] \ --ora-data-mounts data_mounts_config.json \ --ora-asm-disks asm_disk_config.json \ --backup-dest "+RECO" \ --config-dbCase 4: Restoring only Oracle database disks
A more advanced scenario involves "swinging" an Oracle database from one server to another. This can be accomplished by snapshotting only the disk devices with Oracle database files and then cloning/attaching them to another server with a pre-installed OS and an already installed Oracle Home (software).
The toolkit can of course be used to configure the OS and install and patch the required Oracle software on the target server (e.g. using the
--skip-database-configargument) in advance.A number of limitations, cautions, or caveats must be considered with this more advanced workflow:
db-state.shscript with the--disable-autostartargument - this command is compatible for both databases with and without Oracle Restart management.Once these conditions have all been satisfied, the toolkit can be run with the
--config-dboption to complete the configuration. For example:./install-oracle.sh \ --instance-ip-addr 10.0.1.100 \ --ora-version 19 \ --ora-swlib-bucket gs://[storage_bucket] \ --ora-data-mounts data_mounts_config.json \ --ora-asm-disks asm_disk_config.json \ --backup-dest "+RECO" \ --config-db