Bug 1519535

Summary: Required space check is calculated incorrectly when there are mounted volumes
Product: Red Hat Satellite Reporter: sthirugn <sthirugn>
Component: Satellite CloneAssignee: John Mitsch <jomitsch>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, gsnead, rankumar
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-03 13:08:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1533259    

Description sthirugn@redhat.com 2017-11-30 20:54:59 UTC
Description of problem:
Required space check is calculated incorrectly when there are mounted volumes

Version-Release number of selected component (if applicable):
satellite-clone-1.1.4-1.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
Code in pre_install_check.yml:

- name: find root partition's free space
  set_fact:
    root_free_space: "{{ (item.size_available | int) / 1000000000 }}"
    cacheable: true
  when: item.mount == "/"
  with_items: "{{ hostvars[inventory_hostname] ['ansible_mounts'] }}"

The above logic ignores the mounted volume space so an error is thrown although the user has enough space on the mounted volumes.

Sample file system where this check failed:
$ df -h
Filesystem                          Size  Used Avail Use% Mounted on
/dev/mapper/root_vg-root_lv         2.0G   74M  2.0G   4% /
/dev/mapper/root_vg-usr_lv          6.0G  2.1G  4.0G  35% /usr
/dev/mapper/root_vg-home_lv         2.0G   33M  2.0G   2% /home
/dev/mapper/root_vg-var_lv          6.0G  2.2G  3.9G  36% /var
/dev/mapper/data_vg-rhsatVarLib_lv  800G  184M  800G   1% /var/lib

Actual results:
Space check failed although mounted volumes had a lot of space.

Expected results:
Space check logic should consider the mounted volumes too.

Additional info:

Comment 2 sthirugn@redhat.com 2018-01-02 16:47:39 UTC
Workaround: Go to /etc/satellite-clone/satellite-clone-vars.yml -> Change the value of `required_root_free_space` to 0

Comment 3 sthirugn@redhat.com 2018-01-02 16:49:05 UTC
*** Bug 1523790 has been marked as a duplicate of this bug. ***

Comment 4 Glenn Snead 2018-01-02 17:14:03 UTC
As my bug (1523790) was merged into this one, I'd add this:

Per the 6.3 beta document, Upgrading and Updating Red Hat Satellite, the Before You Begin (2.1.2) section says this:

The target server must have capacity to store the backup files, which the source server transfers to the target server, and the backup files when they are restored.

This document does not say how much space the source server should have, or how to calculate how much space to provision.  The command line entry only suggests an output directory of /backup/

In section 2.1.4, Step 10:  The satellite-clone command does not specify which server the administrator should use.

Comment 5 sthirugn@redhat.com 2018-01-15 20:30:53 UTC
*** Bug 1523495 has been marked as a duplicate of this bug. ***

Comment 7 John Mitsch 2018-02-02 17:43:22 UTC
upstream PR merged

Comment 8 sthirugn@redhat.com 2018-04-03 13:08:14 UTC
Space check is already removed in production in current release.  This bug is not applicable anymore.