It's sometimes useful to clone an existing configuration profile within Lifecycle Manager. This is required in order to update the DSE version during manual upgrades, and can also be useful when creating variations of an existing config when you don't want to modify the original. Support for graphically cloning configuration profiles is planned in OPSC-6428, but in the meantime it must be done manually.
If you know all of the settings that you wish to modify, creating a new configuration profile in the web-interface is a viable method of cloning, and is the easiest method to occassionally clone a configuration profile containing only a few customized settings.
If you don't remember all the settings that you wish to customize, if there are a large number of them, or if you want to automate the cloning process because you do it frequently, the API is the best method to clone configuration profiles. The steps below will demonstrate how to clone configuration profiles using the command-line tool 'curl', though any http client that can craft GET and POST requests can be used. Piping output through json_pp or another json formatter is optional, but can make reading and editing the json content much easier.
- Identify the url to the configuration profile that you wish to migration by examining the "href" field of the relevant entry in the list.
- Using the URL from step-3, download the configuration profile in it's entirety to the local file "cp-migrate.json": curl http://127.0.0.1:8888/api/v1/lcm/config_profiles/f177c211-7ebd-4dd9-a6e2-6b93c488395e | json_pp > cp-migrate.json
- Edit cp-migrate.json using the editor of your choice:
- Remove the href, type, id, and related_resources fields.
- Update the "name" field so that it does not conflict when any existing configuration profiles.
- Optionally, update the 'datastax-version' field, which cannot be edited once the configuration profile is added to Lifecycle Manager.
- Optionally, add/update/remove other fields that you wish to change. Note that for fields other than 'datastax-version', you can also update them using the web-interface after adding the configuration-profile.
- Add the new configuration profile to LCM: curl -X POST -d @cp-migrate.json http://127.0.0.1:8888/api/v1/lcm/config_profiles/
- Edit your clusters, datacenters, or node to use the new configuration profile.
At this point, the new configuration profile is available in the web-interface and may be managed as you would any other configuration profile.