Page MenuHomePhabricator

Migrate prometheus5002 to prometheus5003
Closed, ResolvedPublic

Description

As part of the migration of eqsin we need to re-create the prometheus instance on routed ganeti. As procedure as https://phabricator.wikimedia.org/T419430


  • remove prometheus5003 from manifestes/site.pp
  • setup firewall rules
#hieradata/eqsin.yaml
prometheus_nodes:
  - prometheus5002.eqsin.wmnet
  - prometheus5003.eqsin.wmnet
  • enable rsyncd on eqsin's instances (to be reverted)
  • run puppet on prometheu5003
  • Initial rsync of data from 5002 to 5003 (on 5003, as user prometheus) to be done in advance
prometheus-sync-data prometheus5002.eqsin.wmnet ops
  • disable-puppet on all prometheus hosts in the site
  • Add 5003, remove 5002 to prometheus_instances in puppet for the selected instance and merge the patch
# add, hieradata/common/prometheus.yaml
prometheus::instances:
  ops:
    port: 9900
    retention_size: 3300GB
    provision_lv_size: '3.6t'
    hosts:
      - prometheus...
      - prometheus5003.eqsin.wmnet
#add replica label for the new upcoming prometheus5003 node
#hieradata/hosts/prometheus5003.yaml
prometheus::replica_label: 'a'
  • on prometheus5002
systemctl disable {prometheus,thanos-sidecar}@ops
systemctl stop {prometheus,thanos-sidecar}@ops
chmod a-x /usr/bin/thanos /usr/bin/prometheus
  • Final rsync of data from 5002 to 5003 (on 5003, as user prometheus)
prometheus-sync-data prometheus5002.eqsin.wmnet ops
  • restart services on 5003
run-puppet-agent --force
  • fix DNS entries
#templates/wmnet
$ORIGIN svc.eqsin.wmnet.
$INCLUDE netbox/svc.eqsin.wmnet
prometheus  1H  IN CNAME    prometheus5003.eqsin.wmnet.
  • REVERT enable rsyncd on eqsin's instances

Event Timeline

Change #1275907 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Add prometheus5003

https://gerrit.wikimedia.org/r/1275907

Change #1275907 merged by Muehlenhoff:

[operations/puppet@production] Add prometheus5003

https://gerrit.wikimedia.org/r/1275907

Cookbook cookbooks.sre.hosts.reimage was started by jmm@cumin2002 for host prometheus5003.eqsin.wmnet with OS bookworm

Cookbook cookbooks.sre.hosts.reimage started by jmm@cumin2002 for host prometheus5003.eqsin.wmnet with OS bookworm executed with errors:

  • prometheus5003 (FAIL)
    • Removed from Puppet and PuppetDB if present and deleted any certificates
    • Removed from Debmonitor if present
    • Forced PXE for next reboot
    • Host rebooted via gnt-instance
    • Host up (Debian installer)
    • Set boot media to disk
    • Host up (new fresh bookworm OS)
    • Generated Puppet certificate
    • Signed new Puppet certificate
    • Run Puppet in NOOP mode to populate exported resources in PuppetDB
    • Found Nagios_host resource for this host in PuppetDB
    • Downtimed the new host on Icinga/Alertmanager
    • First Puppet run completed and logged in /var/log/spicerack/sre/hosts/reimage/202604211545_jmm_1420671_prometheus5003.out
    • The reimage failed, see the cookbook logs for the details. You can also try typing "sudo install-console prometheus5003.eqsin.wmnet" to get a root shell, but depending on the failure this may not work.

Change #1279251 had a related patch set uploaded (by Tiziano Fogli; author: Tiziano Fogli):

[operations/puppet@production] prom5003: assign prometheus::pop role

https://gerrit.wikimedia.org/r/1279251

Change #1279252 had a related patch set uploaded (by Tiziano Fogli; author: Tiziano Fogli):

[operations/puppet@production] prom5003: setup firewall rules

https://gerrit.wikimedia.org/r/1279252

Change #1279253 had a related patch set uploaded (by Tiziano Fogli; author: Tiziano Fogli):

[operations/puppet@production] prometheus::pop: enable rsyncd on eqsin

https://gerrit.wikimedia.org/r/1279253

Change #1279254 had a related patch set uploaded (by Tiziano Fogli; author: Tiziano Fogli):

[operations/puppet@production] prometheus/eqsin: remove 5002, add 5003

https://gerrit.wikimedia.org/r/1279254

Change #1279255 had a related patch set uploaded (by Tiziano Fogli; author: Tiziano Fogli):

[operations/puppet@production] prom5003: clean up firewall rules

https://gerrit.wikimedia.org/r/1279255

Change #1279256 had a related patch set uploaded (by Tiziano Fogli; author: Tiziano Fogli):

[operations/dns@master] prometheus/eqsin: update svc record

https://gerrit.wikimedia.org/r/1279256

Change #1279251 merged by Tiziano Fogli:

[operations/puppet@production] prom5003: assign prometheus::pop role

https://gerrit.wikimedia.org/r/1279251

Change #1279252 merged by Tiziano Fogli:

[operations/puppet@production] prom5003: setup firewall rules

https://gerrit.wikimedia.org/r/1279252

Change #1279253 merged by Tiziano Fogli:

[operations/puppet@production] prometheus::pop: enable rsyncd on eqsin

https://gerrit.wikimedia.org/r/1279253

Change #1279254 merged by Tiziano Fogli:

[operations/puppet@production] prometheus/eqsin: remove 5002, add 5003

https://gerrit.wikimedia.org/r/1279254

Mentioned in SAL (#wikimedia-operations) [2026-04-29T12:40:55Z] <tappof> migrate prometheus5002 to prometheus5003 T424024

Change #1279256 merged by Tiziano Fogli:

[operations/dns@master] prometheus/eqsin: update svc record

https://gerrit.wikimedia.org/r/1279256

Change #1279255 merged by Tiziano Fogli:

[operations/puppet@production] prom5003: clean up firewall rules

https://gerrit.wikimedia.org/r/1279255

cookbooks.sre.hosts.decommission executed by tappof@cumin1003 for hosts: prometheus5002.eqsin.wmnet

  • prometheus5002.eqsin.wmnet (PASS)
    • Downtimed host on Icinga/Alertmanager
    • Found Ganeti VM
    • VM shutdown
    • Started forced sync of VMs in Ganeti cluster eqsin to Netbox
    • Removed from DebMonitor
    • Removed from Puppet server and PuppetDB
    • VM removed
    • Started forced sync of VMs in Ganeti cluster eqsin to Netbox
hnowlan subscribed.

can this be resolved?