We have to remove a server from Octopus before upgrading the tentacle - not good

We found that we have to delete a server from octopus before upgrading from version 2 to version 3 tentacle or it never connects. Is this by design? It is a lot of work.

We are not using Octopus to upgrade the tentacle. We are using powershell

HI Jeremy,

Thanks for getting in touch. Could you explain exactly where do you say you have to delete a server from?

Also please share the Powershell script you are using.

Best regards,
Dalmiro

Toli, can you respond to this question and explain what we have to do

We are manually deleting the machine from the octopus web UI. We are updating the tentacle on each server using the below puppet class. It uninstalls the tentacle, installs the newer one, and runs tentacle.exe commands to configure. If we don’t remove the server before the blow runs, the server never passes health check.

class octopus::install_tentacle($version, $enable_ssl, $octopus_environments, $reconfigure) {

assign octo environment based on passed hash mapping

$octopus_environment = $octopus_environments[$environment]

class { ‘octopus::params’:

version    => $version,

enable_ssl => $enable_ssl,

}

host { ‘configure-hosts-file’ :

name    => $octopus::params::octopus_server_name,

ip      => $octopus::params::octopus_server_ip,

target  => $octopus::params::windows_hosts_path,

comment => 'This host entry is managed by Puppet, do not edit by hand.',

ensure  => present,

}

package { ‘install-tentacle-msi’:

provider        => 'windows',

ensure          => installed,

source          => $octopus::params::tentacle_msi_path,

install_options => ['/qn', '/norestart'],

}

if $reconfigure {

exec { 'configure-polling-tentacle':

  command      => "& '$octopus::params::tentacle_executable_path' create-instance --instance 'Tentacle' --config \"$octopus::params::tentacle_config_path\"",

  logoutput    => true,

  provider     => powershell,

}


exec { 'configure-new-cert':

  command      => "& '$octopus::params::tentacle_executable_path' new-certificate --instance 'Tentacle' --console",

  logoutput    => true,

  provider     => powershell,

}


exec { 'configure-octopus-home':

  command      => "& '$octopus::params::tentacle_executable_path' configure --instance 'Tentacle' --home \"$octopus::params::octopus_home_path\" --console",

  logoutput    => true,

  provider     => powershell,

}


exec { 'configure-octopus-app':

  command      => "& '$octopus::params::tentacle_executable_path' configure --instance 'Tentacle' --app \"$octopus::params::octopus_app_path\" --console",

  logoutput    => true,

  provider     => powershell,

}


exec { 'register-new-tentacle':

  command      => "& '$octopus::params::tentacle_executable_path' register-with --instance 'Tentacle' --server \"$octopus::params::octopus_server_url\" --environment \"$octopus_environment\" --role default --apiKey \"$octopus::params::octopus_api_key\" --comms-style TentacleActive --force --console",

  logoutput    => true,

  provider     => powershell,

}


exec { 'start-and-enable-octopus':

  command      => "& '$octopus::params::tentacle_executable_path' service --instance 'Tentacle' --install --start --console",

  logoutput    => true,

  provider     => powershell,

}

}

}

From: Jeremy Hillin [mailto:jeremyhillin@gmail.com]
Sent: Sunday, February 14, 2016 12:04 PM
To: Dalmiro Grañas; Strakh, Anatoliy (Toli)
Subject: Re: We have to remove a server from Octopus before upgrading the tentacle - not good [Problems #44504]

Toli, can you respond to this question and explain what we have to do

HI Toli,

In that script you are creating a brand new Tentacle Instance with its own new configuration and certificates. If you want to upgrade the Tentacle binaries, but keep the same Tentacle on the Octopus web portal, you need to:

  1. Run the MSI installer
  2. Run `Tentacle.exe configure --instance ‘name’ --home “home path that the 2.6 instance was using” --console"
  3. Restart the Tentacle Service.

That way the 3.0 Tentacle will re-use the config file of the 2.6 instance and you won’t have to delete/recreate tentacles on the web portal.

Hope that makes sense

Regards,
Dalmiro

Would that still work if the 2.6 instance of octopus is on a different server than 3.2?

Hi Toli,

From the phrasing of the first reply I Asumed that the 2.6 server was already upgraded to 3.2. If you still have the 2.6 instance online and talking to the 2.6 Tentacles that you still haven’t upgraded, then using Hydra would be the way to go to upgrade them all at once. Check step 4 of the guide: http://docs.octopusdeploy.com/display/OD/Upgrade+with+a+new+3.0+server+instance

If you still want to go the custom chef+powershell way (which we recommend less than the Hydra one), then yes, that should still work regardless of where your 2.6 server is.

Best regards,
Dalmiro