cloudbase / rct-service

REST Service for the Hyper-V RCT API
Apache License 2.0
4 stars 0 forks source link

Question - Is there a way to query allocated blocks on a Dynamically Expanding VHD / VHDX ? #2

Open anand2404 opened 3 years ago

anand2404 commented 3 years ago

Hi,

Can you please clarify if you found a way to query allocated blocks on a Dynamically Expanding VHD / VHDX for the very first backup or for any full backup that one may want to do (say, after a data corruption detection etc) ?

Or in other words, if there is a Dynamically Expanding VHD of 50 GB logical size (i.e. the disk it represents can store up to 50 GB data, expanding as needed) with 10 GB data written to it. Is there a way to find the blocks corresponding to this 10 GB data ?

I happened to follow another questioner's thread Like the other thread, I am also not proficient in python, so I have not been able to test your code to find out the answer that I am seeking.

In the MSFT link on that question, there is a response from "baluT-1942", which triggered further discussions, but did not conclude on that forum. It was mentioned that :

 //to get incr changes we used rct id like this L"rctX:c2eb01d9:ccb1:405d:acb6:f0e76d055906:00000001";
 //to get allocated blocks for full backup we used rct is as "*", "0", etc.
 std::wcout << "\nQuerying for changed disk areas..." << rctId << std::endl;

I saw the above comment and tried those things out (i.e. tried with RCT ID as "0" and "*" from C++ code) with no luck. RCT query failed with the following error ERROR_VHD_INVALID_CHANGE_TRACKING_ID (0xc03a0029) : The specified change tracking identifier is not valid.

Wanted to check if you were able to crack this challenge ? I saw that the python client readme says :

The RCT ID is optional, if not provided the entire disk content is retrieved.

Does this get only the "used" contents or does it get all the content (like one would get if the disk is attached in Disk Management, with 0-filled data for the blocks that are not being used) ?

I know there are some other ways to get what I need but those ways are cumbersome compared to having an API that gives that info (like there are APIs for such info from other hypervisors such as ESXi and AHV).

cwoljcq commented 3 years ago

@anand2404 Same question as you. Do you find anything helpful?

Does this get only the "used" contents or does it get all the content (like one would get if the disk is attached in Disk Management, with 0-filled data for the blocks that are not being used) ?

This lib just read all the content including 0-filled data.

anand2404 commented 3 years ago

@cwoljcq - I have not been able to find anything helpful till now. Please do comment here if you find something.