-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Derive pci device_spec edpm_derive_pci_device_spec #597
Derive pci device_spec edpm_derive_pci_device_spec #597
Conversation
83f2c57
to
c79be83
Compare
c79be83
to
cfc39c3
Compare
f6cc507
to
5cf236a
Compare
# under the License. | ||
|
||
- name: Derive the SR-IOV device_spec config map for nic-partitionin | ||
ansible.builtin.import_tasks: derive_pci.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vcandapp please change derive_pci.yml file name like derive_pci_device_spec.yml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed file name for more clarity
when: | ||
- not sriov_device_spec_conf_check.stat.exists | ||
become: true | ||
block: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vcandapp can we add one more task fof this block to print derived results. so that user can also use pod logs to create configmap for nova custom service.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added output debug log
sriov_device_spec_map: "{{ edpm_derive_sriov_device_spec_list }}" | ||
sriov_phydev_map: "{{edpm_derive_pci_device_spec_physmap_file }}" | ||
sriov_device_spec_out_file: "{{ edpm_derive_pci_device_spec_conf_dir }}/{{ edpm_derive_pci_device_spec_conf_file }}" | ||
register: derive_pci_devicespec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vcandapp line 47 and 48 are not required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
derive_pci_devicespec.rc will throw error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be needed
- name: Check valid input for edpm_derive_sriov_device_spec_list | ||
ansible.builtin.fail: | ||
msg: "List of sriov device_spec cannot be empty - edpm_derive_sriov_device_spec_list" | ||
when: edpm_derive_sriov_device_spec_list | length > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vcandapp Need to update condition length==0 for fail message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
.. code-block:: YAML | ||
|
||
- name: "Configure DDP Package" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vcandapp typo DDP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
|
||
def get_allocated_pci_addresses(configs): | ||
alloc_pci_info = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same description missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
|
||
def get_pci_passthrough_devicespec(user_config, pf, pci_addresses): | ||
pci_passthrough_list = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same description missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
|
||
def get_passthrough_config_for_all_pf(user_config, | ||
system_configs, | ||
allocated_pci): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same description missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
configs = [] | ||
src_config = "" | ||
# Currently only "device_spec" is valid | ||
valid_spec = ('device_spec') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vcandapp can we reuse this variable PASSTHROUGH_DEVSPEC_KEY instead of valid_spec new variable again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No action, This function is removed now
sriov_phydev_map=None): | ||
pci_passthrough = {} | ||
system_configs = get_sriov_configs() | ||
user_configs = sriov_device_spec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vcandapp remove this line and specify user_configs as _run_derive_pci function argument sriov_device_spec,?
since no user_configs updates done. only for reading purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
- List of SR-IOV device_spec | ||
type: list | ||
required: true | ||
default: '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vcandapp used required but default is empty. mutually exclusive and get internal error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
- ConfigMap file to be used in nic-partitioned deployment | ||
type: str | ||
required: true | ||
default: '/var/lib/config-data/ansible-generated/derive_devicespec/20-sriov-nova.conf' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
type: str | ||
required: false | ||
default: '' | ||
sriov_nova_conf_file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sriov_device_spec_out_file is used in derive pci file and here sriov_nova_conf_file. need to update sync
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
a055be7
to
cbce0c2
Compare
changed_when: derive_pci_devicespec.rc == 0 | ||
- name: Print result of derived device_spec | ||
debug: | ||
msg: "{{ derive_pci_devicespec }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vcandapp Please use derive_pci_devicespec.device_spec instead of complete details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated debug msg
04c1d18
to
02ec65d
Compare
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
/approve |
Did E-2-E testing with this PR in nic partitioned deployement, and here are the verified logs: [WARNING]: running playbook inside collection osp.edpm PLAY [Derive sriov device_spec] ************************************************ TASK [Gathering Facts] ********************************************************* TASK [osp.edpm.edpm_derive_pci_device_spec : Validating arguments against arg spec 'main' - The main entry point for the edpm_derive_pci_device_spec role.] *** TASK [osp.edpm.edpm_derive_pci_device_spec : Check valid input for edpm_derive_sriov_device_spec_list] *** TASK [osp.edpm.edpm_derive_pci_device_spec : Create neutron-sriov-agent directories] *** TASK [osp.edpm.edpm_derive_pci_device_spec : Check if edpm node has the sriov nova conf] *** TASK [osp.edpm.edpm_derive_pci_device_spec : Run derive_pci_passthrough_devicespec] *** TASK [osp.edpm.edpm_derive_pci_device_spec : Print result of derived device_spec] *** PLAY RECAP Gathering Facts --------------------------------------------------------- 1.51s |
This role will generate the pci device_spec for sriov nic partitioning deployment. The generated config file should be used to create device_spec configmap for custom nova dataplane service. *Added basic molecule test *Unit tests
02ec65d
to
5186ba0
Compare
/approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Glad to see some good test coverage and molecule tests. Be nice to have some end-to-end SR-IOV testing downstream to make sure we aren't missing anything.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bshephar, Jaganathancse, vcandapp The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This role will generate the pci device_spec for sriov nic partitioning deployment.
The generated config file should be used to create device_spec configmap for custom nova dataplane service.
This has been re-factored from PR