Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 12, 2026

Description

Adds ability to modify cluster name after deployment for managing keep/owner tags.

Changes

  • New method: ScyllaCloudCluster.update_cluster_name(new_name: str)
    • Validates cluster ID exists and name ≤ 63 chars
    • Updates via existing API client method
    • Syncs local cluster.name attribute
  • Unit tests: 3 test cases covering success path, error handling, and edge cases

Usage

# Add keep tag
cluster.update_cluster_name("my-cluster-abc12345-keep-24h")

# Remove keep tag  
cluster.update_cluster_name("my-cluster-abc12345")

Uses updateClusterName API endpoint.

Testing

  • Unit tests added (test_cluster_cloud.py::TestScyllaCloudClusterUpdateName)
  • changing a cluster name in runtime:
>>> self._api_client.get_cluster_details(account_id=self._account_id, cluster_id=self._cluster_id)['clusterName']
'PR-provision-test-dmytro_kruglov-d2aa4594-keep-004h'

>>> self.update_cluster_name('new_cluster_name')
< t:2026-01-13 00:09:11,723 f:cluster_cloud.py l:976  c:sdcm.cluster         p:INFO  > ScyllaCloudCluster:db-cluster-d2aa4594: Updating cluster name from 'db-cluster-d2aa4594' to 'new_cluster_name'
< t:2026-01-13 00:09:12,131 f:cluster_cloud.py l:981  c:sdcm.cluster         p:INFO  > ScyllaCloudCluster:db-cluster-d2aa4594: Cluster name updated successfully to 'new_cluster_name'

>>> self._api_client.get_cluster_details(account_id=self._account_id, cluster_id=self._cluster_id)['clusterName']
'new_cluster_name'

PR pre-checks (self review)

  • I added the relevant backport labels
  • I didn't leave commented-out/debugging code

Reminders

  • Add New configuration option and document them (in sdcm/sct_config.py)
  • Add unit tests to cover my changes (under unit-test/ folder)
  • Update the Readme/doc folder relevant to this change (if needed)
Original prompt

This section details on the original issue you should resolve

<issue_title>[scylla-cloud] add ability to modify name of a live cluster</issue_title>
<issue_description>We need to be able to update name of a cluster after it is deployed, e.g. for the purpose of adding or deleting keep and/or owner tags info. https://cloud.docs.scylladb.com/stable/api.html#tag/Cluster/operation/updateClusterName public API method should be used for that.

We can add a new method to sdcm.cluster_cloud.ScyllaCloudCluster, or a new hydra command, or both.</issue_description>

<agent_instructions>Implement the change name method for cluster object, no need for hydra command for now.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

  • Fixes scylladb/qa-tasks#2007

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add ability to modify name of a live cluster feature(cluster-cloud): add update_cluster_name method Jan 12, 2026
Copilot AI requested a review from dimakr January 12, 2026 21:50
@dimakr dimakr added the backport/none Backport is not required label Jan 12, 2026
@dimakr dimakr force-pushed the copilot/add-cluster-name-modification branch from 71433bd to 50c6788 Compare January 12, 2026 23:25
@dimakr dimakr changed the title feature(cluster-cloud): add update_cluster_name method improvement(xcloud): add update_cluster_name method Jan 12, 2026
@dimakr dimakr marked this pull request as ready for review January 12, 2026 23:51
@dimakr dimakr requested a review from a team January 12, 2026 23:51
self.log.info("Resizing cluster to add %s nodes", count)
raise NotImplementedError("Not yet implemented in POC")

def update_cluster_name(self, new_name: str) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would assume we now can implement those two ?

    # For cloud clusters, the keep duration is calculated and set during cluster creation.
    # _set_keep_alive and _set_keep_duration methods in base classes are invoked after cluster
    # creation, during nodes init, when it is already late to modify cluster details.
    # The basic implementations of these methods remain here for backward compatibility.
    def _set_keep_alive(self) -> bool:
        return True

    def _set_keep_duration(self, duration_in_hours: int) -> None:
        pass

since we are using are using poorsman tagging within the name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should touch these.
first - these methods are on the node level in base classes, and for xcloud cluster we do not / cannot manage names of individual nodes, only of the whole cluster.

If we implement these helpers somehow for cluster level, it would not bring much value - it would rather add additional API requests, as cluster name is set during initial cloud cluster create API request anyway. With these 2 implemented for xcloud we would be doing extra API requests to achieve the same result we have now.

but the main concern - it's better to set keep-Nh tag earlier in the test, so that if something bad happens between cluster creation (that would interrupt the test completely) and the moment we run init on SCT objects (like these 2 methods are used now in the base classes), we already have cluster prepared/named for automated cleanup

Added update_cluster_name method to ScyllaCloudCluster class that allows
modifying the cluster name after deployment. This is useful for adding
or removing keep and owner tags information.

Closes: scylladb/qa-tasks#2007
@dimakr dimakr force-pushed the copilot/add-cluster-name-modification branch from 50c6788 to c6304a1 Compare January 20, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/none Backport is not required migrate_to_jira P3 Medium Priority size/small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants