Is it possible to deploy to all of the servers at once?
The use case we have is more of a “Blue / Green” style. The “backup cluster” is really the the currently inactive cluster that may need to be re-built, upgraded or otherwise worked on. When we are ready to swap it back as the active cluster, we need to ability to “True-up” the applications that are hosted on it. (By “True-up”, I mean we need to get the latest versions of all the Octopus deploy projects deployed to it.) Once we do that, we can swap the load balancer entries to make traffic start going to the “backup cluster”, thus converting it to the active cluster.
Because the backup cluster could be in the middle of being rebuilt during some of the deployments, concurrent deployments to both active and backup clusters is not a feasible solution.
Have you looked at specifying specific machines when you create a deployment?
As I understand it, when specifying a specific machine for a deployment, it has to be in the list of machines that the deployment would normally consider for the deployment. (Meaning that the MachineId has to be on the list of Deployment Targets created by specifying the the “On Behalf of” in the deployment’s process step.) Do to that, I would need to add both the Backup Cluster and the Active Cluster to the list of deployment targets.
If I put both clusters in the list of Deployment Targets, then, since I can’t deploy to the back up on each Deployment, I would have to customize each and every normal deployment to remove the backup cluster from the list. This is too much overhead for my operations team to have to take on. (And it is too error prone.)
However, if I am mistaken, and I can use the API to just add in any deployment target I like (regardless of if it is part of the step’s Target Role or not), then this would be a workable solution. Do you know if that is how it works?
Have you looked at using a separate role for your backup cluster?
I would be happy to create a separate role for my backup cluster. My question is, once I do that, how to use the API to target that role instead of the one that is build on the deployment step?
You could then duplicate the relevant steps and scope them to an Active and Backup channel
Duplicating the steps would be an explosion of work. Each and every project would then have two copies of the steps to maintain. Even with step templates, this would be very cumbersome. I am really hoping there is an API way to switch deployment targets.
At the root of it, it sounds like what you’re hoping for is the ability to override target roles at deployment time to select specific machines.
This is absolutely what I am looking for. The key part that is hanging me up is that it needs to be a role that is not built on the step for normal deployments and it needs to be done via the
deployment API (if at all possible).
I tried using
SpecificMachineIds to select a deployment target that is not in the list of deployment targets that the “On Behalf Of” setting builds for the deployment. It did not work. It gives the following error:
You must deploy to at least one machine in the environment.
I went and updated one of my projects to have the backup cluster in its “On Behalf Of” setting, and then it worked fine (for that one project). But as I have stated above, this is not a viable solution since the backup cluster will not always be available.
Hoping there is some other way…