Bug 1330426

Summary: cache_meta_lv creation should be made optional for lvmcache configuration
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: SATHEESARAN <sasundar>
Component: gdeployAssignee: Nandaja Varma <nvarma>
Status: CLOSED ERRATA QA Contact: SATHEESARAN <sasundar>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rhgs-3.1CC: asrivast, nvarma, rcyriac, rhinduja, smohan, surs
Target Milestone: ---Keywords: ZStream
Target Release: RHGS 3.1.3   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: gdeploy-2.0-13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-23 05:30:25 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: 1311817    

Description SATHEESARAN 2016-04-26 08:42:05 UTC
Description of problem:
-----------------------
lvmcache is created as follows :
1. Create cache_data_lv on SSD
2. Create cache_metadata_lv on SSD
3. Convert the lvs created in step1 & step2 as cache-pool
4. Attach the cache-pool to the thinpool

Currently gdeploy requires the creation of cache_metadata_lv manually.
But this cache_metadata_lv is created automatically based on the size of the cache_data_lv.

So this requirement should be made as optional

Version-Release number of selected component (if applicable):
-------------------------------------------------------------
gdeploy-2.0-6

How reproducible:
-----------------
Always

Steps to Reproduce:
-------------------
1. Create lvmcache using [setup-cache] section in conf file to gdeploy

Actual results:
---------------
cache_meta_lvsize is required

Expected results:
-----------------
cache_meta_lv creation should be skipped, unless the argument cache_meta_lvsize is mentioned in the conf file

Additional info:
----------------
Conf file used :

[lv5]
action=setup-cache
ssd=vdc
vgname=RHS_vg1
poolname=lvthinpool
cache_meta_lv=lvcachemeta
cache_lv=lvcache
cache_meta_lvsize=1GB      <---- should be optional
cache_lvsize=5GB

Comment 2 SATHEESARAN 2016-05-11 10:05:11 UTC
Tested with gdeploy-2.0-11

When cache_meta_lv is omitted in conf file, errors were seen.

TASK: [Setup SSD for caching | Convert an existing logical volume to a cache pool LV] *** 
fatal: [10.70.37.124] => One or more undefined variables: 'cache_meta_lv' is undefined
fatal: [10.70.37.204] => One or more undefined variables: 'cache_meta_lv' is undefined

FATAL: all hosts have already failed -- aborting


But the lv.json has marked the attribute 'cache_meta_lv' as a optional argument
The problem I think is there is no default name for "cache_meta_lv"

{
            "name": "cache_meta_lv",
            "required": "false",
            "default": ""
          },


Whereas the cache_lv has the default name as - "rhs_cache"

{
            "name": "cache_lv",
            "required": "false",
            "default": "rhs_cache"
          }


Also I recommend using 'rhgs' instead of 'rhs'

Comment 3 SATHEESARAN 2016-05-11 10:31:17 UTC
Removing the fixed-in-version as the fix failed verification

Comment 4 SATHEESARAN 2016-05-13 07:26:02 UTC
(In reply to SATHEESARAN from comment #2)
> The problem I think is there is no default name for "cache_meta_lv"
> 
> {
>             "name": "cache_meta_lv",
>             "required": "false",
>             "default": ""
>           },
> 
> 
> Whereas the cache_lv has the default name as - "rhs_cache"
> 
> {
>             "name": "cache_lv",
>             "required": "false",
>             "default": "rhs_cache"
>           }
> 
> 
> Also I recommend using 'rhgs' instead of 'rhs'

I was wrong about this statement.
The default value for cache_meta_lv is not required, as lv will automatically create it with the default name

Comment 5 SATHEESARAN 2016-05-25 07:28:56 UTC
Tested with gdeploy-2.0-16 and able to setup the lvmcache.

Comment 7 errata-xmlrpc 2016-06-23 05:30:25 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, 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/RHEA-2016:1250