Loading

×Sorry to interrupt
Uncaught ReferenceError: addCTracking is not defined
throws at https://kb.vmware.com/resource/KM_TealiumTrackingJS?v=0.5:100:1

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

My Subscriptions

Loading

Knowledge Base

QueryChangedDiskAreas API cannot return changed blocks list after reverting to a preexisting snapshot (71155)

Last Updated: 4/21/2020Categories: InformationalTotal Views: 19024Language:
English

9 like this article

Subscribe to get an email
newsletter with new updates

9 people found this helpful Please provide article feedback:

Symptoms

When users revert a snapshot for a virtual machine that has Changed Block Tracking (CBT) enabled, QueryChangedDiskAreas returns InvalidArgument if the VM is not powered on. The error message is not meaningful to indicate the real failure reason.

Cause

When users revert to a snapshot, it will automatically disable and enable CBT. If the snapshot is not a memory snapshot, enabling CBT will fail and CBT is disabled after reverting.

Resolution

To resolve this issue, re-enable CBT and perform a full backup.

Power on the VM or reconfigure the VM (with "changeTrackingEnabled" true) from mob to re-enable CBT.

Note: Reconfiguring the VM from mob to re-enable CBT is only supported in vSphere 7.0 or later.

You can set

*********************************
<spec>
<!-- optional -->
<changeTrackingEnabled>true</changeTrackingEnabled>
</spec>
*********************************
in "VALUE" block of ReconfigVM_Task and click "Invoke Method" button to reconfigure the VM.
ReconfigVM_Task: https://<IP_Address>/mob/?moid=<VM_Moref>&method=reconfigure

---------------------------------------------------------

Perform a full backup of the VM.

Related Information

Note: Ensure that there are no snapshots on the virtual machine before enabling change tracking. If you create snapshots before enabling CBT, the QueryChangedDiskAreas API might not return any error or the data returned by QueryChangedDiskAreas might be incorrect.

Product version Impact
The issue can occurs in all vSphere versions.

How to detect a snapshot revert operation
See the sample code below for an example of how to query tasks from VM task history is provided in the attachment. It shows how to find tasks of type “RevertToSnapshot_Task” ever happened on a VM “RHELXfsTargetClone_src” in the last 7 days. The VixDiskLib_QueryAllocatedBlocks is available since VDDK 6.7 and later.

--------------------------------------------------------------------
/**
* This class is to demonstrate querying tasks from VM task history.
*/
public class TaskQuery {

/**
* find task of specific type in VM task history
*/
public List<TaskInfo> query(ManagedObjectReference vmRef, Date sinceDate, String taskType) throws Exception {

ServiceContent mSC = …;
VimPortType vimPort = …;
ManagedObjectReference taskManagerRef = mSC.getTaskManager();

//prepare task filter. specify the vmRef as target
TaskFilterSpecByEntity entityFilter = new TaskFilterSpecByEntity();
entityFilter.setEntity(vmRef);
entityFilter.setRecursion(TaskFilterSpecRecursionOption.SELF);

//specify startTime
TaskFilterSpecByTime startTimeFilter = new TaskFilterSpecByTime();
Calendar startTime = Calendar.getInstance();
startTime.setTime(sinceDate);
startTimeFilter.setBeginTime(startTime);
startTimeFilter.setTimeType(TaskFilterSpecTimeOption.STARTED_TIME);

TaskFilterSpec taskFilter = new TaskFilterSpec();
taskFilter.setEntity(entityFilter);
taskFilter.setTime(startTimeFilter);

//do query
ManagedObjectReference taskCollectorRef = vimPort.createCollectorForTasks(taskManagerRef, taskFilter);

List<TaskInfo> taskList = new LinkedList<TaskInfo>();
List<TaskInfo> pageInfo = vimPort.readNextTasks(taskCollectorRef, 100);
while (pageInfo != null && pageInfo.size() != 0) {
taskList.addAll(pageInfo);
pageInfo = vimPort.readNextTasks(taskCollectorRef, 100);
}

List<TaskInfo> retList = new ArrayList<>();
for (TaskInfo task : taskList) {
if (task.getName().equals(taskType)) {
retList.add(task);
}
}

return retList;
}

public static void main(String[] args) throws Exception {
TaskQuery taskQuery = new TaskQuery(context);
Date oneWeekAgo = new Date(System.currentTimeMillis() - 7 * 24 * 3600 * 1000);

ManagedObjectReference vmRef = …;

List<TaskInfo> taskList = taskQuery.query(vmRef, oneWeekAgo, "RevertToSnapshot_Task");
if (taskList.size() > 0) {
System.out.println("RevertSnapshot tasks have been triggered on the vm.");
}
}
}
--------------------------------------------------------------------

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
English

Attachments

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

KB
•
Download and Install VMware Fusion (2014097)

KB
•
「次のサービスの証明書とキーを取得できませんでした: vpxd-extension (Could not retrieve certificate and key for service: vpxd-extension)」というエラーが発生して vmware-rbd-watchdog サービスの起動に失敗する (70850)

Results 1-3 of 3

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware SDK Support

Related Versions:

Take Our Survey

Support Assistant