Details: Add a new cli command to wrap ansible playbook below
ansible-playbook /usr/share/ansible/stx-ansible/playbooks/upgrade_platform.yml
The ansible_become_pass is required parameter for this command.
If the password is not present in the command line, the password
prompt will appear requiring entering password.
The password entered in prompt doesn't appear in the bash.log
This command also accepts -extra_vars that is the same parameter used
in ansible-playbook command.
Example:
platform-upgrade --become_pass=mypassword --extra_vars=k1=v1,k2=v2
Test Plan:
PASS: execute the command without become_pass provided
PASS: execute the command with become_pass provided
PASS: execute the command with more optional parameters provided
PASS: execute the command with parameters in different order
Task: 45858
Story: 2009303
Change-Id: I4a731c5fd3254f686b215ffd1dd5e72b6009f096
Signed-off-by: Junfeng (Shawn) Li <junfeng.li@windriver.com>
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
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
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
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
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
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>
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
Searched the code for unused RPCs and removed them.
Focus of this was to look only on sysinv-agent RPCs.
TEST PLAN:
PASS: Success rebuild of the system.
PASS: Run all sysinv unit tests with 100% success.
PASS: Verify sysinv logs and check for errors.
PASS: AIO-SX and AIO-DX sysinv install/replace.
PASS: Success of AIO-SX and AIO-DX bootstrap.
PASS: Success on call system commands related with the API.
Story: 2010087
Task: 45672
Change-Id: I154bddbd3eb501e7aa0c51c9f74935e269a36fa8
Signed-off-by: Eduardo Juliano Alberti <eduardo.alberti@windriver.com>
Created a duplicate install of /etc/pmon.d/*.conf files
to /usr/share/starlingx/pmon.d/
This is part of an effort to allow pmon conf files
to be selected at runtime by kickstarts.
Test Plan:
PASS: duplicate conf on deb
Story: 2010211
Task: 46108
Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
Change-Id: Ie707b832e2e440a224cd7ccd2761e5ca1bfff571
Details: This change is to avoid checking signature file
that throws exception on Debian
The signature file object has different type in CentOS and Debian
(StringIO vs BytesIO). The BytesIO has fileno attribute but file
descriptor checking is not supported on Debian. Therefore,
we see exception from checking signature file file descriptor.
This fix is to make sure we don't check signature file file
descriptor.
Test Plan:
PASS: run system load import on Debian OS
PASS: run system load import on CentOS
Task: 46094
Story: 2009303
Signed-off-by: Junfeng (Shawn) Li <junfeng.li@windriver.com>
Change-Id: Ieab68ea1354969ee7fcd2f24e8641586428441fd
Searched the code for unused RPCs and removed them.
Focus of this was to look only on sysinv-conductor RPCs.
TEST PLAN:
PASS: Success rebuild of the system.
PASS: Run all sysinv unit tests with 100% success.
PASS: Verify sysinv logs and check for errors.
PASS: AIO-SX and AIO-DX sysinv install/replace.
PASS: Success of AIO-SX and AIO-DX bootstrap.
PASS: Success on call system commands related with the API.
Story: 2010087
Task: 45908
Change-Id: Ia091c1855b8e596f62f0d3d6f14807638aa10cc2
Signed-off-by: Eduardo Juliano Alberti <eduardo.alberti@windriver.com>
The commit a6a5349d02
(k8s-1.22.5: remove feature-gates)
added a script that removes deprecated feature gates which is run during
upgrade-activate phase of previous upgrade cycle .
The commit 73632416b3
(Preserve kube-apiserver manifest params during upgrade-activate)
modified the script to preserve the kube-apiserver manifest parameters
and it is supposed to run in next patch release upgrade.
This change adds a new 'from_version' for the manifest to run during
next patch release.
The previous 'from_version' is still supported as in the future, we will
need to support CentOS to Debian upgrade.
Test Plan:
On CentOS AIO-SX
PASS: Upgrade Successful. Check if advertise address in
kube-apiserver manifest before and after running
upgrade-activate is same.
Ensure that the seccomp profile configuration is
removed after upgrade-activate.
Kube-apiserver is running and cluster is accessible after
the upgrade.
Closes-Bug: 1986854
Signed-off-by: Kaustubh Dhokte <kaustubh.dhokte@windriver.com>
Change-Id: I0e40df6e341f2da4f0e7ed4b4803197cd07470d5
This reverts commit 3d3bddfa17e2f5185f461b177fd2f116a52dff29.
Reason for revert: There's a critical bug reported at https://bugs.launchpad.net/starlingx/+bug/1987105 informing that ceph osds were not configured on Standard type labs anymore after this change. It needs to be reverted and fixed, taking care of this bug.
Change-Id: Iaec1feff6ed41bc9b63d65953d99475a24ac568e
Closes-Bug: 1987105
It was detected the command 'system host-if-modify' is failing for
VLAN Interfaces.
Try to change any parameter of a VLAN interface like:
system host-if-modify controller-0 vlanIF0 -n vlanIF1
The following error will be returned:
"VLAN id must be specified."
Test Plan (AIO-DX):
PASS Create Interface VLAN and change ifname with host-if-modify
PASS Setup IPv6 AIO-DX LAB
Closes-Bug: #1986951
Signed-off-by: Fabiano Mercer <fabiano.correamercer@windriver.com>
Change-Id: Ibd9952fd6d84a5a997339070e35872949a89f633
Several API calls were missing a timeout. A default timeout of 30
seconds was given to each.
No issues have been reported. This is a preventive change,
meant to tighten behaviour.
Test Plan:
Bootstrap, unlock, lock in SX configuration
Bootstrap, unlock, lock in DX configuration
Closes-Bug: 1927775
Signed-off-by: Joshua Kraitberg <joshua.kraitberg@windriver.com>
Change-Id: I8cb5717557cdde34345af948eb5a8c9613c1995b
In VirtualBox, after unlock, SM has all of its services
in 'initial' state.
The reason for this is that SM will not proceed unless
it detects there are no timer delays.
This is particularly noticable for AIO-SX.
By disabling nohz_full in virtual box, the timers are
not delayed and SM is able to start up its services
more quickly (5 seconds). Othwerwise SM initialization
on a 4 core system can range from 10 minutes to 10 hours.
Test Plan:
Build/Bootstrap/Unlock Debian AIO-SX on virtualbox.
Closes-Bug: 1890323
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I94226721d2ccd83a8b0caac09d1c745d4c908ae4
This commit updates sssd service parameter configuration in the sssd
puppet plugin of the sysinv component. New parameters have been added
to local domain and to nss and pam services configuration.
Test Plan for Debian:
PASS: SX system bootstrap, unlock successfully.
PASS: sssd.conf configuration data gets added in secure_system.yaml.
PASS: sssd service starts successfully.
PASS: Add new user successfully.
PASS: The new user gets cached in /etc/passwd.
PASS: New user can ssh successfully from remote server using sssd.
Test Plan for CentOS:
PASS: SX system installs successfully.
PASS: Add ldap user and search users are successfull
Story: 2009834
Task: 46014
Signed-off-by: Carmen Rata <carmen.rata@windriver.com>
Change-Id: If5c3812f2a3682e995107c9c09b90fb5fcb6db41
It happpens because "ifup -a" is executed by the service.
But it fails because /var/run/network-scripts.puppet/interfaces
has 2 interfaces with same IP address.
It can happen when an interface (i.e: mgmt) is configured on the loopback.
The same IP Address is configured for interfaces: lo and lo:1.
For this case parent interface "lo" should be defined as Manual and not
receive a Static IP address, while "lo:1" will receive the Static IP
address.
Test Plan (Debian only):
PASS Configure MGMT in the loopback interface AIO-SX
PASS Configure MGMT in the ETH interface AIO-DX
PASS Check systemctl status networking.service after unlock
Partial-Bug: #1983503
Change-Id: Ic2f07f847cb461dd01aa8cd33faae99ceb827eb2
Signed-off-by: Fabiano Mercer <fabiano.correamercer@windriver.com>
Logging is already being handled by consumers for these requests.
Test Plan:
Apply a patch
Confirm duplicate logs are gone from /var/log/sysinv.log
Story: 2008943
Task: 46008
Signed-off-by: Joshua Kraitberg <joshua.kraitberg@windriver.com>
Change-Id: Ief6337d3d27de143508914f26d5113d5841bc731
Remove old comment used in upgrade from R4->R5, the partition
check it's still valid in case there's a need to create new partitions
to be included in a volume group over an upgrade.
Story: 2010087
Task: 45721
Signed-off-by: Caio Cesar Ferreira <caio.cesarferreira@windriver.com>
Change-Id: I880cf5fb492c0a0e6f3454b14bf1e571267259c9
This commit changes the default access rule to accept users with reader
role when it is a GET request. Other requests (PATCH, POST, PUT and
DELETE) still require admin role. Also, the code that executes the
access control methods was rewritten to avoid unnecessary tests
(variable "is_public_api" is tested first).
Test Plan:
PASS: Successfully deploy an AIO-SX using a Debian image with this
commit present. Successfully create, through openstack CLI, the users:
'testreader' with role 'reader' in project 'admin' and
'otherreader' with role 'reader' in project 'notadminproject'.
Create openrc files for all new users. Note: the other user that will be
used is the already existing 'admin' with role 'admin' in project
'admin'.
PASS: In the deployed AIO-SX, to assert that public API works without
authentication, execute the commands:
"curl -v http://<MGMT_IP>:6385/v1/" and
"curl -v http://<MGMT_IP>:6385/v1/isystems/mgmtvlan" and
verify that they are accepted and that the HTTP response is 200,
and execute the commands:
"curl -v http://<MGMT_IP>:6385/v1/isystems/" and
"curl -v http://<MGMT_IP>:6385/v1/service_parameter" and
verify that they are rejected and that the HTTP response is 401.
PASS: In the deployed AIO-SX, to assert that access rules work as
intended, add the following line in "/etc/sysinv/policy.yaml":
config_api:service_parameter:get: role:reader
and execute the following commands using users "admin", "testreader" and
"otherreader":
system service-parameter-list
system host-list
system modify --description='test'
For user "admin", all commands will be successful; for user
"testreader", only commands "service-parameter-list" and "host-list"
will be successful; for user "otherreader", only command
"service-parameter-list" will be successful.
PASS: Repeat all tests above changing the deploy to AIO-DX using an
CentOS image.
PASS: Successfully execute Debian AIO-SX daily regression and sanity
tests using an image containing this change.
Story: 2010149
Task: 46004
Signed-off-by: Joao Victor Portal <Joao.VictorPortal@windriver.com>
Change-Id: I701592b50cb687a2e227162e3cba30c0f8d12613
Details: This commit is to add a new method to get target
release OS type during upgrades. The target release may be either Debian or CentOS.
By checking the existence of os_tree repo in the target release,
we can identify the OS type. If os_tree repo exists, it is Debian
Test Plan:
PASS: Added new test cases for the method.
PASS: Ran all unit test cases.
PASS: Integration test with command host-upgrade that eventually
triggers _update_pxe_config()
Task: 45887
Story: 2009303
Signed-off-by: Junfeng (Shawn) Li <junfeng.li@windriver.com>
Change-Id: I70b5b154ffa46c4390fb6fae8252073307f40997
Block the addition of ssl_ca certificates with same subject name
Test Plan:
PASS: Attempted to install another certificate with same subject, and
verified that it fails with an error.
PASS: Generate and install a full iso and verified that columns subject
and hash_subject were added to certificate table.
PASS: Verified that when there is a subject name clash the command
system certificate-install returns an error and the certificate
that has the same subject
PASS: Verified that the system shows an error when the subject field is
emtpy for ssl_ca
PASS: Verified that a new column subject shows up for command
system certificate-list
PASS: Verified that a new column subject shows up as a return to
a successful system certificate-install command
Depends-on: https://review.opendev.org/c/starlingx/ansible-playbooks/+/851894
Closes-bug: 1981100
Signed-off-by: Karla Felix <karla.karolinenogueirafelix@windriver.com>
Change-Id: I7ce11cc5dab6f686d360d01594ba100d07d2c2db