107 Commits

Author SHA1 Message Date
John Bampton
28e8e2d009
pre-commit: add hook to trim trailing whitespace (#8205) 2024-05-28 09:01:30 +02:00
João Jandre
49cecaed06
Normalize loggers and upgrade log4j 1.2 to log4j 2.19 (#7131)
* Normalize logs

All classes that could have their loggers inherited from their fathers had their own loggers deleted;
Most loggers didn't have to be static, so most of them were normalized so that they wouldn't be;
All loggers are protected now;
Static logger's name are now 'LOGGER';
Non-static logger's name are now 'logger';
New class DbUpgradeAbstractImpl created so that all Upgraders extend it and inherit its logger

* Upgrade log4j

* fix errors caused by the merge

* Refactor cglibThrowableRenderer functionality to log4j2 and upgrade the last configuration files

* fix sonarcloud bug

* Fix errors caused by merge, remove some unused loggers, and rename a variable that was mistakenly renamed on the normalization commit

* Readd snmpTrapAppender, remove TestAppender

* Regenerate changes

* regenerate changes

* refactor last custom appender

* fix systemvm configuration xml

* Regenerate changes

* Regenerate changes

* regenerate changes

* Regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* Fix utils pom

* fix some tests

* regenerate changes

* Fix jar being printed on exception

* fix logging in system VMs, fix commands not having log4j2 classpath.

* regenerate changes

* Fix some unwanted renomeations

* fix end of file

* regenerate changes

* regenerate changes

* fix merge error

* regenerate changes

* fix tests

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* readd reload4j to tungsten as juniper depends on it

* Regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* re-add reload4j dependency to network-contrail, as juniper depends on it

* regenerate changes

* regenerate changes

* regenerate changes

* fix typo

* regenerate changes

* regenerate changes

* Fix end of files

* regenerate changes

* add logj42 to cloud-utils-SHADED.jar

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* regenerate changes

* Regenerate changes

* Regenerate changes

* Regenerate changes

* regenerate changes

* Regenerate changes

* regenerate changes

* Regenerate changes

* Regenerate changes

* Regenerate changes

* regenerate changes

* Regenerate changes

* Regenerate changes

* fix some tests

* Regenerate changes

* Regenerate changes

* fix test

* Regenerate changes

* Regenerate changes
2024-02-08 09:55:41 -03:00
John Bampton
4eb110af73
Remove unneeded duplicate words (#7850) 2023-09-18 13:16:33 +02:00
John Bampton
6f4503488b
pre-commit: apply end-of-file-fixer to all files (#7551) 2023-08-02 13:47:21 +02:00
Wei Zhou
62e342c1bc
utils,framework/db: Introduce new database encryption cipher based on AesGcmJce (#7003) 2023-02-02 16:25:49 +01:00
John Bampton
52c321a0c6
Fix spelling (#7087) 2023-01-16 10:56:07 +01:00
Abhishek Kumar
87b25b94f5
scripts: parametrize systemvm, router restart (#6574)
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2022-12-19 11:16:22 +01:00
Harikrishna
ab9a0fd69f
Updated log message and throw error when unable to update the secret key file (#6542)
This PR fixes issue #6232 to update the error message and throw the error when updating key file is failed. This helps to find out the proper reason for failure, mainly with umask.
2022-07-09 21:21:11 +05:30
aleskxyz
daa183d9fd
Universal sshkey and password manager script (#4890)
* Add sshkey and password manager script that works with userdata server and configdrive

* fix duplicated sshkey insertion

* Add Alpine support

* Force curl to fail on server errors

* Keep user defined ssh-keys only
2021-09-21 09:00:58 +02:00
Spaceman1984
041b8f6220
schema: Added ability to create schemas only when using cloudstack-setup-data… (#5187)
* Added ability to create schemas only when using cloudstack-setup-databases

* Renamed var name

* Added a check for passing --schema-only and --deploy-as together/.

* Moved validation to appropriate method

* Moved description

* fixed whitespace
2021-08-26 15:25:59 +05:30
Wei Zhou
cf0f1feb5e
configdrive: fix some failures in tests/component/test_configdrive.py (#5144)
* server: fix failed to apply userdata when enable static nat

* server: fix cannot expunge vm as applyUserdata fails

* configdrive: fix ISO is not recognized when plug a new nic

* configdrive: detach and attach configdrive ISO as it is changed when plug a new nic or migrate vm

* configdrive test: (1) password file does not exists in recreated ISO; (2) vm hostname should be changed after migration

* configdrive: use centos55 template with sshkey and configdrive support

* configdrive: disklabel is 'config-2' for configdrive ISO

* configdrive: use copy for configdrive ISO and move for other template/volume/iso

* configdrive: use public-keys.txt

* configdrive test: fix (1) update_template ; (2) ssh into vm by keypair
2021-07-15 12:49:37 +05:30
Rohit Yadav
65672b77fb
setup: pass password in quotes for cloudstack-setup-databases (#5025)
Fixes issue of passing password and management secret key with special
characters.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2021-05-18 22:09:14 +05:30
Spaceman1984
7a7fd27350
setup: Fixed error when passing shell reserved characters to setup databases (#4995)
* Fixed error when passing shell reserved charaters to setup databases script for dbsecret

* Moved quote to encrypt method
2021-05-04 23:09:19 +05:30
Rohit Yadav
6bde1384ff Merge remote-tracking branch 'origin/4.14' into 4.15
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2021-02-05 16:01:01 +05:30
Andrija Panic
b8e6c08132
setup: Update cloud-setup-databases.in (#4653) 2021-02-05 15:57:21 +05:30
davidjumani
d949302d0f
packaging: Adding Centos8, Ubuntu 20.04, XCPNG8.1 Support (#4068)
* DB : Add support for MySQL 8

- Splits commands to create user and grant access on database, the old
statement is no longer supported by MySQL 8.x
- `NO_AUTO_CREATE_USER` is no longer supported by MySQL 8.x so remove
that from db.properties conn parameters

For mysql-server 8.x setup the following changes were added/tested to
make it work with CloudStack in /etc/mysql/mysql.conf.d/mysqld.cnf and
then restart the mysql-server process:

    server_id = 1
    sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION"
    innodb_rollback_on_timeout=1
    innodb_lock_wait_timeout=600
    max_connections=1000
    log-bin=mysql-bin
    binlog-format = 'ROW'

    default-authentication-plugin=mysql_native_password

Notice the last line above, this is to reset the old password based
authentication used by MySQL 5.x.

Developers can set empty password as follows:

    > sudo mysql -u root
    ALTER USER 'root'@'localhost' IDENTIFIED BY '';

In libvirt repository, there are two related commits

2019-08-23 13:13 Daniel P. Berrangé            ● rpm: don't enable socket activation in upgrade if --listen present
2019-08-22 14:52 Daniel P. Berrangé            ● remote: forbid the --listen arg when systemd socket activation

In libvirt.spec.in

        /bin/systemctl mask libvirtd.socket >/dev/null 2>&1 || :
        /bin/systemctl mask libvirtd-ro.socket >/dev/null 2>&1 || :
        /bin/systemctl mask libvirtd-admin.socket >/dev/null 2>&1 || :
        /bin/systemctl mask libvirtd-tls.socket >/dev/null 2>&1 || :
        /bin/systemctl mask libvirtd-tcp.socket >/dev/null 2>&1 || :

Co-authored-by: Wei Zhou <w.zhou@global.leaseweb.com>
Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Co-authored-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2020-08-17 16:28:30 +05:30
dimsijul
3ac819410a
setup: Update cloud-set-guest-password.in (#4070)
Update cloud-set-guest-password.in
Adaptation of the original script to be able to work with netplan, network manager and ifupdown.

Changes have been tested in Cloudstack V 4.13 with the following operating systems and network providers :

Ubuntu 16.04 with ifupdown (/etc/network/interfaces)
Ubuntu 18.04 with netplan
Ubuntu 20.04 with netplan
Debian 10 with ifupdown (/etc/network/interfaces)
Debian 9 with ifupdown (/etc/network/interfaces)
CentOS 8 with network manager (/etc/sysconfig/network-scripts/ifcfg-eth0)
CentOS 7 with network manager (/etc/sysconfig/network-scripts/ifcfg-eth0)
Create a new vm from template with password feature enabled and log in the vm with provided password.

Stop the vm, change the password with the feature, start the vm and log in the vm with provided password.
2020-06-16 10:14:11 +05:30
Rohit Yadav
d90341ebf1
cloudstack: add JDK11 support (#3601)
This adds support for JDK11 in CloudStack 4.14+:

- Fixes code to build against JDK11
- Bump to Debian 9 systemvmtemplate with openjdk-11
- Fix Travis to run smoketests against openjdk-11
- Use maven provided jdk11 compatible mysql-connector-java
- Remove old agent init.d scripts

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2020-02-12 12:58:25 +05:30
Frank Maximus
3af54ec1a8 CLOUDSTACK-10382: Fix cloud-get-vm-data-configdrive.in (#2688) 2018-06-07 11:18:24 +05:30
Frank Maximus
b176648f90 CLOUDSTACK-9813: Extending Config Drive support (#2097)
Extending Config Drive support

* Added support for VMware
* Build configdrive.iso on ssvm
* Added support for VPC and Isolated Networks
* Moved implementation to new Service Provider
* UI fix: add support for urlencoded userdata
* Add support for building systemvm behind a proxy

Co-Authored-By: Raf Smeets <raf.smeets@nuagenetworks.net>
Co-Authored-By: Frank Maximus <frank.maximus@nuagenetworks.net>
Co-Authored-By: Sigert Goeminne <sigert.goeminne@nuagenetworks.net>
2018-01-12 15:14:40 +05:30
Rohit Yadav
eda3b35bfa CLOUDSTACK-10012: Migrate to Embedded Jetty
- Migrate to embedded Jetty server.
- Improve ServerDaemon implementation.
- Introduce a new server.properties file for easier configuration.
- Have a single /etc/default/cloudstack-management to configure env.
- Reduce shaded jar file, removing unnecessary dependencies.
- Upgrade to Spring 5.x, upgrade several jar dependencies.
- Does not shade and include mysql-connector, used from classpath instead.
- Upgrade and use bountcastle as a separate un-shaded jar dependency.
- Remove tomcat related configuration and files.
- Have both embedded UI assets in uber jar and separate webapp directory.
- Refactor systemd and init scripts, cleanup packaging.
- Made cloudstack-setup-databases faster, using `urandom`.
- Remove unmaintained distro packagings.
- Moves creation and usage of server keystore in CA manager, this
  deprecates the need to create/store cloud.jks in conf folder and
  the db.cloud.keyStorePassphrase in db.properties file. This also
  remove the need of the --keystore-passphrase in the
  cloudstack-setup-encryption script.
- GZip contents dynamically in embedded Jetty

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-11-03 23:57:25 +05:30
Lars Tobias Skjong-Børsting
a4036f7083 CLOUDSTACK-10067: Fix a case where a user 'ro' or 'roo' exists on the system, or other variants. (#2252)
If one sets user=roo, this will return two directories and then it will fail.
2017-09-18 12:15:36 +05:30
Jayapal
6518607885 CLOUDSTACK-8324: updated the mount directory name and kvm virt device 2017-02-15 13:58:54 +05:30
Jayapal
ea09e6c196 CLOUDSTACK-8324: config drive data set/get scripts for the guest vm 2017-02-15 12:02:58 +05:30
Romain Dartigues
3bb70daecc add DHCP lease folders for Ubuntu
Add "/var/lib/dhcp/*" to the search path for Ubuntu; tested under
Ubuntu Precise and Trusty, not yet with newer releases.
2016-05-18 23:34:19 +02:00
Wido den Hollander
92e3ba2053 CLOUDSTACK-8818: Use MySQL native connector with Python
MySQLdb has been deprecated and is also not supported in Python 3.

mysql.connector is a connector written in Python which talks the
native MySQL protocol without any external code.

https://dev.mysql.com/doc/connector-python/en/
2016-05-04 23:28:52 +02:00
Wei Zhou
64ef4fa958 CLOUDSTACK-5822: keep user-added sshkeys in authorized_keys 2015-11-06 14:36:11 +01:00
Rohit Yadav
069aa4e5f3 CLOUDSTACK-8433: remove awsapi db usage and add upgrade cleanup path
- Removes awsapi db properties usage across codebase
- Removes references from spring xmls, test cases and TransactionLegacy
- Adds sql command to drop database cloudbridge in schema-451to460-cleanup.sql

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-06 15:22:04 +02:00
Rohit Yadav
518853ab43 packaging: updated hardcoded jasypt version to 1.9.2
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 43f39a1ec37de08e5b8e97dfd74a853c0aae76c7)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2014-12-04 04:04:30 +05:30
Hugo Trippaers
ae0cb82792 Both scripts should be able to use the data-server introduced in 4.4 2014-12-01 14:56:58 +01:00
Frank.Zhang
0dc5cb4287 CloudStackCLOUDSTACK-7366
Baremetal agent is not including in RPM spec file
2014-08-19 12:52:59 -07:00
Jayapal
79fcbd4a59 CLOUDSTACK-7213: fixed continuing cloud-setup-database if there is no selinux 2014-08-01 15:54:17 +05:30
Upendra Moturi
918c320438 CLOUDSTACK-6847.Link.java and console proxy files have hardcoded value 2014-06-20 12:07:50 +02:00
Damodar Reddy
23280a47b8 CLOUDSTACK-6702 : [Windows]Due to Progress bar changes mysql path was not getting read. Fixing the same.
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
2014-06-11 11:25:02 +05:30
Wido den Hollander
6f244f3eac tools: Various fixes to set guest sshkeys script
The script would for example overwrite all existing keys in the
authorized_keys file

Some things in the bash script are also simplified
2014-05-27 12:17:45 +02:00
Wido den Hollander
37874a3fa8 tools: Various fixes to password set script
The exit status of wget was not checked properly since it would
check the exit status of the 'echo' command.

Also fix some indentation in the script and remove whitespace
2014-05-27 12:17:45 +02:00
Damodar Reddy
29b4fe6d9f CLOUDSTACK-6271: The cloud-setup-databases was failing when your jasypt jar path has spaces in it's path 2014-04-29 14:44:03 +05:30
Damodar Reddy
c7f3250151 CLOUDSTACK-6435: Add new Command line options to setup/bindir/cloud-setup-databases.in and remove OS specific commands 2014-04-23 10:36:50 -07:00
Alena Prokharchyk
498cf6183d cloudsysvmadm script (used to restart system vms during the upgrade) - added jobId, timestamp to the logged statements about router/systemvm stop/start failures 2014-04-14 16:28:00 -07:00
Rajani Karuturi
50a428c3aa CLOUDSTACK-4886: printing ****** to stdout instead of db users password 2013-12-20 17:38:39 +05:30
Alena Prokharchyk
16493841ad Fixed sysvmadm helper script (responsible for restarting/recreating VRs when needed on upgraded setups due to template changes) to have -v option. When -v is specified, all VPCs in the system will get restarted. As a part of the restart, VPC routers will get recreated 2013-09-19 10:29:41 -07:00
Bharat Kumar
35d20d163d CLOUDSTACK-4138: keep the existing changes in cloud-set-guest-sshkey.in to make sure we do not break the backward compatibility
Signed-off-by: Sheng Yang <sheng.yang@citrix.com>
2013-08-08 10:41:36 -07:00
Bharat Kumar
f9e7094282 Cloudstack-2644 [Multiple_IP_Ranges] user data service on VR does not work in case of multiple subnets Cloudstack-2953 [Multiple_IP_Ranges] VM does not get the public key from VR incase of multiple subnets per vlan Also removed some unused code and fixed the an error in the dnsmasq config function
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
2013-06-20 11:15:15 +05:30
Ian Service
779763fdfd CLOUDSTACK-3054 - Have ssh key initscript handle SELinux permissions 2013-06-18 10:39:31 -04:00
Alena Prokharchyk
35de50debf cloud-sysvmadm: 1) added -z paramters. If specified, restrict system vm restarts to specific zone. If not specified, the intances will be restarted in all zones. 2) Fixed the help for restartNetwork option. It gets triggered by -n, not -e parameter 2013-05-16 17:05:38 -07:00
Hugo Trippaers
89d3808a18 packaging: move jasypt jar to cloudstack-common
Continuation of the work done in a35f7c7bd179a33e833d3d93f61f94ee7124c3f1
2013-04-05 16:12:27 +02:00
Pradeep Soundararajan
7bb8ed4d05 BUG-ID: CLOUDSTACK-1557
Summary: EC2 REST API : cloudbridge database is missing on the CloudStack Installation

After this change, cloudstack-setup-databases is launching cloud-bridge related databases properly.
2013-03-13 14:20:41 -07:00
Rohit Yadav
e2bd88b2a1 db: Give option to specify region id while setting up database
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-02-27 15:03:14 +05:30
Rohit Yadav
16e81130cc db: Fix developer's deploydb and cloud-setup-databases for rolling update
- Fix developer prefill to use 4.0's schema
- Fix developer/pom.xml and cloud-setup-databases to not run create-schema-view,
  the upgrade path is configured to do a rolling update and set it up

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-02-16 17:18:42 +05:30
Rohit Yadav
f2ae6dcda9 db: Remove and merge 4.1-new-db-schema.sql to schema-40to410.sql
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-02-16 12:44:45 +05:30