Bug 1214799

Summary: [HC] Permission settings on the specified path do not allow access to the storage
Product: [Retired] oVirt Reporter: Sandro Bonazzola <sbonazzo>
Component: ovirt-hosted-engine-setupAssignee: Sandro Bonazzola <sbonazzo>
Status: CLOSED INSUFFICIENT_DATA QA Contact: meital avital <mavital>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 3.6CC: bugs, ecohen, gklein, lsurette, nsoffer, pkliczew, rbalakri, sbonazzo, stirabos, yeylon
Target Milestone: ---Keywords: DevelBlocker
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: integration
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-24 10:27:10 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: 1175354    

Description Sandro Bonazzola 2015-04-23 14:42:26 UTC
New error while creating gluster storage domain never seen before: http://fpaste.org/214774/

Thread-32::ERROR::2015-04-23 16:30:32,162::dispatcher::76::Storage.Dispatcher::(wrapper) {'status': {'message': "Permission settings on the specified path do not allow access to the storage. Verify permission settings on the specified storage path.: 'path = /rhev/data-center/mnt/glusterSD/minidell.home:_hosted__engine__glusterfs'", 'code': 469}}

looking at the previous lines in the fpaste I see 

Permission denied for directory: /rhev/data-center/mnt/glusterSD/minidell.home:_hosted__engine__glusterfs with permissions:7

and 7 was the storage type specified in the create command:

createStorageDomain(storageType=7, sdUUID='3ff99ad2-402d-4a20-9e11-29c27cf41bec', domainName='hosted_storage', typeSpecificArg='minidell.home:/hosted_engine_glusterfs', domClass=1, domVersion=3, options=None)

this make me think something broken again in the API.
Nir, can you take a look?

Comment 1 Sandro Bonazzola 2015-04-23 15:04:35 UTC
##
# @StorageDomain.create:
#
# Create a new Storage Domain.
#
# @storagedomainID:  The UUID of the Storage Domain
#
# @domainType:       The type of backing storage used by the Storage Domain
#
# @typeArgs:         Type specific backing storage specifier
#
# @name:             A human-readable name
#
# @domainClass:      The Storage Domain Class
#
# @version:          #optional The Storage Domain version that should be used
#
# Since: 4.10.0
##
{'command': {'class': 'StorageDomain', 'name': 'create'},
 'data': {'storagedomainID': 'UUID', 'domainType': 'StorageDomainType',
          'typeArgs': 'StorageDomainCreateArguments', 'name': 'str',
          'domainClass': 'StorageDomainImageClass', '*version': 'int'}}

##
# @StorageDomainType:
#
# An enumeration of Storage Domain types.
#
# @UNKNOWN:   The type is not known
#
# @NFS:       The Storage Domain uses Network File System based storage
#
# @FCP:       The Storage Domain uses FibreChannel based storage
#
# @ISCSI:     The Storage Domain uses iSCSI based storage
#
# @LOCALFS:   The Storage Domain uses storage on the local file system
#
# @CIFS:      The Storage Domain uses CIFS/SMB based storage
#
# @SHAREDFS:  The Storage Domain uses storage from a Linux VFS file system
#
# Since: 4.10.0
# XXX: Need to specify explicit int values for the enum
##
{'enum': 'StorageDomainType',
 'data': ['UNKNOWN', 'NFS', 'FCP', 'ISCSI', 'LOCALFS', 'CIFS', 'SHAREDFS']}


So also this has moved from int to str?
The call I used since 3.3 comes from XMLRPC bindings provided by lib/vdscli.py

XMLRPC bindings provide createStorageDomain as domainCreate:

    def domainCreate(self, storageType, sdUUID, domainName,
                     typeSpecificArg, domClass,
                     domVersion=None, options=None):
        domain = API.StorageDomain(sdUUID)
        return domain.create(storageType, typeSpecificArg, domainName, domClass, domVersion)

Comment 2 Nir Soffer 2015-04-23 15:09:52 UTC
(In reply to Sandro Bonazzola from comment #0)
> looking at the previous lines in the fpaste I see 
> 
> Permission denied for directory:
> /rhev/data-center/mnt/glusterSD/minidell.home:_hosted__engine__glusterfs
> with permissions:7
> 
> and 7 was the storage type specified in the create command:
> 
> createStorageDomain(storageType=7,

7 is (os.R_OK | os.W_OK | os.X_OK), not related to storage type.

This test is done usigng the real uid/gid of the process (vdsm).

Can you check the actual permissions on that path before vdsm is testing it, and after that test?

Comment 3 Nir Soffer 2015-04-23 15:17:01 UTC
(In reply to Sandro Bonazzola from comment #1)
> ##
> # @StorageDomain.create:
> # @domainType:       The type of backing storage used by the Storage Domain
> {'command': {'class': 'StorageDomain', 'name': 'create'},
>  'data': {'storagedomainID': 'UUID', 'domainType': 'StorageDomainType',
> 
> ##
> # @StorageDomainType:
> {'enum': 'StorageDomainType',
>  'data': ['UNKNOWN', 'NFS', 'FCP', 'ISCSI', 'LOCALFS', 'CIFS', 'SHAREDFS']}

Note that there is no such type 7 - you are calling with unsupported type :-)

Would you like to open a schema bug for this?

> So also this has moved from int to str?
No, it is unfortunately using 7 instead of the enum name.

When using the xmlrpc interface, you should check how engine uses it and
do the same.

Comment 4 Sandro Bonazzola 2015-04-24 07:43:25 UTC
(In reply to Nir Soffer from comment #3)
> (In reply to Sandro Bonazzola from comment #1)
> > ##
> > # @StorageDomain.create:
> > # @domainType:       The type of backing storage used by the Storage Domain
> > {'command': {'class': 'StorageDomain', 'name': 'create'},
> >  'data': {'storagedomainID': 'UUID', 'domainType': 'StorageDomainType',
> > 
> > ##
> > # @StorageDomainType:
> > {'enum': 'StorageDomainType',
> >  'data': ['UNKNOWN', 'NFS', 'FCP', 'ISCSI', 'LOCALFS', 'CIFS', 'SHAREDFS']}
> 
> Note that there is no such type 7 - you are calling with unsupported type :-)
> 
> Would you like to open a schema bug for this?

Done, bug #1215039

> 
> > So also this has moved from int to str?
> No, it is unfortunately using 7 instead of the enum name.
> 
> When using the xmlrpc interface, you should check how engine uses it and
> do the same.

As far as I know, engine is using json bindings, not xmlrpc bindings.
Not sure why vdsm vdscli library is using xml and not json there.

Comment 5 Piotr Kliczewski 2015-04-24 08:04:14 UTC
(In reply to Sandro Bonazzola from comment #4)

> 
> As far as I know, engine is using json bindings, not xmlrpc bindings.
> Not sure why vdsm vdscli library is using xml and not json there.

Engine is using both but jsonrpc is default. There is work in progress to have vdscli using jsonrpc.

Comment 6 Sandro Bonazzola 2015-04-24 10:27:10 UTC
Can't reproduce with vdsm from git aa15c36027a22a74db66a0395dd90a8e327d2efa.
Closing with insufficient data, I'll reopen if I stumble on this again.