VM Import Controller uses too much memory during QCOW2 conversion phase #51
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.
Problem:
After successful creation of the image in OpenStack, VM Import Controller initiates the download of the image in Harvester.
It seems to happen in two steps:
qcow2-img convert
to RAW.Seems to be happening here.
This results in memory usage proportional to the QCOW2 image. More exactly, the
qcow2-img convert
command seems also to use memory, causing the total memory usage to reach : 2x , so for an image of 500Gi, VM Import Controller would need 1TiB of RAM!!The first step can definitely be avoided.
Solution:
Related Issue:
harvester/harvester#6674
Test plan:
harvester-vm-import-controller-xxxx
pod is running.ps aux | grep vm-import-controller
to get the PID of this process.top -p <PID_OF_VM_IMPORT_CONTROLLER>
to monitor the memory consumption.openstack_vmi_cirros-tiny.yaml
:k apply -f openstack_vmi_cirros-tiny.yaml
.The
top
output should not look like this during the download of the image:Because the download and writing of the image is done in junks, the memory consumption should be really low like:
The final log output of the import should look like: