Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VMBackup/main/freezesnapshotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def update_snapshotinfoarray(self, blob_snapshot_info_array):
blob_snapshot_info.snapshotUri = None
creationTimeStr = '\\/Date(' + blob_snapshot_info.ddSnapshotIdentifier.creationTime + ')\\/'
creationTimeObj = Status.CreationTime(creationTimeStr, 0)
ddSnapshotIdentifierInfo = Status.DirectDriveSnapshotIdentifier(creationTimeObj, blob_snapshot_info.ddSnapshotIdentifier.id, blob_snapshot_info.ddSnapshotIdentifier.token)
ddSnapshotIdentifierInfo = Status.DirectDriveSnapshotIdentifier(creationTimeObj, blob_snapshot_info.ddSnapshotIdentifier.id, blob_snapshot_info.ddSnapshotIdentifier.token, blob_snapshot_info.ddSnapshotIdentifier.instantAccessDurationMinutes)
self.logger.log("DDSnapshotIdentifier Information to CRP- creationTime : {0}, id : {1}".format(ddSnapshotIdentifierInfo.creationTime.DateTime, ddSnapshotIdentifierInfo.id))
else:
self.logger.log("No DD Snapshot Identifier Found. Hence directDriveSnapshotIdentifier will be Null")
Expand Down
15 changes: 9 additions & 6 deletions VMBackup/main/hostsnapshotter.py

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??

Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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']:
Copy link
Contributor

@arisettisanjana arisettisanjana Nov 27, 2025

Choose a reason for hiding this comment

The 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")
Expand Down