Skip to content

Commit

Permalink
[BACKPORT 2.20.2][PLAT-12911] Fixing pause/resume for disks not mount…
Browse files Browse the repository at this point in the history
…ed by UUID

Summary:
Original commit: 308af1f / D32735
Issue with pause/resume when universes disks were not mounted by UUID. We were trying to call self.cloud.get_device_names without the host_info, which for AWS was made required as part of https://phorge.dev.yugabyte.com/D31847. This diff overrides getting device names for AWS only to use host_info.

Test Plan: patch diff on portal where failure occurred and retry pause/resume

Reviewers: anijhawan, dshubin, yshchetinin, nbhatia

Reviewed By: anijhawan

Subscribers: aaruj, yugaware

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D32759
  • Loading branch information
mchiddy committed Feb 29, 2024
1 parent e3718ec commit 40aaf25
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion managed/devops/opscli/ybops/cloud/aws/cloud.py
Expand Up @@ -464,7 +464,7 @@ def get_host_info_specific_args(self, region, search_pattern, get_all=False,
results.append(result)
return results

def get_device_names(self, args, host_info):
def get_device_names(self, args, host_info=None):
if has_ephemerals(args.instance_type, args.region):
return []
else:
Expand Down
5 changes: 4 additions & 1 deletion managed/devops/opscli/ybops/cloud/aws/method.py
Expand Up @@ -136,7 +136,7 @@ def update_ansible_vars_with_args(self, args):
self.extra_vars["mount_points"] = self.cloud.get_mount_points_csv(args)
self.extra_vars.update({"aws_key_pair_name": args.key_pair_name})

def get_device_names(self, args, host_info):
def get_device_names(self, args, host_info=None):
return self.cloud.get_device_names(args, host_info)


Expand Down Expand Up @@ -573,3 +573,6 @@ def add_extra_args(self):
super(AwsUpdateMountedDisksMethod, self).add_extra_args()
self.parser.add_argument("--volume_type", choices=["gp3", "gp2", "io1"], default="gp2",
help="Volume type for volumes on EBS-backed instances.")

def get_device_names(self, args, host_info=None):
return self.cloud.get_device_names(args, host_info)
10 changes: 8 additions & 2 deletions managed/devops/opscli/ybops/cloud/common/method.py
Expand Up @@ -848,7 +848,7 @@ def callback(self, args):
host_port_user["user"],
host_port_user["port"]))

def get_device_names(self, args, host_info):
def get_device_names(self, args, host_info=None):
return self.cloud.get_device_names(args)

def update_ansible_vars(self, args):
Expand Down Expand Up @@ -1035,13 +1035,19 @@ def __init__(self, base_command):

def update_ansible_vars_with_args(self, args):
super(UpdateMountedDisksMethod, self).update_ansible_vars_with_args(args)
self.extra_vars["device_names"] = self.cloud.get_device_names(args)

def get_device_names(args, host_info=None):
self.cloud.get_device_names(args)

def callback(self, args):
# Need to verify that all disks are mounted by UUUID
host_info = self.cloud.get_host_info(args)
if not host_info:
raise YBOpsRuntimeError("Could not find host {} to provision!".format(
args.search_pattern))
ansible = self.cloud.setup_ansible(args)
self.update_ansible_vars_with_args(args)
self.extra_vars["device_names"] = self.get_device_names(args, host_info)
self.extra_vars.update(self.get_server_host_port(host_info, args.custom_ssh_port))
ansible.playbook_args["remote_role"] = "mount_ephemeral_drives"
logging.debug(pprint(self.extra_vars))
Expand Down

0 comments on commit 40aaf25

Please sign in to comment.