Skip to content

Mask libvirtd sockets which prevents cloudstack-agent from being setup#4756

Merged
yadvr merged 3 commits into
apache:4.15from
shapeblue:c8-libvirt-args
Mar 11, 2021
Merged

Mask libvirtd sockets which prevents cloudstack-agent from being setup#4756
yadvr merged 3 commits into
apache:4.15from
shapeblue:c8-libvirt-args

Conversation

@Pearl1594

@Pearl1594 Pearl1594 commented Mar 5, 2021

Copy link
Copy Markdown
Contributor

Description

This PR fixes the issue of libvirtd service not starting successfully, which leads to failure in setting up of cloudstack-agent
Addresses: #4754

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested:

Issue noticed when cloudstack-setup-agent is run (while adding hosts):

[root@ref-trl-2525-k-M8-pearl-dsilva-kvm1 ~]# cloudstack-setup-agent  -m XX.XX.XX.XX -z 1 -p 1 -c 1 -g 4fe04fea-515c-4c4c-9c78-798554b483b2 -a -s  --pubNic=cloudbr1 --prvNic=cloudbr0 --guestNic=cloudbr1 --hypervisor=kvm
Starting to configure your system:
Configure SElinux ...         [OK]
Configure Network ...         [OK]
Configure Libvirt ...         [Failed]
Configuration failed for service Libvirt
Try to restore your system:
Restore SElinux ...           [OK]
Restore Network ...           [OK]
Restore Libvirt ...           [Failed]

Post Fix:

[root@ref-trl-2528-k-M8-pearl-dsilva-kvm1 ~]# cloudstack-setup-agent  -m XX.XX.XX.XX -z 1 -p 1 -c 1 -g bd24ab4a-4311-357e-8e9e-dab829448772 -a -s  --pubNic=cloudbr1 --prvNic=cloudbr0 --guestNic=cloudbr1 --hypervisor=kvm
Starting to configure your system:
Configure SElinux ...         [OK]
Configure Network ...         [OK]
Configure Libvirt ...         [OK]
Configure Firewall ...        [OK]
Configure Nfs ...             [OK]
Configure cloudAgent ...      [OK]
CloudStack Agent setup is done!

@Pearl1594

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@yadvr

yadvr commented Mar 5, 2021

Copy link
Copy Markdown
Member

@Pearl1594 I think -l works with libvirtd6 as well, on Ubuntu 20.04 you need to mask few things I think. (https://rohityadav.cloud/blog/cloudstack-rpi4-kvm/#kvm-host-setup)
If need this fix, can you change PR base branch to 4.15?

@Pearl1594 Pearl1594 changed the base branch from master to 4.15 March 5, 2021 05:31
@Pearl1594 Pearl1594 changed the base branch from 4.15 to master March 5, 2021 05:31
@Pearl1594 Pearl1594 changed the base branch from master to 4.15 March 5, 2021 05:38
@Pearl1594

Copy link
Copy Markdown
Contributor Author

@rhtyd -l doesn't seem to be working with libvirt 6.0.0, following is the exception that is noticed:

  4 09:15:09 ref-trl-2528-k-M8-pearl-dsilva-kvm1 journal[4103]: libvirt version: 6.0.0, package: 28.module_el8.3.0+555+a55c8938 (CentOS Buildsys <bugs@centos.org>, 2020-11-04-01:04:00, )
Mar  4 09:15:09 ref-trl-2528-k-M8-pearl-dsilva-kvm1 journal[4103]: --listen parameter not permitted with systemd activation sockets, see 'man libvirtd' for further guidance
Mar  4 09:15:09 ref-trl-2528-k-M8-pearl-dsilva-kvm1 systemd[1]: libvirtd.service: Main process exited, code=exited, status=6/NOTCONFIGURED
Mar  4 09:15:09 ref-trl-2528-k-M8-pearl-dsilva-kvm1 systemd[1]: libvirtd.service: Failed with result 'exit-code'.

I've rebased the PR off 4.15

@Pearl1594

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@yadvr

yadvr commented Mar 5, 2021

Copy link
Copy Markdown
Member

@Pearl1594 the errors I think are hinting towards disabling the sockets:

systemctl mask libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket libvirtd-tls.socket libvirtd-tcp.socket
systemctl restart libvirtd

@yadvr

yadvr commented Mar 5, 2021

Copy link
Copy Markdown
Member

Check the code wrt Ubuntu, I think the scripts do this for Ubuntu 20.04 already @Pearl1594

@Pearl1594

Copy link
Copy Markdown
Contributor Author

Thanks @rhtyd - I'll take that as reference and align to it.

@Pearl1594 Pearl1594 changed the title Prevent adding --listen parameter when libvirt version > 5.6 Stop libvirtd sockets to prevent --listen parameter in LIBVIRTD_ARGS from preventing cloudstack-agent from being setup Mar 5, 2021
@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2870

@Pearl1594

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2871

Comment thread python/lib/cloudutils/serviceConfig.py Outdated
@Pearl1594 Pearl1594 changed the title Stop libvirtd sockets to prevent --listen parameter in LIBVIRTD_ARGS from preventing cloudstack-agent from being setup Mask libvirtd sockets which prevents cloudstack-agent from being setup Mar 5, 2021
@weizhouapache

Copy link
Copy Markdown
Member

Check the code wrt Ubuntu, I think the scripts do this for Ubuntu 20.04 already @Pearl1594

yep. I added the lines.
ubuntu 20.04 + cloudstack 4.15 works fine.

@Pearl1594 Pearl1594 marked this pull request as ready for review March 5, 2021 10:30
@DaanHoogland DaanHoogland added this to the 4.15.1.0 milestone Mar 5, 2021
@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3669)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 32338 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4756-t3669-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
Smoke tests completed. 85 look OK, 1 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_migrate_VM_and_root_volume Error 59.09 test_vm_life_cycle.py
test_02_migrate_VM_with_two_data_disks Error 49.05 test_vm_life_cycle.py

@yadvr

yadvr commented Mar 6, 2021

Copy link
Copy Markdown
Member

@blueorangutan test centos8 kvm-centos8

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos8 mgmt + kvm-centos8) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3672)
Environment: kvm-centos8 (x2), Advanced Networking with Mgmt server 8
Total time taken: 31130 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4756-t3672-kvm-centos8.zip
Intermittent failure detected: /marvin/tests/smoke/test_outofbandmanagement.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 84 look OK, 2 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_oobm_background_powerstate_sync Failure 21.50 test_outofbandmanagement.py
test_oobm_enabledisable_across_clusterzones Failure 8.71 test_outofbandmanagement.py
test_oobm_issue_power_cycle Error 19.62 test_outofbandmanagement.py
test_oobm_issue_power_off Error 19.59 test_outofbandmanagement.py
test_oobm_issue_power_on Error 19.58 test_outofbandmanagement.py
test_oobm_issue_power_reset Error 19.58 test_outofbandmanagement.py
test_oobm_issue_power_soft Error 19.59 test_outofbandmanagement.py
test_oobm_issue_power_status Error 19.60 test_outofbandmanagement.py
test_oobm_multiple_mgmt_server_ownership Failure 26.58 test_outofbandmanagement.py
test_oobm_zchange_password Error 7.29 test_outofbandmanagement.py
test_hostha_enable_ha_when_host_in_maintenance Failure 308.69 test_hostha_kvm.py
test_hostha_kvm_host_degraded Error 8.61 test_hostha_kvm.py
test_hostha_kvm_host_fencing Error 8.57 test_hostha_kvm.py
test_hostha_kvm_host_recovering Error 9.61 test_hostha_kvm.py

@shwstppr shwstppr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes LGTM.
OOBM tests failing with Unable to Get Channel Cipher Suites\nSet Session Privilege Level to ADMINISTRATOR failed\nError: Unable to establish IPMI v2 / RMCP+ session\n. This need to be checked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants