4119 Commits

Author SHA1 Message Date
Zuul
d7de42cbc5 Merge "Update image tag for n3000-opae" 2022-09-23 16:28:28 +00:00
Mohammad Issa
70235b4221 Update image tag for n3000-opae
Changed image tag from stx.6.0-v1.0.1. to stx.8.0-v1.0.2

Story: 2009831
Task: 46404
Depends-On: https://review.opendev.org/c/starlingx/root/+/857468

Signed-off-by: Mohammad Issa <mohammad.issa@windriver.com>
Change-Id: I2431dce863cd24a7fccdb2868a73ba754b407d72
2022-09-23 14:16:13 +00:00
Zuul
a8cc17e12b Merge "Better error message for sysinv forbidden error" 2022-09-21 15:53:48 +00:00
Zuul
65ab3c50ff Merge "Add sleep between sysinv-agent attempts to mount /opt/platform" 2022-09-20 18:07:59 +00:00
Jerry Sun
c9bd767fbd Better error message for sysinv forbidden error
This commit catches the forbidden error raised for a user trying to
run sysinv commands without enough privileges. The forbidden exception
used to not be caught, resulting in sysinv CLI returning a "None" to
the user. With this commit, a more useful error message is shown to
the user.

Test Cases:

PASS: Create a reader user and run "system modify --description".
      Ensure a meaningful error is returned since readers are not
      allowed to run system modify. Ensure no changes are made
      by checking "system show"

Change-Id: I11c407f06196962ba445c6d8a9f7591cc8a5cf05
Story: 2010149
Task: 46360
Signed-off-by: Jerry Sun <jerry.sun@windriver.com>
2022-09-20 12:54:15 -04:00
Andre Fernando Zanella Kantek
f7a729995c Add sleep between sysinv-agent attempts to mount /opt/platform
During the boot process, most notably in IPv6 installations,
sysinv-agent is failing to mount /opt/platform/sysinv/${SW_VERSION}
to /mnt/sysinv during the 3 attempts done. This is starting the
agent with default values, making the process stuck trying to connect
to rabbitmq in localhost:5672 instead of controller-0:5672,
preventing the correct node installation from controller-0.

This change introduces a 1s sleep between attempts, with tests
indicating that the 2nd attempt is usually successful.

It is also adding a explicitly dependency with remote-fs.target, it
did not took effect on the first reboot after install (the loop was
responsible to copy config file). But on subsequent lock/unlock it
did not executed the mount as /opt/platform was available (this was
not happenning without the dependency).

Test Plan:
[PASS] install an AIO-DX with 3 compute nodes in IPv6 network

Story: 2010211
Task: 46348

Signed-off-by: Andre Fernando Zanella Kantek <AndreFernandoZanella.Kantek@windriver.com>
Change-Id: Idab6b1887f38283ea8e0e05923a0ae4265c2e877
2022-09-20 10:36:48 -04:00
Zuul
3b20b4eead Merge "Fix certificate ssl_ca cert install by dc-orch sync" 2022-09-16 21:55:57 +00:00
Zuul
6792dae88a Merge "Create openldap certificate on upgrade" 2022-09-16 21:17:19 +00:00
Rei Oliveira
397e708a42 Fix certificate ssl_ca cert install by dc-orch sync
This commit fixes an issue where trying to install the same certificate
again results in a 'Cannot install certificate with same subject'. That
is incorrect and should be thrown only for a different certificate with
the same subject.

Test Plan:

PASS: Manage a subcloud and verify that it's able to synchronize certs
      without the 'Cannot install certificate with same subject' error
PASS: Try to install the same certificate multiple times and verify
      that no 'Cannot install certificate with same subject' error
      is returned
PASS: Try to install two different certificates with same subjects and
      verify that a 'Cannot install certificate with same subject' error
      is returned

Closes-Bug: 1990007

Signed-off-by: Rei Oliveira <Reinildes.JoseMateusOliveira@windriver.com>
Change-Id: I17861145f20b8e1ef61896c3271a96a28fe9ded2
2022-09-16 16:01:01 -03:00
Zuul
1e41b8e445 Merge "PTP: fix VLAN interface not working" 2022-09-16 14:12:09 +00:00
Zuul
a32fccb25c Merge "Fixed app remove op when image download fails" 2022-09-16 13:12:06 +00:00
Zuul
8f041315d3 Merge "Log data migration script output when failure" 2022-09-16 12:49:11 +00:00
Rei Oliveira
f8b31e52ab Create openldap certificate on upgrade
This commit:

Adds an upgrade script to call the ansible playbook
upgrade-openldap-certificate.yml and create the openldap certificate
during the upgrade activate stage.

Changes the puppet plugin code for ldap to read the openldap
certificate only in activate statuses during an upgrade.

Fixes an issue with certificate_shell where it may call len() for a
certificate that does not have the subject information, resulting a
NoneType error.

Test Plan:

PASS: Upgrade from stx 22.06 to 22.12 and verify that the openldap
      certificate is successfully created in kubernetes
      in upgrade activate stage
PASS: After certificate is created in kubernetes, verify that the
      certificate and key is read by puppet and saved to files
      in /etc/ldap/certs
PASS: After certificate is created in kubernetes, verify that the
      certificate is picked up by cert-mon and saved to database
      and show in 'system certificate-list'

Story: 2009834
Task: 45933

Change-Id: Ia4b9d1921b1e7afdc29f398f902faf2a8bf1e25b
Signed-off-by: Rei Oliveira <Reinildes.JoseMateusOliveira@windriver.com>
Depends-On: https://review.opendev.org/c/starlingx/ansible-playbooks/+/856556
2022-09-15 16:50:53 -03:00
Caio Bruchert
da96f7e2cc PTP: fix VLAN interface not working
ptp4l configuration needs the correct VLAN interface name for the
port section.

For example: if the VLAN interface creates the Linux interface named
'vlan100@enp0s8', the port section must be 'vlan100' and not 'enp0s8'
nor 'vlan100@enp0s8'.

Test Plan:
PASS: Assign VLAN interface to PTP instance
PASS: Assign bond interface to PTP instance
PASS: Assign eth interface to PTP instance

Closes-Bug: 1989797

Signed-off-by: Caio Bruchert <caio.bruchert@windriver.com>
Change-Id: I953fee83151bc1546786e495514c9352c8ccfc0a
2022-09-15 14:39:30 -04:00
Bin Qian
b6cc163bc6 Log data migration script output when failure
Capture script stdout and stderr. Log outputs when script fails.
Do not log exception unless script cannot run.

Closes-bug: 1989742

TCs:
    1. No log for execution succeed
    2. script output is logged when script fails
    3. exception is logged when script not executed (e.g, file not
       found, etc)

Signed-off-by: Bin Qian <bin.qian@windriver.com>
Change-Id: I9c5e01e0937db02624f8c4b9bff5ccb2fae73249
2022-09-15 16:49:33 +00:00
Zuul
b26a57aef6 Merge "Use puppet runtime class to update DNS resolv.conf" 2022-09-15 13:22:48 +00:00
Yuxing Jiang
5b5fe7ec7c Listen and update keystone service users' passwords
This commit adds listeners to monitor the change of keystone
service users' passwords, apply puppet runtime manifest to
update the service configuration and restart the related
services.

Tests passed:
1 Update keyring users' password
2 Change keystone users' passwords with OpenStack CLI
3 Verified the configuration updated
4 Verified the service w/o auth failure
5 No host swact during the apply, no FM alarm created at the
end of the process

Note:
1 the password synchronization between keyring and keystone
is not included in this review.
2. the update of the secure static hieradata is not included
in this change due to upgrade concerns, users need to update
the hieradata manually. E.g. the subcloud_rehome playbook
will add a task to migrate the passwords in the hieradata
during subcloud rehoming.
3. the unit tests will be delivered by another task in this
story.

Depends-On: https://review.opendev.org/c/starlingx/stx-puppet/+/853708
Story: 2010230
Task: 46074

Signed-off-by: Yuxing Jiang <Yuxing.Jiang@windriver.com>
Change-Id: I1a2dbc8b1e0bd03c2086895818729b2283b0fb96
2022-09-14 19:27:55 +00:00
Zuul
7782f877a0 Merge "AppFwk: remove -f prevents remove-failed state" 2022-09-14 13:57:29 +00:00
Zuul
22555270af Merge "Refactor of agent_audit" 2022-09-13 21:33:16 +00:00
Zuul
f5a9020fa5 Merge "Kubernetes custom configuration support: runtime." 2022-09-13 21:29:48 +00:00
Jorge Saffe
28fce99250 Kubernetes custom configuration support: runtime.
This changes allow users for global customization
of kubelet and control plane components during
runtime process.

* Validations have been relaxed to enable creation of
  new sections in kubernetes service through service-parameter.
  e.i.: kube_apiserver, kube_scheduler, kube_controllerManager,
        kubelet.

* Validations have been relaxed to enable creation of
  new parameters in kubernetes service through service-parameter.

* Upgrade script has been added in order to migrate the parameters
  (oidc_issuer_url, oidc_client_id, oidc_username_claim,
  oidc_groups_claim) to (oidc-issuer-url, oidc-client-id,
  oidc-username-claim, oidc-groups-claim)

Test Plan:
* Fresh Install: AIO-SX, Standard.
* B&R and Upgrade: AIO-SX, Standard.
* Create, modify, delete supported parameters and verify changes.
* Add and apply not supported parameters and verify kube-apiserver auto
  restore process.
* Validate launch example Pods, for both simplex and duplex systems.

Story: 2009766
Task: 44378
Depends-On: https://review.opendev.org/c/starlingx/stx-puppet/+/827760
Signed-off-by: Jorge Saffe <jorge.saffe@windriver.com>
Change-Id: I8e1311a78bf9e1419d76d4d19777a847a53e82f4
2022-09-13 15:50:22 -04:00
Caio Cesar Ferreira
bd0490d4cc Refactor of agent_audit
This commits aims to do a clean up in the _agent_audit, removing the
deprecated RemoteError exception snippets and the _audit_tpm_device
which isn't supported anymore. Also, splits the _agent_audit with
_inventory_audit and _lldp_audit. Each one with it's own interval
value.

TEST PLAN:
PASS: AIO-SX: Manually replaced this file into a installation.
PASS: AIO-SX: Rebuild the whole system with the changes without
crashes.
PASS: AIO-SX: bootstrap and unlocked system, no errors.
PASS: AIO-SX: followed sysinv logs to make sure the audits are being
called during the period.

Story: 2010087
Task: 46173

Signed-off-by: Caio Cesar Ferreira <Caio.CesarFerreira@windriver.com>
Change-Id: I3215a5a10e7ec4d10985fc16f1a2bad3617c1cd4
2022-09-13 16:39:29 -03:00
Zuul
ef84f4df5e Merge "Update provider_uri for openldap syncrepl over TLS" 2022-09-12 18:13:38 +00:00
Zuul
c6a10d5c8e Merge "Debian: Update the device image cache directory" 2022-09-12 17:32:57 +00:00
Zuul
c6ec8a18d9 Merge "confirm lvcreate when ext4 signature exists" 2022-09-12 13:47:56 +00:00
Andy Ning
dd72707bf8 Update provider_uri for openldap syncrepl over TLS
This change updated provider_uri to be 'ldaps' so openldap syncrepl
will be secure over TLS.

This change also updated puppet tox unit tests accordingly.

Test Plan:
PASS: DX system deployment
PASS: Check syncrepl section in slapd.conf.backup, it should contain:
      provider=ldaps://<controller>
      tls_cert="/etc/ldap/certs/openldap-cert.crt"
      tls_key="/etc/ldap/certs/openldap-cert.key"
      tls_cacert="/etc/ssl/certs/ca-certificates.crt"
      tls_reqsan=demand
PASS: On one controller, add a new openldap user, and check the
      newly added user exists on the other controller by:
      ldapsearch -xH ldaps://<the other controller>
      -b 'ou=people,dc=cgcs,dc=local' '(objectclass=*)' |
      grep <the newly added user>
PASS: After active controller swact, repeat TC #3 again.

Story: 2009834
Task: 46245
Depends-On: https://review.opendev.org/c/starlingx/config-files/+/856769
Signed-off-by: Andy Ning <andy.ning@windriver.com>
Change-Id: If59016555e0762693ce3e9eeea33ae61e7dda4b1
2022-09-09 17:53:34 -04:00
Bin Qian
5daaad15eb confirm lvcreate when ext4 signature exists
In some case, when pervious ext4 signature exists, lvcreate fails
with return code 5.
Add -y -Wy -Zy parameters for lvcreate to automatically wipe the
existing ext4 signature.

TCs:
    1. controllers successfully complete upgrade.

Story: 2009303
Task: 46252

Change-Id: I6759e25e42929ab3b1c4eb01fcbaf2be411dd8ca
Signed-off-by: Bin Qian <bin.qian@windriver.com>
2022-09-09 21:27:27 +00:00
Bin Qian
61f4385bf3 Restrict migration scripts that are not runable for 22.12 upgrade
Add execution exclusion for migration scripts:
  63-helm-v2-to-v3-rel_migration.sh
  64-upgrade-cert-manager.sh
  65-k8s-app-upgrade.sh

This skips running the scripts above for 22.06 to 22.12 upgrade.

TCs:
    upgrade 22.06 -> 22.12 completed successfully

Story: 2009303
Task: 46219
Change-Id: I7353d06033b6a014d8654220624c856d7d900e19
Signed-off-by: Bin Qian <bin.qian@windriver.com>
2022-09-09 20:12:54 +00:00
Li Zhu
8ef8ea82b0 Debian: Update the device image cache directory
The current device image cache directory is off /usr which is
a read-only filesystem in Debian. It is moved to /var, a read-write
filesystem, so that image cache directory can be created during
firmware update on Debian. The directory structure is unchanged for
CentOS.

Test Plan:
Verified: The device image cache directory can be created during
          FW update on Debian. And the code changes would not
          impact CentOS.

Story: 2010119
Task: 46230

Signed-off-by: lzhu1 <li.zhu@windriver.com>
Change-Id: Ic1c4db352a0032395dab853cbfb7f886e009cbfa
2022-09-09 15:26:23 +00:00
Bin Qian
9b91a679be Remap partition layout for upgrading to Debian
This is to remap the new partition in N+1 system.

For upgrading to Debian from CentOS, the partition layout changes a lot.
This migration script is to pick up the new layout and create
corresponding sysinv records so that ensure the puppet hieradata can be
created correctly before sysinv-agent report inventory.

Story: 2009303
Task: 46009

Test plan:
    1. passed upgrade controller-1 from CentOS 22.06 to Debian 22.12.
       Controller-1 unlocked successfully.

Change-Id: I2243a37b496b2a8a41c7c8d32ef1aad38dd29001
Signed-off-by: Bin Qian <bin.qian@windriver.com>
2022-09-09 15:08:23 +00:00
Zuul
a94f7c7ea2 Merge "Increase the audit interval of kubernetes labels" 2022-09-08 21:07:57 +00:00
Fabiano Mercer
4dce9dff96 Use puppet runtime class to update DNS resolv.conf
It was detected the command 'system dns-modify' updates the
resolv.conf correctly but after reboot the resolv.conf
is overwritten with old values.
The reason was the system.yaml was being updated but code
was not calling script: puppet-manifest-apply.sh to update
YAMLs in the path that puppet will use.
Changed code to use puppet runtime class and the right
function to update YAMLs and call puppet-manifest-apply.sh.

Test Plan (DEBIAN: Standard CENTOS: AIO-DX):
PASS  Modify DNS and check resolv.conf in both controllers
PASS  Modify DNS and reboot both controllers
PASS  Install AIO-DX in VBox using ISO with this fix
PASS  Install Standard in VBox using ISO with this fix

Closes-Bug: #1989142

Depends-On: https://review.opendev.org/c/starlingx/stx-puppet/+/856560

Signed-off-by: Fabiano Mercer <fabiano.correamercer@windriver.com>
Change-Id: Ic0b2790bc3a92526efd459e4103380461c541f0d
2022-09-08 20:42:34 +00:00
Zuul
b6eb8b9c1e Merge "Refresh disk data on CentOS to Debian upgrade" 2022-09-07 20:14:38 +00:00
Zuul
2c75cd5117 Merge "Fix openldap cert install error on upgrade" 2022-09-07 16:51:06 +00:00
Rei Oliveira
70b690b899 Fix openldap cert install error on upgrade
Do not enter the code branch that tries to read the openldap certificate
on sysinv startup and is causing an error during 22.12 upgrade.

This is a temporary fix to allow the upgrade to run. A subsequent code
change to create the openldap certificate during the upgrade and then
remove this check will be done later.
        
Test Plan:

PASS: Install fresh iso and verify that certificate and key files are
      created and there are no sysinv.log or puppet.log errors
PASS: Upgrade from stx 22.06 to 22.12 and verify that sysinv process
      does not try to read certificates from kubernetes and there are
      no sysinv.log or puppet.log errors

Story: 2009834
Task: 45933

Change-Id: Ie5201b6149f5dcec48e958fef3a4f987006b81be
Signed-off-by: Rei Oliveira <Reinildes.JoseMateusOliveira@windriver.com>
Depends-On: https://review.opendev.org/c/starlingx/config/+/855699
2022-09-07 15:11:51 +00:00
Zuul
d081a8bd87 Merge "sysinv-conductor review and cleanup existing RPCs" 2022-09-07 14:46:35 +00:00
Zuul
94c338816d Merge "Update sysinv to not create openldap cert on subcloud" 2022-09-07 14:46:22 +00:00
Leonardo Fagundes Luz Serrano
7f8a5fb242 AppFwk: remove -f prevents remove-failed state
Currently, there is no path inside the appfwk to get an app
from 'remove-failed' state to any other state.

This commit makes it so that using remove --force
will prevent the app from being put in remove-failed
if the operation fails.

Instead, the app is put in 'uploaded' state
and a progress message warning about this is set.

remove --force can also be used to recover the app
from remove-failed state for a posterior delete.

Test Plan:
PASS: remove (without -f) results in remove-failed
      state in case of an error
PASS: remove --force results in uploaded state
      instead of remove-failed in case of an error
      and the progress message is set.
      (tested for apply-failed and remove-failed)
PASS: remove --force does not set the warning
      progress message when the remove succeeds

Related-Bug: 1987115
Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
Change-Id: Iba659c05bf9abd28b0319e6c438141f9aa1c9240
2022-09-06 16:06:23 -03:00
Zuul
ae9875c335 Merge "Add keystone database migration script" 2022-09-06 14:14:31 +00:00
Andy Ning
a3650cef13 Update sysinv to not create openldap cert on subcloud
Openldap is not running on subcloud so no openldap certificate
is created as k8s secret during bootstrap. But current sysinv ldap
plugin still tries to retrieve the certificate from k8s, causing
subcloud unlock to fail.

This change updated sysinv ldap plugin to not retrieve openldap
certificate for subcloud.

Test Plan:
PASS: subcloud deployment by "dcmanager subcloud add"

Closes-Bug: 1988601
Signed-off-by: Andy Ning <andy.ning@windriver.com>
Change-Id: Iafbc5d6ff90735c07ac6850d2f76e9a6230a7a41
2022-09-02 17:16:58 -04:00
Heitor Matsui
40b7642192 Refresh disk data on CentOS to Debian upgrade
Debian and CentOS partition scheme differs, so on a upgrade
scenario from CentOS to Debian the hosts may report disk information
different from what is recorded on the database.

This commit allows deleting a PV that fall under these conditions
on the specific scenario of CentOS -> Debian upgrade, and makes
audit check if reported partition data have difference on some
fields to determine if they need to be updated.

Test Plan:
PASS: upgrade and unlock both controller-1 and controller-0 on Debian
      and verify that disk and partition information is consistent
PASS: install, bootstrap and unlock AIO-SX on Debian

Story: 2009303
Task: 46078

Signed-off-by: Heitor Matsui <HeitorVieira.Matsui@windriver.com>
Change-Id: Ia812612c96806a7f886f1997e96f95241e5e0447
2022-09-01 15:43:54 -03:00
Zuul
d0424e9d08 Merge "Increase timed out for cert-mon certificate installation" 2022-09-01 14:26:39 +00:00
Zuul
394062132c Merge "debian: Remove sleep in network interface pre-up" 2022-09-01 13:26:22 +00:00
Karla Felix
1bcbede214 Increase timed out for cert-mon certificate installation
Cert-mon can fail to install certificates during host-unlock because
this can be a busy moment for the system, especially for sysinv. This
happens when the system is under stress with high CPU load ( usually
in virtual environments where many vms are running in parallel).

This change only affects the cert-mon rest client.

Test plan:

PASS:  Check if cert-mon is able to install certificates on host-unlock
       under high CPU load

Story: 2009834
Task: 46166
Change-Id: I4ae92aa8d07e717401e815ac156dc60233383e14
Signed-off-by: Karla Felix <karla.karolinenogueirafelix@windriver.com>
2022-08-31 17:10:28 +00:00
Zuul
38795a049e Merge "debian_iso_image.inc: align the package name with "stx-std.lst"" 2022-08-31 13:55:34 +00:00
Zuul
f27b85e144 Merge "sysinv-agent cleanup existing RPCs" 2022-08-30 15:32:43 +00:00
Zuul
1e8ddbf344 Merge "Duplicate pmon.d conf files to another location" 2022-08-29 23:50:28 +00:00
Yue Tao
1face6d6fe debian_iso_image.inc: align the package name with "stx-std.lst"
Currently we use the "stx-std.lst" file in tools to add install package.
We are going to use the "debian_iso_image.inc" file to follow CentOS.

We observed some layers already have the debian_iso_image.inc, so first
of all, we need to check if all the packages are available, otherwise,
once supporting "debian_iso_image.inc", "build-image" will fail.

Comment "storageconfig" is to align with "stx-std.lst" in which the
package is commented due to integration issue.

In debian build, only one binary "workerconfig-standalone" is built from
source, so change "workerconfig" to "workerconfig-standalone" which also
align with "build-image"

Story: 2008846
Task: 46141

Signed-off-by: Yue Tao <yue.tao@windriver.com>
Change-Id: Ife3cecbced143f9f0172198ece2a8f9aee6ed058
2022-08-27 18:40:14 +08:00
Zuul
7db502de15 Merge "Update sysinv ldap puppet plugin to generate ldap cert" 2022-08-26 19:43:32 +00:00
Andy Ning
ca5bd18cb6 Update sysinv ldap puppet plugin to generate ldap cert
This is part of the change to replace nslcd with sssd to
support multiple secure ldap backends.

This change updated sysinv ldap puppet plugin to retrieve
openldap certificate and key from k8s certificate secret into
secure_system.yaml. The certificate and key will then be used by
ldap puppet to generate openldap certificate and key files for
secure openldap service.

Test Plan on Debian (SX and DX):
PASS: Package build, image build.
PASS: System deployment.
PASS: Openldap certificate and key files are generated, and slapd is
      configured to use the certificate and key after controller is
      unlocked.
PASS: sssd is connected to slapd on the secure port after unlock.
PASS: ldap functions work properly (ldap user creation, user login
      on console and by ssh etc).
PASS: For DX system, ldap functions still work properly after swact.

Test Plan on CentOS:
PASS: ldap functions work properly (ldap user creation, user login
      on console and by ssh etc)

Story: 2009834
Task: 46072
Depends-On: https://review.opendev.org/c/starlingx/metal/+/854203
Signed-off-by: Andy Ning <andy.ning@windriver.com>
Change-Id: Iec876c9b0a5698cf0b15781792443e99ddb5f4ec
2022-08-26 09:58:16 -04:00