Bug 1821425 - Hosted Engine deployment is using wrong size/space checks
Summary: Hosted Engine deployment is using wrong size/space checks
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-ansible-roles
Version: 4.3.9
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.4.3
: 4.4.3
Assignee: Asaf Rachmani
QA Contact: Nikolai Sednev
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-06 19:36 UTC by Jaroslav Spanko
Modified: 2023-09-07 22:42 UTC (History)
3 users (show)

Fixed In Version: ovirt-ansible-collection-1.2.0-0.3
Doc Type: Bug Fix
Doc Text:
Previously, when deploying Self-Hosted Engine, the Appliance size was not estimated correctly, and as a result, not enough space was allotted, and unpacking the Appliance failed. In this release, the Appliance size estimation and unpacking space allotment are correct, and deployment succeeds.
Clone Of:
Environment:
Last Closed: 2020-11-24 13:10:38 UTC
oVirt Team: Integration
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-ansible-collection pull 130 0 None closed roles: hosted_engine_setup: Use zcat instead of gzip 2021-02-04 19:27:17 UTC
Red Hat Product Errata RHBA-2020:5212 0 None None None 2020-11-24 13:10:45 UTC

Description Jaroslav Spanko 2020-04-06 19:36:02 UTC
Description of problem:
Hosted Engine deployment fails with failed to unpack message due to not enough space available. But in the hosted-engine log checks went fine

----
[ < 1 sec ]     Check available space on local VM directory
[ < 1 sec ]     Check appliance size
[ < 1 sec ]     Ensure we have enough space to extract the appliance
[ FAILED  ]     Extract appliance to local VM directory
----
Version-Release number of selected component (if applicable):
ovirt-hosted-engine-setup-2.3.13-1.el7ev.noarch 

How reproducible:
100%

Steps to Reproduce:
1. /var/ has available 3GB
2. run hosted-engine deploy
3. Size check are ok but deployment fails due to not enough space to extract appliance

Actual results:
Deployment fails due to not enough space to extract appliance

Expected results:
Size checks should handle this as mentioned in Documentation
----
If you are also installing the RHV-M Appliance for self-hosted engine installation, /var/tmp must be at least 5 GB. 
----

Additional info:

Looking to the setup logs we can see available space calculation
-----
DEBUG var changed: host "localhost" var "local_vm_dir_space_out" type "<type 'dict'>" value: "{
    "changed": true,
    "cmd": "df -k --output=avail \"/var/tmp\" | grep -v Avail | cat",
    "stderr": "",
    "stderr_lines": [],
    "stdout": "3369048",
    "stdout_lines": [
        "3369048"
    ]
}"
-----

And that appliance space calculation
-----
2020-04-06 14:53:00,455+0200 DEBUG var changed: host "localhost" var "appliance_size" type "<type 'dict'>" value: "{
    "changed": true,
    "cmd": "gzip -l \"/usr/share/ovirt-engine-appliance/rhvm-appliance-4.3-20200317.0.el7.ova\" | grep -v uncompressed | awk '{print $2}'",
    "delta": "0:00:00.004485",
    "end": "2020-04-06 14:53:00.075119",
    "stderr_lines": [],
    "stdout": "688011264",
    "stdout_lines": [
        "688011264"
    ]
}"

Which is ok 3290MB > 721MB
----
 - name: Ensure we have enough space to extract the appliance
        assert:
          that:
            - "local_vm_dir_space_out.stdout_lines[0]|int * 1024 > appliance_size.stdout_lines[0]|int * 1.1"
          msg: >
            {{ he_local_vm_dir_path }} doesn't provide enough free space to extract the
            engine appliance: {{ local_vm_dir_space_out.stdout_lines[0]|int / 1024 | int }} Mb
            are available while {{ appliance_size.stdout_lines[0]|int / 1024 / 1024 * 1.1 | int }} Mb
            are required.
----

But gtar fails due to not enough space available as it needs at least 5GB to succesfull deployment, once is /var extended deployment works fine.
----
[ ERROR ] fatal: [localhost]: FAILED! => {"changed": false, "dest": "/var/tmp/localvmFj9li4", "extract_results": {"cmd": ["/bin/gtar", "--extract", "-C", "/var/tmp/localvmFj9li4", "-z", "--show-transformed-names", "--sparse", "-f", "/usr/share/ovirt-engine-appliance/rhvm-appliance-4.3-20200317.0.el7.ova"], "err": "/bin/gtar: images/5e30a8db-2787-421d-b8b6-7b397c3b93c8/85cd81dc-f950-43f8-8456-311ce5bb926b: Wrote only 4096 of 10240 bytes\n/bin/gtar: Exiting with failure status due to previous errors\n", "out": "", "rc": 2}, "gid": 36, "group": "kvm", "handler": "TgzArchive", "mode": "0775", "msg": "failed to unpack /usr/share/ovirt-engine-appliance/rhvm-appliance-4.3-20200317.0.el7.ova to /var/tmp/localvmFj9li4", "owner": "vdsm", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 4096, "src": "/usr/share/ovirt-engine-appliance/rhvm-appliance-4.3-20200317.0.el7.ova", "state": "directory", "uid": 36}
----

Does /var/tmp vs appliance size make sense as extration fails due to not enough space ?

Comment 2 Michal Skrivanek 2020-04-07 07:50:36 UTC
gzip output is completely misleading
it should rather use tar listing to get the size of the disk

Comment 3 Michal Skrivanek 2020-04-07 07:53:34 UTC
or use tar on the first megabyte of the archive, extract the ovf and get it from there.

Comment 7 Nikolai Sednev 2020-10-26 11:56:20 UTC
Works fine on ovirt-ansible-collection-1.2.0-0.3.el8ev.noarch

Comment 14 errata-xmlrpc 2020-11-24 13:10:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (RHV Engine and Host Common Packages 4.4.z [ovirt-4.4.3]), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:5212


Note You need to log in before you can comment on or make changes to this bug.