Changeset 79306 in vbox for trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
- Timestamp:
- Jun 24, 2019 11:31:56 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r79171 r79306 1852 1852 else 1853 1853 { 1854 /* Just skip the rest images if they exist. Only the first image is used as the base image. */ 1855 if (currImageObjectNum >= 1) 1856 continue; 1857 1854 1858 /* Image format is supported by VBox so extract the file and try to convert 1855 1859 * one to the default format (which is VMDK for now) */ … … 2167 2171 while (++currOperation < operationCount) 2168 2172 { 2169 pTask->pProgress->SetNextOperation(BstrFmt("Skipping the cleanup phase. All right.").raw(), 25);2173 pTask->pProgress->SetNextOperation(BstrFmt("Skipping the cleanup phase. All right.").raw(), 1); 2170 2174 LogRel(("%s: Skipping the cleanup step %d\n", __FUNCTION__, currOperation)); 2171 2175 } … … 3035 3039 * 3. Download the object from the Object Storage: 3036 3040 * - 1 operation (starting and downloadind is one operation) 3037 * 4. Open the object, extract QCOW2 image and convert one QCOW2->VDI:3041 * 4. Open the object, extract an image and convert one to VDI: 3038 3042 * - 1 operation (extracting and conversion are piped) because only 1 base bootable image is imported for now 3039 3043 * 5. Create VM with user settings and attach the converted image to VM: … … 3045 3049 * Both require a new Progress object. To work with these functions the original Progress object uses 3046 3050 * the function Progress::waitForOtherProgressCompletion(). 3047 * Example 1:3048 * 1 image was registered in the VBox, 1 VM was created and image was attahced. Next something fails3049 * and we should clean up the disk space. Machine::unregister() return the list of HDDs for deletion.3050 * Machine::deleteConfig() deletes these HDDs but except this a VM setting file, a previous VM setting3051 * file, the snapshots are also deleted. And the original Progress should count these steps correctly.3052 * In this example we will have only couple additional files - VM setting files. As result we3053 * speculate that the number of cleanup operations will be 3: 1 image + 1 setting file + 1 prev setting file.3054 * No snapshots and logs here. But possible situation when the image wasn't attached due to some error.3055 * Thus the number of operations will be 2 instead of 3 (VM registered but no HDDs).3056 * Example 2:3057 * 1 image was registered in the VBox, VM wasn't created due to an error. Here we have only3058 * 1 operation which uses Progress it's Medium::deleteStorage(). Loop with one interation.3059 3051 * 3060 * The problem here is in that we don't know exactly how many operations will be when Progress has been 3061 * setting up here. We just may speculate. 3052 * Some speculation here... 3053 * Total: 2+2+1(cloud) + 1+1(local) + 1+1+1(cleanup) = 10 operations 3054 * or 3055 * Total: 2+2+1(cloud) + 1+1(local) + 1(cleanup) = 8 operations 3056 * if VM wasn't created we would have only 1 registered image for cleanup. 3062 3057 * 3063 * What to do if the number of the imported images will be more than 1 in the future? 3064 * What to do if some cloud operations won't be needed for the other Cloud providers? 3065 * What to do if the number of cloud operations will differ among Cloud providers? 3066 * Only Cloud provider shall know the answer on the last two questions. 3067 * As result, we speculate about tne number of the operations in the Cloud and we speculate 3068 * about the number of the local operations. 3069 * 3070 * Total: 2+2+1(cloud) + 1+1(local) + 1+1+1(cleanup) = 10 operations 3071 * 3072 * Weight "#define"s for the CLoud operations are located in the file OCICloudClient.h. 3058 * Weight "#define"s for the Cloud operations are located in the file OCICloudClient.h. 3073 3059 * Weight of cloud import operations (1-3 items from above): 3074 3060 * Total = 750 = 25+75(start and wait)+25+375(start and wait)+250(download) … … 3079 3065 * Weight of local cleanup operations (6 item from above): 3080 3066 * Some speculation here... 3081 * Total = 100 = 50 (1 image) + 25 (1 setting file)+ 25 (1 prev setting file) 3067 * Total = 3 = 1 (1 image) + 1 (1 setting file)+ 1 (1 prev setting file) - quick operations 3068 * or 3069 * Total = 1 (1 image) if VM wasn't created we would have only 1 registered image for now. 3082 3070 */ 3083 3071 try … … 3090 3078 10, // ULONG cOperations, 3091 3079 1000, // ULONG ulTotalOperationsWeight, 3092 Utf8Str(tr(" Importing VM fromCloud...")), // aFirstOperationDescription3093 10); // ULONG ulFirstOperationWeight3080 Utf8Str(tr("Start import VM from the Cloud...")), // aFirstOperationDescription 3081 25); // ULONG ulFirstOperationWeight 3094 3082 if (SUCCEEDED(rc)) 3095 3083 pTask = new TaskCloud(this, TaskCloud::Import, locInfo, progress);
Note:
See TracChangeset
for help on using the changeset viewer.