32 Commits

Author SHA1 Message Date
John Bampton
c6d3f6e623
pre-commit: enable Python flake8 rule E271 (#9358) 2024-07-09 10:17:53 +02:00
John Bampton
b69cc0272d
pre-commit: enable Python Flake8 rule E713 (#9016)
Co-authored-by: Vishesh <vishesh92@gmail.com>
2024-07-08 09:00:18 +02:00
John Bampton
8e538028b2
Enable Flake8 rule W391 (#6606)
Best practice is to have one blank line at the end of Python files.

Remove unneeded blank lines from the end of files
2022-11-13 11:00:07 +01:00
davidjumani
f17683779c
packaging: Adding SUSE 15 support (#5110)
This PR adds support for SUSE Leap 15.2+ as a KVM hypervisor and Management / Usage server on Cloudstack
Related docs link apache/cloudstack-documentation#224

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
2021-08-19 13:28:54 +05:30
Suresh Kumar Anaparti
958182481e cloudstack: make code more inclusive
Inclusivity changes for CloudStack

- Change default git branch name from 'master' to 'main' (post renaming/changing default git branch to 'main' in git repo)
- Rename some offensive words/terms as appropriate for inclusiveness.

This PR updates the default git branch to 'main', as part of #4887.

Signed-off-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2021-06-08 15:47:20 +05:30
Wei Zhou
74982c5e76
Fix warning when setup cloudstack-common (#4523) 2020-12-09 18:30:59 +01:00
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
Rohit Yadav
8da2462469
CLOUDSTACK-10333: Secure Live VM Migration for KVM (#2505)
This extends securing of KVM hosts to securing of libvirt on KVM
host as well for TLS enabled live VM migration. To simplify implementation
securing of host implies that both host and libvirtd processes are
secured with management server's CA plugin issued certificates.

Based on whether keystore and certificates files are available at
/etc/cloudstack/agent, the KVM agent determines whether to use TLS or
TCP based uris for live VM migration. It is also enforced that a secured
host will allow live VM migration to/from other secured host, and an
unsecured hosts will allow live VM migration to/from other unsecured
host only.

Post upgrade the KVM agent on startup will expose its security state
(secured detail is sent as true or false) to the managements server that
gets saved in host_details for the host. This host detail can be accesed
via the listHosts response, and in the UI unsecured KVM hosts will show
up with the host state of ‘unsecured’. Further, a button has been added
that allows admins to provision/renew certificates to KVM hosts and can
be used to secure any unsecured KVM host.

The `cloudstack-setup-agent` was modified to accept a new flag `-s`
which will reconfigure libvirtd with following settings:

    listen_tcp=0
    listen_tls=1
    tcp_port="16509"
    tls_port="16514"
    auth_tcp="none"
    auth_tls="none"
    key_file = "/etc/pki/libvirt/private/serverkey.pem"
    cert_file = "/etc/pki/libvirt/servercert.pem"
    ca_file = "/etc/pki/CA/cacert.pem"

For a connected KVM host agent, when the certificate are
renewed/provisioned a background task is scheduled that waits until all
of the agent tasks finish after which libvirt process is restarted and
finally the agent is restarted via AgentShell.

There are no API or DB changes.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-04-20 00:36:18 +05:30
Rohit Yadav
ea33a35297
debian: Use only -l for libvirtd default file on debian (#2550)
This fixes #2546

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-04-11 14:08:57 +05:30
Remi Bergsma
ca860348dc Merge pull request #1033 from Carles-Figuerola/centos-7-redhat-release
CLOUDSTACK-9029: Proper support to identify CentOS 7 version numberhttps://issues.apache.org/jira/browse/CLOUDSTACK-9029

* pr/1033:
  CLOUDSTACK-9029: Proper support to identify CentOS 7 version number

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-09 16:54:38 +01:00
Carles Figuerola
3ce420c367 CLOUDSTACK-9029: Proper support to identify CentOS 7 version number 2015-11-04 11:21:47 -06:00
Remi Bergsma
87fdb521f0 CLOUDSTACK-8443: don't try to fix co-mounted cgroups
This setting works on CentOS 6 / RHEL 6 but does nothing, as
"cpu" cgroup is not mounted. On CentOS 7 / RHEL 7 systemd does
mount cgroups and "cpu" is co-mounted with "cpuacc". Hence, if
we specify "cpu" then this results in an error because it can
only use them both, or none.

By removing the setting, we rely on the default of qemu, which
is:
cgroup_controllers = ["cpu", "devices", "memory", "blkio", "cpuacct", "net_cls"]

Only if they are really mounted, they will be used. So, this will
work on both version 6 and 7.

The 'fix script' didn't work well, as after a reboot you'd still have qemu
throwing errors. Now we can handle the co-mountedcgroups.
2015-08-24 15:49:40 +02:00
Jayapal
79fcbd4a59 CLOUDSTACK-7213: fixed continuing cloud-setup-database if there is no selinux 2014-08-01 15:54:17 +05:30
Chip Childers
da45ae1150 Fixing license headers in the python folder 2012-08-20 11:23:41 -04:00
David Nalley
316fa631df fixing python line endings 2012-04-07 19:41:39 -04:00
frank
2f634c0913 Switch to Apache license 2012-04-03 04:50:05 -07:00
Frank
92155522f2 Add license header to files 2011-04-14 11:23:14 -07:00
Edison Su
38d21a6de7 do not need "FORWARD -i cloudbr0 -o cloudbr0 -j ACCEPT" any more 2011-03-02 20:08:49 -05:00
Frank
c38aff60f4 Bug 8275 - SELinux error message provides incorrect directions
status 8275: resloved fixed
2011-02-07 13:39:35 -08:00
Frank
7b1deef915 Bug 8221 - cloud-setup-databases fails when using RHEL 5.6
status 8221: resloved fixed
2011-02-01 12:12:42 -08:00
Edison Su
72e82c8c8c fix adding customized public/private nics for kvm 2011-01-15 09:52:38 -05:00
Edison Su
daff97e916 bug 7936: fix script on centos
status 7936: resolved fixed
2011-01-11 09:57:55 -05:00
Edison Su
4a409200dc fix build for rhel6 and fix router default gw 2011-01-07 08:02:15 -05:00
edison
5c73e46113 bug 7296: add kvm.public.network.device and kvm.private.network.device from UI
status 7296: resolved fixed
2010-12-04 20:01:10 -08:00
Manuel Amador (Rudd-O)
521fcff899 bug 6221: we put a > as a prompt in interactive setup scripts
status 6221: resolved fixed
2010-09-20 13:28:01 -07:00
edison
d933f19d35 bug 5800: add cluster for KVM
TODO: need to make sure the host cpu is from the same vender in a cluster
2010-09-10 16:00:36 -07:00
Alex Huang
7249f168d5 more file changes 2010-09-09 13:27:20 -07:00
edison
53df26daaa "Add host" for kvm:
The sequence:
1. add host in UI
2. scp setup_agent.sh to agent host, and execute it. This script receives hostip,zoneid, podid and guid, then runs "cloud-setup-agent" and "cloud-setup-console-proxy". Here, we assume that network/hostname and cloud-agent are already configed and installed.
3. Write a dummy kvm resource into the database, then wait for agent connects to server, by polling the database for every 1 minutes. If it finds the agent is in UP state in database, then return, or wait for at least 10 minutes.
2010-08-13 23:19:36 -07:00
Manuel Amador (Rudd-O)
a2cf253b20 bug 5876: Fix error reporting in agent setup so it will not cause a nested exception
The function stderr was being called with the wrong name of interpolation parameters.  The exception was missing from the arguments to the function.

status 5876: resolved fixed
2010-08-12 15:22:34 -07:00
Manuel Amador (Rudd-O)
b97899b2cf Correct indentationerror in python 2010-08-12 15:21:51 -07:00
edison
dc005b9b9c add setup_agent.sh, the first script running during add host
Make cloud-setup-agent/console-proxy in unattended mode
2010-08-11 19:31:07 -07:00
Manuel Amador (Rudd-O)
05c020e1f6 Source code committed 2010-08-11 09:13:29 -07:00