-
Notifications
You must be signed in to change notification settings - Fork 262
[Instant Access DD Snapshot] Pre Snapshot and Do Snapshot API Changes #2121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
deveshjagwani
wants to merge
1
commit into
dev/dejagwan/DDAndIAProperties
Choose a base branch
from
dev/dejagwan/DDAndIALogic
base: dev/dejagwan/DDAndIAProperties
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,7 +81,7 @@ def snapshotall(self, paras, freezer, g_fsfreeze_on, taskId): | |
| settings.append({CommonVariables.key:CommonVariables.isOsDiskADEEncrypted, CommonVariables.value:paras.isOsDiskADEEncrypted}) | ||
| settings.append({CommonVariables.key:CommonVariables.areDataDisksADEEncrypted, CommonVariables.value:paras.areDataDisksADEEncrypted}) | ||
| meta_data.append({CommonVariables.key:CommonVariables.encryptionDetails, CommonVariables.value:paras.encryptionDetails}) | ||
| hostDoSnapshotRequestBodyObj = HostSnapshotObjects.HostDoSnapshotRequestBody(taskId, diskIds, settings, paras.snapshotTaskToken, meta_data) | ||
| hostDoSnapshotRequestBodyObj = HostSnapshotObjects.HostDoSnapshotRequestBody(taskId, diskIds, settings, paras.snapshotTaskToken, meta_data, paras.instantAccessDurationMinutes) | ||
| body_content = json.dumps(hostDoSnapshotRequestBodyObj, cls = HandlerUtil.ComplexEncoder) | ||
| redactedRequestBodyObj = self.hutil.redact_sensitive_encryption_details(hostDoSnapshotRequestBodyObj) | ||
| redacted_body_content = json.dumps(redactedRequestBodyObj, cls = HandlerUtil.ComplexEncoder) | ||
|
|
@@ -119,7 +119,7 @@ def snapshotall(self, paras, freezer, g_fsfreeze_on, taskId): | |
| else: | ||
| # HttpCall failed | ||
| HandlerUtil.HandlerUtility.add_to_telemetery_data(CommonVariables.hostStatusCodeDoSnapshot, str(555)) | ||
| self.logger.log("presnapshot Hitting wrong WireServer IP") | ||
| self.logger.log("dosnapshot Hitting wrong WireServer IP") | ||
| except Exception as e: | ||
| errorMsg = "Failed to do the snapshot in host with error: %s, stack trace: %s" % (str(e), traceback.format_exc()) | ||
| self.logger.log(errorMsg, False, 'Error') | ||
|
|
@@ -152,9 +152,9 @@ def pre_snapshot(self, paras, taskId, fetch_disk_details = False): | |
| temp_dict[CommonVariables.key] = CommonVariables.isVMADEEnabled | ||
| temp_dict[CommonVariables.value] = paras.isVMADEEnabled | ||
| preSnapshotSettings.append(temp_dict) | ||
| hostPreSnapshotRequestBodyObj = HostSnapshotObjects.HostPreSnapshotRequestBody(taskId, paras.snapshotTaskToken, preSnapshotSettings) | ||
| hostPreSnapshotRequestBodyObj = HostSnapshotObjects.HostPreSnapshotRequestBody(taskId, paras.snapshotTaskToken, preSnapshotSettings, paras.instantAccessDurationMinutes) | ||
| else: | ||
| hostPreSnapshotRequestBodyObj = HostSnapshotObjects.HostPreSnapshotRequestBody(taskId, paras.snapshotTaskToken) | ||
| hostPreSnapshotRequestBodyObj = HostSnapshotObjects.HostPreSnapshotRequestBody(taskId, paras.snapshotTaskToken, instantAccessDurationMinutes = paras.instantAccessDurationMinutes) | ||
| body_content = json.dumps(hostPreSnapshotRequestBodyObj, cls = HandlerUtil.ComplexEncoder) | ||
| self.logger.log('Headers : ' + str(headers)) | ||
| self.logger.log('Host Request body : ' + str(body_content)) | ||
|
|
@@ -231,8 +231,11 @@ def get_snapshot_info(self, responseBody): | |
| self.logger.log("Converting the creationTime string received in UTC format to UTC Ticks") | ||
| delta = creationTimeObj - epochTime | ||
| timestamp = self.get_total_seconds(delta) | ||
| creationTimeUTCTicks = str(int(timestamp * 1000)) | ||
| ddSnapshotIdentifierInfo = HostSnapshotObjects.DDSnapshotIdentifier(creationTimeUTCTicks , snapshot_info['ddSnapshotIdentifier']['id'], snapshot_info['ddSnapshotIdentifier']['token']) | ||
| creationTimeUTCTicks = str(int(timestamp * 1000)) | ||
| instantAccessDurationMinutes = None | ||
| if 'instantAccessDurationMinutes' in snapshot_info['ddSnapshotIdentifier']: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we use the constant instantAccessDurationMinutes defined in common.py in lines 236 and 237 also while accessing the property |
||
| instantAccessDurationMinutes = snapshot_info['ddSnapshotIdentifier']['instantAccessDurationMinutes'] | ||
| ddSnapshotIdentifierInfo = HostSnapshotObjects.DDSnapshotIdentifier(creationTimeUTCTicks , snapshot_info['ddSnapshotIdentifier']['id'], snapshot_info['ddSnapshotIdentifier']['token'], instantAccessDurationMinutes) | ||
| self.logger.log("ddSnapshotIdentifier Information from Host- creationTime : {0}, id : {1}".format(ddSnapshotIdentifierInfo.creationTime, ddSnapshotIdentifierInfo.id)) | ||
| else: | ||
| self.logger.log("ddSnapshotIdentifier absent/None in Host Response") | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need any changes in processing the response from BHS, generally in Linux extension code what do we follow??