Skip to content

Commit

Permalink
fix(Azure): enable WaLinuxAgent
Browse files Browse the repository at this point in the history
Linux agent on Scylla instances on Azure is disabled by default.
scylladb/scylla-machine-image#627

Add cloud init script that enables it back for testing purposes.
  • Loading branch information
soyacz committed Feb 11, 2025
1 parent cdc23d6 commit 38db768
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sdcm/sct_provision/region_definition_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from sdcm.sct_provision.user_data_objects.scylla import ScyllaUserDataObject
from sdcm.sct_provision.user_data_objects.sshd import SshdUserDataObject
from sdcm.sct_provision.user_data_objects.syslog_ng import SyslogNgUserDataObject, SyslogNgExporterUserDataObject
from sdcm.sct_provision.user_data_objects.walinuxagent import EnableWaLinuxAgent
from sdcm.test_config import TestConfig


Expand Down Expand Up @@ -147,6 +148,7 @@ def _get_user_data_objects(self, instance_name: str, node_type: NodeTypeType) ->
SyslogNgUserDataObject,
SyslogNgExporterUserDataObject,
SshdUserDataObject,
EnableWaLinuxAgent,
ScyllaUserDataObject,
]
user_data_objects = [
Expand Down
37 changes: 37 additions & 0 deletions sdcm/sct_provision/user_data_objects/walinuxagent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See LICENSE for more details.
#
# Copyright (c) 2025 ScyllaDB
from dataclasses import dataclass
from textwrap import dedent

from sdcm.sct_provision.user_data_objects import SctUserDataObject


@dataclass
class EnableWaLinuxAgent(SctUserDataObject):
"""
Scylla machines on Azure have WaLinuxAgent disabled by default. This script enables it.
https://github.com/scylladb/scylla-machine-image/pull/627
"""
@property
def is_applicable(self) -> bool:
return self.node_type == "scylla-db" and self.params.get("cluster_backend") == "azure"

@property
def script_to_run(self) -> str:
return dedent("""
systemctl daemon-reload
systemctl unmask walinuxagent
systemctl enable walinuxagent
systemctl start walinuxagent
systemctl status walinuxagent --no-pager
""")

0 comments on commit 38db768

Please sign in to comment.