Commit Graph

34858 Commits

Author SHA1 Message Date
Harikrishna 4a43633ac1
Allow storage migration scaleIO/Powerflex volumes (#246)
* Live storage migration of volume in scaleIO within same storage scaleio cluster

* Added migrate command

* Recent changes of migration across clusters

* Fixed uuid

* recent changes

* Pivot changes

* working blockcopy api in libvirt

* Checking block copy status

* Formatting code

* Fixed unit tests

* Upgrade libvirt java version to 0.5.3

* code refactoring and some changes

* Removed unused methods

* removed unused imports

* Unit tests to check if volume belongs to same or different storage scaleio cluster

* Unit tests for volume livemigration in ScaleIOPrimaryDataStoreDriver

* Fixed offline volume migration case and allowed encrypted volume migration

* Added more integration tests

* Support for migration of encrypted volumes across different scaleio clusters

* Fix UI notifications for migrate volume

* Data volume offline migration: save encryption details to destination volume entry

* Offline storage migration for scaleio encrypted volumes

* Allow multiple Volumes to be migrated with migrateVirtualMachineWithVolume API

* Add volume secrets if does not exists during volume migrations. secrets are getting cleared on package upgrades.

* Fix Unit tests

* Fix secret UUID for encrypted volume migration

* Added a null check for secret before removing

* Added new tests
2023-06-12 17:24:18 +05:30
Marcus Sorensen 3520e4d4d3
Fix DirectDownload certificate check initial delay (#257)
Co-authored-by: Marcus Sorensen <mls@apple.com>
2023-05-09 18:10:50 -06:00
Oscar Sandoval cd0f917266
Merge pull request #258 from shapeblue/radar_108905297
WIP: increase log detail, fix getDomainReservation()
2023-05-09 12:23:57 -07:00
Marcus Sorensen 3c1dfa54f0
fix null pointer on powerflex attach volume edge case (#259)
Co-authored-by: Marcus Sorensen <mls@apple.com>
2023-05-08 12:04:13 +05:30
Rohit Yadav 0fffcb6913
Update libvirtqemuhook.in (#260) 2023-05-08 12:03:34 +05:30
Marcus Sorensen 189efabc85
Send console text slower to avoid overloading remote keyboard buffer (#254)
Co-authored-by: Marcus Sorensen <mls@apple.com>
2023-05-08 11:53:00 +05:30
Oscar Sandoval c3d7cee54f increase log detail, fix getDomainReservation() 2023-05-05 12:25:07 -07:00
Rohit Yadav 9ca42f118a
Support local storage live migration for direct download templates (#255)
Co-authored-by: Marcus Sorensen <mls@apple.com>
2023-05-05 07:59:15 -03:00
Oscar Sandoval 2a81d67c15
change to python3 to allow build (#253)
Co-authored-by: Oscar Sandoval <osandovalocana@apple.com>
2023-04-19 19:36:20 +05:30
Nicolas Vazquez e6fcb03837
Allow multiple bypassed references but use the greatest in size (#251)
Fixes #226
2023-04-13 12:47:56 +05:30
Wei Zhou 6a055ef515
noVNC: upgrade from v1.2.0 to v1.4.0 (#234)
* noVNC: apply noVNC-v1.2.0-v1.4.0.patch

1. Create the patch by commands

git clone -b v1.2.0 https://github.com/novnc/noVNC.git .
git checkout v1.4.0
git diff v1.2.0 >noVNC-v1.2.0-v1.4.0.patch

2. Apply the patch by

cd systemvm/agent/noVNC
patch -p1 <noVNC-v1.2.0-v1.4.0.patch

* noVNC: apply noVNC-v1.2.0-v1.4.0.patch part2

fix conflicts

* noVNC: svg to png
2023-04-05 09:49:49 +02:00
Abhishek Kumar 1cf60d30b5
server: fix userdatadetails parsing (#245)
Fixes #231

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2023-04-04 17:00:18 +05:30
Abhishek Kumar 14e96552ba
api: userdata api access (#242)
* api: userdata api access

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* add smoke test

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* address review comment

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

---------

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2023-03-31 15:15:46 +05:30
Abhishek Kumar 6161046ab1
orchestration: fix error on deleted template vm start (#241)
* server: fix error on deleted template vm start

Fixes #230

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* fix

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

---------

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2023-03-31 15:13:05 +05:30
Nicolas Vazquez cd053c86af
FR67: Auto-Disable-Enable KVM Host (#228)
* Auto Enable Disable KVM hosts

* Improve health check result

* Fix corner cases

* Script path refactor

* Fix sonar cloud reports

* Fix last code smells

* Add marvin tests

* Fix new line on agent.properties to prevent host add failures

* Send alert on auto-enable-disable and add annotations when the setting is enabled

* Address reviews

* Add a reason for enabling or disabling a host when the automatic feature is enabled

* Fix comment on the marvin test description

* Fix for disabling the feature if the admin has manually updated the host resource state before any health check result
2023-03-30 08:17:44 -03:00
Marcus Sorensen dce4c97787
Support Jetty's live cert reload on HTTPS frontend (#7355) (#250)
* Support Jetty's live cert reload



* Update ServerDaemon.java

---------

Signed-off-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: Marcus Sorensen <mls@apple.com>
2023-03-27 09:27:38 -06:00
Nicolas Vazquez 7b8cbcde6c
Fix for issue #235: Fix TLS backend VNC for non root qemu (#238)
* Fix TLS backend VNC for non root qemu

* Add CA directory to the qemu group

* Fix qemu group permissions

* Final fix for users on the qemu group

* Fix dynamic qemu group search

* Retrieve group from qemu.conf file

* Address review comments
2023-03-10 15:57:01 +05:30
Marcus Sorensen 2316e800ba
Apple base416 passphrase enc (#240)
* Move PassphraseVO to use String instead of byte[] to support Encrypt annotation

* Check for unencrypted passphrases before migrating passphrase table

---------

Co-authored-by: Marcus Sorensen <mls@apple.com>
2023-03-03 08:40:46 -07:00
Marcus Sorensen 5bca36f258 Don't log VNC password in VirtualMachineTO
Signed-off-by: Marcus Sorensen <mls@apple.com>
2023-02-27 09:08:46 -07:00
Marcus Sorensen 6df183f407
Apple base416 saml fixes (#236)
* Add EncryptedElementType key resolver to SAML plugin

* saml: Fix SAML SSO plugin redirect URL (#6457)

This PR fixes the issue #6427 -> SAML request must be appended to an IdP URL as a query param with an ampersand, if the URL already contains a question mark, as opposed to always assume that IdP URLs don't have any query params.
Google's IdP URL for instance looks like this: https://accounts.google.com/o/saml2/idp?idpid=<ID>, therefore the expected redirect URL would be https://accounts.google.com/o/saml2/idp?idpid=<ID>&SAMLRequest=<SAMLRequest>

This code change is backwards compatible with the current behaviour.

* Apply backport for SAML session cookie path

https://github.com/apache/cloudstack/pull/6149

* ui: Logout before login (#6193)

This PR calls the logout API before login, to cleanup any duplicate sessionkey, as it was done on the legacy UI: #4326
Fixes: #6127

---------

Co-authored-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: Luis Moreira <Luis-3M@users.noreply.github.com>
Co-authored-by: Nicolas Vazquez <nicovazquez90@gmail.com>
2023-02-23 09:40:09 -07:00
Marcus Sorensen 0b7619b36d
Backport host memory refresh from upstream #6622 (#229)
Co-authored-by: Marcus Sorensen <mls@apple.com>
2023-02-13 13:38:09 -07:00
Wei Zhou 8483e8a77e
Apple FR68: modify "passphrase" column to varchar(255) (#227)
For existing environments, please modify the column by

ALTER TABLE `cloud`.`passphrase` MODIFY COLUMN `passphrase` varchar(255) DEFAULT NULL;
2023-02-01 11:13:13 +01:00
Wei Zhou 67b60385af
Apple FR68: New database encryption cipher (#214)
* Rough start swapping DB Encryption, add CLI PoC

* Enhance EncryptionCLI to have command line parsing

* Refactor new encryption behind AeadBase64Encryptor for every use

* Add comment about encryption passwords

* EncryptionSecretKeyChanger - use reflection to find all encrypted tables

Over the years this hasn't been updated properly. Use reflection to find
the tables with encrypted fields. This will also ensure any plugins in
the classpath that add tables will get their encrypted fields updated as well.

Table vpn_users has encrypted columns [password]
Table sslcerts has encrypted columns [password, key]
Table user_view has encrypted columns [secret_key]
Table account_details has encrypted columns [value]
Table domain_details has encrypted columns [value]
Table s2s_customer_gateway has encrypted columns [ipsec_psk]
Table ucs_manager has encrypted columns [password]
Table vm_instance has encrypted columns [vnc_password]
Table passphrase has encrypted columns [passphrase]
Table keystore has encrypted columns [key]
Table external_stratosphere_ssp_credentials has encrypted columns [password]
Table storage_pool has encrypted columns [user_info]
Table remote_access_vpn has encrypted columns [ipsec_psk]
Table user has encrypted columns [secret_key]
Table oobm has encrypted columns [password]

* Apple FR68: add new class CloudStackEncryptor

* Apple FR68: add interface com.cloud.utils.crypt.Encryptor

* Apple FR68: update com.cloud.utils.EncryptionUtil

* Apple FR68: add cloudstack-utils.jar to cloudstack-common package

* Apple FR68: use cloudstack-utils.jar in scripts

* Apple FR68: revert replace.properties to original version

* Apple FR68: update EncryptionSecretKeyChanger

* Apple FR68: Add EncryptorVersion to CloudStackEncryptor

* Apple FR68: Update com.cloud.utils.crypt.EncryptionCLI

* Apple FR68: Remove check on EncryptionSecretKeyChecker.useEncryption in CloudStackEncryptor

* Apple FR68: update EncryptionSecretKeyChanger part2

* Apple FR68: update EncryptionSecretKeyChanger part3 (force update)

* Apple FR68: move cloud-migrate-databases.in to deprecated and recreate it with java command

* Apple FR68: update EncryptionSecretKeyChanger part4 (add skip-database-migration)

* Apple FR68: set encryptor in first encryption in CloudStackEncryptor

* Apple FR68: save db.cloud.encryptor.version in db.properties

* Apple FR68: update EncryptionSecretKeyChanger part4 (clear db.cloud.encryptor.version)

* Apple FR68: load and save db.cloud.encryptor.version in db.properties

* Apple FR68: Add caller class name in debug messages

* Apple FR68: consider non-exist tables and columns

* Apple FR68: skip tables if no data exists

* Apple FR68: remove GeneralSecurityException from code

* Apple FR68: hide value with Asterisks in CloudStackEncryptor

* Apple FR68: log an error message when fail to load 'init'

* Apple FR68: remove setup/bindir/cloud-migrate-databases.deprecated.in which I think it is not needed

* Apple FR68: add new encryptor version to EncryptionSecretKeyChanger

* Apple FR68: use System.exit(1) in EncryptionSecretKeyChanger

* Apple FR68: check arguments in cloudstack-migrate-databases

* Apple FR68: remove all org.jasypt.* in code

* Apple FR68: initilize database encryptors by getting 'init'

* Apple FR68: migrate server.properties

* Apple FR68: load new management key from environment variable CLOUD_SECRET_KEY_NEW

* Apple FR68: fix unable to load 'init' in fresh installation

* Apple FR68: fix 'Rolling back the transaction' in txn.close

* Apple FR68: improve logging in cloudstack-migrate-databases

* Apple FR68: hide value with Asterisks in other encryptors

* Apple FR68: System.exit(1) if fail to migrate server.properties

* Apple FR68: migrate values from cluster_details,user_vm_details,etc

* Apple FR68: refactor EncryptionSecretKeyChanger

* Apple FR68: update user_vm_deploy_as_is_details values

* Apple FR68: update image_store.url (if protocol is cifs) and storage_pool.path (if pool_type is SMB)

* Apple FR68: minor improvement EncryptionSecretKeyChanger

* Apple FR68: add unit test EncryptionSecretKeyChangerTest

* Apple FR68: support encryption type 'env' in cloudstack-setup-databases to get env "CLOUD_SECRET_KEY" before passed value

* Apple FR68: rename Encryptor to Base64Encryptor

* Apple FR68: Backport community PR 6542

* Apple FR68: code optimization

* Apple FR68: use Options and StringUtils

* Apple FR68: add license headers

* Apple FR68: refactor CloudStackEncryptor as per Daan's review

* Apple FR68: refactor DatabaseUpgradeChecker as per Daan's review

* Apple FR68: show error message in usage.log if fail to get encrypted configurations

* Apple FR68: load new MS key from env before migration

* Apple FR68: return 1 if fail to parse arguments of EncryptionCLI

* Apple FR68: fix code smells

* Apple FR68: fix code smells (part2)

* Apple FR68: revert FOOTER of cloudstack-migrate-databases to use \n

* Apple FR68: update help message of cloudstack-setup-databases

* Apple FR68: fix code smells (part3)

* Apple FR68: make changes as per suggestions

* Apple FR68: migrate database if new encryptor version is set to different

Testing result: (assume db.cloud.encryptor.version=V1)

(1) migrate only db.properties (same db key, same db encryptor version)
Command: /usr/bin/cloudstack-migrate-databases -m mgmtkey -d dbkey -n newmgmtkey -v V1
Changes: db.cloud.encrypt.secret is encrypted by V2 (always)
         db.cloud.encryptor.version=V1
         cloudstack database is not migrated

(2) migrate only db.properties (same db key, new db encryptorversion)
Command: /usr/bin/cloudstack-migrate-databases -m mgmtkey -d dbkey -n newmgmtkey -v V2 --skip-database-migration
Changes: db.cloud.encrypt.secret is encrypted by V2 (always)
         db.cloud.encryptor.version=V2
         cloudstack database is not migrated (mostly on secondary management servers)

(3) migrate only db.properties (same db key, db encryptor version is not set)
Command: /usr/bin/cloudstack-migrate-databases -m mgmtkey -d dbkey -n newmgmtkey
Changes: db.cloud.encrypt.secret is encrypted by V2 (always)
         db.cloud.encryptor.version=V1
         cloudstack database is not migrated

(4) migrate only db.properties (different db key, same db encryptor version)
Command: /usr/bin/cloudstack-migrate-databases -m mgmtkey -d dbkey -n newmgmtkey -e newdbkey -v V1 --skip-database-migration
Changes: db.cloud.encrypt.secret is encrypted by V2 (always)
         db.cloud.encryptor.version=V1
         cloudstack database is not migrated (mostly on secondary management servers)

(5) migrate only db.properties (different db key, new db version)
Command: /usr/bin/cloudstack-migrate-databases -m mgmtkey -d dbkey -n newmgmtkey -e newdbkey -v V2 --skip-database-migration
Changes: db.cloud.encrypt.secret is encrypted by V2 (always)
         db.cloud.encryptor.version=V2
         cloudstack database is not migrated (mostly on secondary management servers)

(6) migrate only db.properties (different db key, db encryptor version is not set)
Command: /usr/bin/cloudstack-migrate-databases -m mgmtkey -d dbkey -n newmgmtkey -e newdbkey --skip-database-migration
Changes: db.cloud.encrypt.secret is encrypted by V2 (always)
         db.cloud.encryptor.version=V1
         cloudstack database is not migrated (mostly on secondary management servers)

(7) migrate db.properties and database (same db key, same db encryptor version)
Command: /usr/bin/cloudstack-migrate-databases -m mgmtkey -d dbkey -n newmgmtkey -v V1 --force-database-migration
Changes: db.cloud.encrypt.secret is encrypted by V2 (always)
         db.cloud.encryptor.version=V1
         cloudstack database is migrated using encryptor V1

(8) migrate db.properties and database (same db key, new db encryptor version)
Command: /usr/bin/cloudstack-migrate-databases -m mgmtkey -d dbkey -n newmgmtkey -v V2
Changes: db.cloud.encrypt.secret is encrypted by V2 (always)
         db.cloud.encryptor.version=V2
         cloudstack database is migrated using encryptor V2

(9) migrate db.properties and database (same db key, db encryptor version is not set)
Command: /usr/bin/cloudstack-migrate-databases -m mgmtkey -d dbkey -n newmgmtkey --force-database-migration
Changes: db.cloud.encrypt.secret is encrypted by V2 (always)
         db.cloud.encryptor.version=V1
         cloudstack database is migrated using encryptor V1

(10) migrate db.properties and database (different db key, same db encryptor version)
Command: /usr/bin/cloudstack-migrate-databases -m mgmtkey -d dbkey -n newmgmtkey -e newdbkey -v V1
Changes: db.cloud.encrypt.secret is encrypted by V2 (always)
         db.cloud.encryptor.version=V1
         cloudstack database is migrated using encryptor V1

(11) migrate db.properties and database (different db key, new db encryptor version)
Command: /usr/bin/cloudstack-migrate-databases -m mgmtkey -d dbkey -n newmgmtkey -e newdbkey -v V2
Changes: db.cloud.encrypt.secret is encrypted by V2 (always)
         db.cloud.encryptor.version=V2
         cloudstack database is migrated using encryptor V2

(12) migrate db.properties and database (different db key, db encryptor version is not set)
Command: /usr/bin/cloudstack-migrate-databases -m mgmtkey -d dbkey -n newmgmtkey -e newdbkey
Changes: db.cloud.encrypt.secret is encrypted by V2 (always)
         db.cloud.encryptor.version=V1
         cloudstack database is migrated using encryptor V1

* smoke test: fix test_primary_storage.py

* smoke test: Do NOT run tests in test_primary_storage.py in parallel

This also fixes an issue in detachvolume

'Failed to detach volume Test Volume-yyyyyy from VM VM-zzzzzz; com.cloud.exception.InternalErrorException: Could not detach volume. Probably the VM is in boot state at the moment'

* Update PR7003: rename method

---------

Co-authored-by: Marcus Sorensen <mls@apple.com>
2023-01-31 13:18:28 +01:00
Nicolas Vazquez 0db844f336
Backport community fix for #210 (#222)
* Create table to store available console sessions

* Handle the new table in Java (VO and DAO)

* Manage console sessions via database

* Fix cherry-pick: verify in database if the session exist

* Address reviews: rename table to console_session and rename java objects according to the table name

* Redesign console_session to store more data

* Remove unnecessary constructor

* Use create table syntax previous to mariadb 10.5

* Add console session cleanup task

* Address review

* Add missing config keys

* Fix sonar cloud reports

* In progress fix console load report

* Fix remove console when session ends

* Improve setting description

---------

Co-authored-by: GutoVeronezi <daniel@scclouds.com.br>
2023-01-30 08:19:48 -03:00
Nicolas Vazquez 7a5a663362
Fix for #220: memory leak on volume allocation (#224)
* Remove unnecessary logging

* Add marvin test

* Fix marvin test error
2023-01-27 07:53:32 -03:00
Marcus Sorensen 99d132eb48
Fix UEFI detection on KVM and prevent deployments on non UEFI enabled hosts (#6423) (#221)
* Do not allow UEFI deployments on non UEFI enabled hosts

* Fix UEFI detection on KVM

* Refactor

* Improvement

agent: Detect existing hosts with UEFI support (#6139)

* agent: Pass uefi enabled status as part of ready command

* Cleanup

* Fix checkstyle

* Save uefi status if different

Co-authored-by: Marcus Sorensen <mls@apple.com>
2023-01-27 15:53:53 +05:30
Wei Zhou 4382a33ab6
server: allow expunging VMs in Expunging state (#219) 2023-01-27 15:46:33 +05:30
Nicolas Vazquez 25460f05ab
Update activity time when reading from socket (#223) 2023-01-20 09:35:00 -03:00
Nicolas Vazquez b0c47f4a97
FR65: Secure KVM VNC connection using CA framework (#217)
* Support RFB 3.8 and VNC auth working

* IN PROGRESS: Add TigerVNC classes and authenticate, work left on the messaging

* Fix console display

* Cleanup

* Last in-progress work

* Don't block reads in case stream empty, use Link to init client certs (#215)

Co-authored-by: Marcus Sorensen <mls@apple.com>

* Unused files and methods cleanup

* Rewrite finished

* More cleanup

* Rename console server session to VM display name (#216)

* Rename console server session to VM display name

* Fix after rebasing

* Add encryption bar when available

Co-authored-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: Nicolas Vazquez <nicovazquez90@gmail.com>

* Add missing license header

* Remove unused variable from the TLS security

* Address review comments and sonar cloud reports

* Address more review comments

* Last sonarcloud code smell fixes

* Automate VNC TLS provisioning and improve UI

* Add missing cases for sonarcloud report

* Fix certs renewal issue on configuring TLS

* Address review comments

* Refactor serviceConfig script

* Fix certs propagation TLS conf

* Fix unsecure host tests

Co-authored-by: Marcus Sorensen <marcus_sorensen@apple.com>
Co-authored-by: Marcus Sorensen <mls@apple.com>
2023-01-19 08:35:16 -03:00
Wei Zhou 11f38ad102
Apple FR66 - Host Control Plane Status (#213)
* Apple FR66 - Host Control Plane Status

* Apple FR66 - use Offline instead of Disconnected

* Apple FR66: fix smoke test test_router_host_control_state

* Apple FR66: reorder import

* Apple FR66: revert DetailsTab.vue and apply new changes

* Update PR: update en.json

* Update PR: add hostcontrolstate to routers/systemvms

* Update PR: test stop/start cloudstack-agent in smoke test

* Update PR: fix UI build error (The template root requires exactly one element  vue/valid-template-root)

* Update PR: update message on ui

* Update PR: Disable rebootVM and create vm/volume snapshot for KVM VMs

* Update PR: add more unit tests
2023-01-04 13:01:10 +01:00
Nicolas Vazquez f77ab62377
Backport PR#6919 last commit (#218) 2022-12-23 14:50:00 +01:00
Nicolas Vazquez 5c83f90096
Fix: Console endpoint API VM state handling, FR64 Follow-up (#212)
* Remove configkey to use the optional token parameter and improve preconditions

* Improve condition
2022-12-12 12:26:11 +05:30
mprokopchuk ceb4e9dd33
When VM is created and ROOT volume is created it should emit a VOLUME.CREATE event (#209)
* When VM is created and ROOT volume is created it should emit a VOLUME.CREATE event

* added space between methods

* Updated volume context comments.

Co-authored-by: Maxim Prokopchuk <mprokopchuk@apple.com>
2022-11-30 11:35:05 -07:00
Marcus Sorensen 1f0a85aed8
Refactor few process of VirtualMachineManagerImpl and improve logs (#4966) (#211)
* Improve logs

* Remove unnecessary comments

* Use diamond inference

* Fix some logs

* Remove unnecessary unboxing

* Create method to handle job result

* Remove unused vars and fix some logics

* Extract code to method and few adjusts

* Use CollectionUtils

* Extract pending work job validation to method

* Create new constructors

* Extract work job and info creation to a method

* Extract submit async job to a method

* Extract find vm by id to a method

* Change log level from trace to debug

* Remove unnused methods and add logs

* Undo code remotion

* Remove asserts and fix conditionals

* Address @GabrielBrascher reviews

* Remove double quotes from keys in manual json

* Undo code remotion

* Add object to log

* Remove statement from try/catch

* Implement toString with ReflectionToStringBuilderUtils

* Fix errors related to merge main

Co-authored-by: Daniel Augusto Veronezi Salvador <daniel@scclouds.com.br>

Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com>
Co-authored-by: Daniel Augusto Veronezi Salvador <daniel@scclouds.com.br>
2022-11-18 20:37:11 +05:30
Marcus Sorensen 8885d252f0
When VM start fails at host for admin, report error (#208)
* When VM start fails at host for admin, report error

Signed-off-by: Marcus Sorensen <mls@apple.com>

* Report ResourceUnavailableExceptions that result in InsufficientCapacityException to admin

* Update error message to be more straightforward

Signed-off-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: Marcus Sorensen <mls@apple.com>
2022-11-04 12:45:57 +05:30
Marcus Sorensen 89dfb54929
kvm: Allow ssvm agent certs to contain host IP for NAT situations (#206)
There are some networking setups where system VM communications are proxied off of the hypervisor host on which the system VM is running. For example, if the KVM management network is a NAT bridge, or the network plugin employs user mode network for system VM management interfaces, then system VM agent comms look as though they come form the hypervisor host.

In such a setup, the certificate authentication for agents fails because the source IP is that of the host of the system VM, rather than the system VM itself, and this IP is not in the connecting certificate presented. This PR adds a configuration value that allows the system VM cert to contain the host IP that the system VM is scheduled on. This allows such setups to maintain auth strictness on agent auth.

Co-authored-by: Marcus Sorensen <mls@apple.com>
2022-10-31 10:51:58 +05:30
Harikrishna d83c70cd25
User data as first class resource (#193)
* UserData as first clas resource

* Few fixes

* Added userdata id in deploy VM flow

* Fixed userdata append scenario between template userdata and user provided userdata

* UI: added a new section for userdata

* Added userdata details to the deployVM cmd flow

* Write userdata details into metadata VR

* Updated template response and views

* UI: added userdata id to deloyvm wizard

* Added userdata list to deploy VM form

* Added userdata params to registeruserdata UI form

* Small fixes and added userdata to updateVM flow

* Fixed unit tests and imports

* Userdata Navigation in template view

* Added userdata denyoverride flag and userdata params section

* Added ToolTips and fixes deploy VM, register userdata form

* added userdata policy list to register template form

* Allow override append of userdata in deploy VM flow

* update userdata linking to template

* Few UI fixes in deploy VM and edit template form

* fixes in deploy VM form to support deny userdata policy

* Added unit tests for userdata

* Added unit tests for linking userdata to template

* Remove unused imports

* Move test file to proper files

* Fix unused imports

* Fix Userdata delete flow

* Few improvements in the code

* Adding marvin tests for userdata

* Fixed marvin tests for registerd userdata

* Added few more marvin tests for userdata

* Few code fixes

* Few more code fixes

* Added userdata details to register and upload iso forms

* Added userdata selection in deploy VM form for ISOs

* Add comments section to userdata

* Added new API to reset UserData of a VM along with UpdateVM API

* Added new UnitTests for resetVMUserData

* Added resetVMUserdata in UI for stopped VM

* Added blank values for userdata in edit template form

* Added ISO id to the linkuserdatatotemplate API

* Added validation to userdata params so that it wont contain any VR metadafile names

* Removed required param for iso id in linkuserdatatotemplate cmd

* Added length to userdata param

* remove delete cascade on user_vm and vm_template tables for userdata id foreign key reference.

* Fix custom userdata params for config drive by adding userdata file name and value metadata json

* Fix marvin test case

* added comments to marvin test cases

* Fix document link in UI

* Added a check while deleting the userdata, to see if no VMs are using the userdata

* Added unit tests

* Removed labels added during merge

* added success message for userdata registration

* Added Schema changes to 4160 to 4161 upgrade path

* Fixed imports and some errors

* Fix service offering uuid in mysql view

* UI changes wrt to 4.16 branch mostly related to vue2

* Some UI fixes

* Register userdata and update template form fixes

* Fixed compute.js related to userdata

* UI fixes and user_vm_view wrt sshkey

* Fixed update template form

* Fix deploy VM and userdata reset forms

* Fixed Register and upload template and ISO forms

* Fixed getting params for userdata from template in instance creation form

* Removed CloudZonesNetworkElement.java as part of rebase, which is actually removed in https://github.com/shapeblue/cloudstack-apple/pull/191

* Fixed userdata selection in deploy vm and reset userdata vm forms

* Fixed method calls after rebase
2022-10-03 15:54:39 +05:30
Marcus Sorensen 015ee74e2f
Refuse to change service offering if encryption value would change (#203) 2022-09-28 12:00:32 -06:00
Marcus Sorensen 82879af238
EL8 uses rng-tools (#202) 2022-09-27 12:00:15 -06:00
Marcus Sorensen 744897ac31
Skip revoking PowerFlex volume access if no host is provided (#197)
Signed-off-by: Marcus Sorensen <mls@apple.com>
2022-09-26 11:29:48 -06:00
Marcus Sorensen 248956351f
Skip volume resize during service offering change when no size exists (#200)
Signed-off-by: Marcus Sorensen <mls@apple.com>
2022-09-26 11:29:28 -06:00
mprokopchuk 1fcd32fa33
VOLUME.DETACH, created during VM removal has type VirtualMachine instead of Volume and has "Vm Id: XXX" in the description. (#199)
Volume detach should publish volume resource info, not VM resource info

Co-authored-by: Maxim Prokopchuk <mprokopchuk@apple.com>
2022-09-26 11:28:48 -06:00
Rohit Yadav a652570408
packaging: Add dependencies to fix test failures from vol. encryption #135 (#201)
Install haveged on mgmt server, which could require random generation for VM/volume passphrase
rng-tools and cryptsetup for this feature on kvm hosts. Automatically start haveged on mgmt server
and rngd on kvm hosts.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com
2022-09-23 13:13:46 +05:30
dahn 5f63054ee0
Resource reservations (#192)
* reservation table

* try-with-resource

* domain added to reservation

* integration test for parallel vm creations
2022-09-15 09:06:53 +02:00
Nicolas Vazquez 00d8a13a52
Apple FR64: Standardise API driven console access (#188)
* Console access enhancements

* Remove extra logging

* Fix security hotspot

* Fix sonar cloud code smells

* Refactor API response

* Minor fix

* Refactor and increase timeout on ssh to cpvm

* Add marvin tests and extend permissions

* Fix account type

* Add unit tests

* Check vncport file exits on CPVM before attempting to add rules

* Change how vncport is read on cpvm

* Extra validation refactor

* Fix wrong token API param on UI

* Refactor vnc port selection to 8080 or 8443

* Do not display the input token modal and improve error message on console

* Improve error message and prevent opening blank popup when errors

* Fix logging exception due to algorithm
2022-09-07 17:47:13 +05:30
Daniel Augusto Veronezi Salvador d2320bc72b Ignore opensaml dependencies (#6693)
Fixes #194

Commit f27de63 introduced a new version of opensaml. That version brought jcl-over-slf4j-1.7.5.jar, jul-to-slf4j-1.7.5.jar, and log4j-over-slf4j-1.7.5.jar as dependencies, which causes Agents and Usages to not generate logs.
In order to make the logs to work again, this PR intends to exclude these dependencies while building the packages.

(cherry picked from commit e76df16d9f)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2022-09-07 11:18:18 +05:30
Marcus Sorensen ac3f3c8799
Allow option of exposing VM domain info via instance metadata (#191)
Signed-off-by: Marcus Sorensen <mls@apple.com>

Signed-off-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: Marcus Sorensen <mls@apple.com>
2022-09-06 08:47:11 -06:00
Marcus Sorensen 7d2c2d58b2 Allow caching for ScaleIO qemu-img data copy 2022-09-03 14:30:14 -06:00
Marcus Sorensen d4596ddc9a
Pass storage scope during KVM volume migration to avoid remotely moun… (#190)
* Use cryptsetup w/o zeroing for encrypted scaleio - faster

Signed-off-by: Marcus Sorensen <mls@apple.com>

* Pass storage scope during KVM volume migration to avoid remotely mounting local storage

Signed-off-by: Marcus Sorensen <mls@apple.com>

* Add method to choose template pool based on scope

Signed-off-by: Marcus Sorensen <mls@apple.com>

* Clean up null check when creating migration options

Signed-off-by: Marcus Sorensen <mls@apple.com>

* ScaleIO enhancements - thin/thick encrypted, online resize

Signed-off-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: Marcus Sorensen <mls@apple.com>
2022-08-26 09:47:04 -06:00
Suresh Kumar Anaparti 557045bced
Updated resource counter to include correct size after volume creation/resize and other improvements (#186)
* Updated resource counter to include correct size after volume creation/resize and other improvements
- Recalculate resource counters for root domain in the periodic task
- Update correct size in the primary_storage resource counter after volume creation/resize
- Some code improvements

* Removed extra white space

* review and sonarcloud issues

Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
Co-authored-by: Daan Hoogland <daan@onecht.net>
2022-08-16 15:06:15 +05:30