ManilaShares.create_share_and_access_from_vm throwing PermissionError

Bug #1957763 reported by Asma Syed Hameed
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Rally
Fix Released
Undecided
Unassigned

Bug Description

I'm trying to run this scenario in my OSP 16.1 with Ceph backend.

  ManilaShares.create_share_and_access_from_vm:
    -
      args:
        size: 1
        share_type: "default"
        flavor:
            name: "m1.small"
        image:
            name: "^centos7"
        username: "centos"
      runner:
        type: "constant"
        times: 2
        concurrency: 2
      context:
        quotas:
          manila:
            shares: -1
            gigabytes: -1
        users:
          tenants: 2
          users_per_tenant: 1
        network:
          dns_nameservers:
             - "9.9.9.9"
      sla:
        failure_rate:
          max: 0

I'm using centos7 image to boot the servers. Running the script over _run_command is throwing permission Error

ScriptError: Script execution failed: Error running command {'script_inline': 'cloud-init status -w;sudo mount -t nfs -o nfsvers=4.1,proto=tcp 172.17.5.57:/volumes/_nogroup/862d2c1d-43a3-4fb1-bef8-c31445f624fa /
mnt || exit 1;sudo touch /mnt/testfile || exit 2', 'interpreter': '/bin/bash'}. Error 1: Traceback (most recent call last):
  File "/usr/bin/cloud-init", line 9, in <module>
    load_entry_point('cloud-init==18.5', 'console_scripts', 'cloud-init')()
  File "/usr/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 892, in main
    get_uptime=True, func=functor, args=(name, args))
  File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 2543, in log_time
    ret = func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/cloudinit/cmd/status.py", line 53, in handle_status_args
    init.read_cfg()
  File "/usr/lib/python2.7/site-packages/cloudinit/stages.py", line 175, in read_cfg
    self._cfg = self._read_cfg(extra_fns)
  File "/usr/lib/python2.7/site-packages/cloudinit/stages.py", line 184, in _read_cfg
    return merger.cfg
  File "/usr/lib/python2.7/site-packages/cloudinit/helpers.py", line 278, in cfg
    self._cfg = self._read_cfg()
  File "/usr/lib/python2.7/site-packages/cloudinit/helpers.py", line 268, in _read_cfg
    cfgs.extend(self._get_instance_configs())
  File "/usr/lib/python2.7/site-packages/cloudinit/helpers.py", line 242, in _get_instance_configs
    except PermissionError:
NameError: global name 'PermissionError' is not defined

I was able to fix the issue after providing sudo permission https://github.com/asyedham/rally-openstack/blob/master/rally_openstack/task/scenarios/manila/shares.py#L127

sudo cloud-init status -w;

Revision history for this message
Asma Syed Hameed (asyedham) wrote :
Changed in rally:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to rally-openstack (master)

Reviewed: https://review.opendev.org/c/openstack/rally-openstack/+/824521
Committed: https://opendev.org/openstack/rally-openstack/commit/ac4df967f9a0f56d77c12e831fd10a3767baadd6
Submitter: "Zuul (22348)"
Branch: master

commit ac4df967f9a0f56d77c12e831fd10a3767baadd6
Author: Asma Syed Hameed <email address hidden>
Date: Thu Jan 13 15:36:17 2022 +0530

    Fix exec of cloud-init at CreateShareAndAccessFromVM

    This patch fixes the permission for running the cloud-init status -w command in
    ManilaShares.create_share_and_access_from_vm scenario

    Closes-Bug: #1957763
    Change-Id: I1ee65073031558b4c6f3b989e8e8c99f5df2c096

Changed in rally:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/rally-openstack 2.3.0

This issue was fixed in the openstack/rally-openstack 2.3.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.