85 Commits

Author SHA1 Message Date
Nicolas Vazquez
c0ddda361a
[VMware] Fix service offerings listing on appliances deployment options (#5752)
* Fix list service offerings for VMware deployment options

* UI fix to allow selecting offerings
2021-12-30 16:13:41 +05:30
Abhishek Kumar
0ad742405c
api,server,engine/schema: admin listvm api clusterid (#5659)
* api,server,engine/schema: admin listvm api clusterid

Add clusterid parameter in listVirtualMachines API for admin

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

* import order

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

* set clusterid only for ListVMsCmdByAdmin

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-11-04 08:47:42 +05:30
Leo (Hsueh Yu-Min)
72a1c0e7f1
[KVM] Add MV Settings for virtual GPU hardware type and memory (#5513)
* KVM: Add MV Settings for virtual GPU hardware type and memory

* fix method createVideoDef argument in test package

* add available options for KVM virtual GPU hardware VM setting

* fix videoRam default value

* fix _videoRam is 0, it will use default provided by libvirt
2021-10-04 09:55:32 +05:30
Abhishek Kumar
981dac7bca
server: allow listing custom offerings for a running VM (#5420)
* server: allow listing custom offerings for a running VM

listServiceOffering API when called for a running VM only fails to list all possible offerings especially the custom offerings and all offerings when VM is deployed using a custom offering.
This improves the list behviour by adding adding appropriate conditions for the custom offerings.

Fixes #5412

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

Co-authored-by: davidjumani <dj.davidjumani1994@gmail.com>
2021-09-17 01:48:24 +05:30
Pearl Dsilva
3f827ef22b
UI: Support to upload resource icons (#5157)
* Resource Icon support - backend

* Add API support for resourceicon

* update reponse params + ui support

* Add exclusive list api for icons and UI changes

* refactor upload view

* UI changes to support resource icon wherever necessary

* convert api to POST + refactor icon view

* Add response name to list API + cosmetic changes in UI

* Added support for the following:
resource icon support for vpcs, networks, domains, and projects
add icons to list view if reosurces support icons to be added
support for showing project icons in the project switching drop-down menu

* List resourceicon cmds to be allowed for user role too
Users to inherit account icon if present (in listUsers response)
Move common code to plugin.js
Add icon to project list view - while switching between projects - Dashboard page
Show icons against zones - Capacity Dashboard view
Show user / account icon at the login button if present

* cosmetic changes

* optimize ui code

* fix reload issue for domain view

* add access check for delete operation

* ui-related changes to show iso icons

* iso image in uservm response

* add icons to custom form's list resources

* some more custom forms aligned to show icon for resources

* conmitic changes + add listing of icons to listdomainchildren cmd

* Add backend/server-side validation for base64 string passed for image

* change preview border

* preselect zone if there's only one

* add default icon

* show icon for network list in deploy vm view

* add custom icons if any to the import-export VM view

* preselect zone persistence on clearing cache

* prevent root vol from inheriting template/iso icon

* show tempalte icon in the info card details

* fix icon not being show on hard-refresh / initial traversal

* fx success message
2021-09-15 00:50:42 -03:00
nicolas
13d8489478
Merge branch '4.15' into main 2021-09-03 00:06:08 -03:00
davidjumani
a5e7e08a6b
Filter disk / service offerings by domain at DB level (#5307)
* Filter disk / service offerings by domain at DB level

* Search for tags in the db

* Update search to include host tags

* Differenciate between tags

* Refactor
2021-09-02 23:56:18 -03:00
DK101010
9163013683
Feat/ram reservation (#4662)
* remove hot enable cpu und memory in case of reservation

ram and cpu reservation have not relation to ram and cpu hot add

* add custom ram_reservation and it to vm details

* system vms haven't this property, for this reason add additional check

* Update plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java

Co-authored-by: dahn <daan.hoogland@gmail.com>

* replace 0.0 with NumberUtils

* remove default value and remove return MinRam(seems to be not necessary)

* Update plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VmwareVmImplementer.java

Co-authored-by: davidjumani <dj.davidjumani1994@gmail.com>

* Update plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java

Co-authored-by: davidjumani <dj.davidjumani1994@gmail.com>

Co-authored-by: DK101010 <dirk.klahre@itelligence.de>
Co-authored-by: dahn <daan.hoogland@gmail.com>
Co-authored-by: davidjumani <dj.davidjumani1994@gmail.com>
2021-08-24 14:15:52 -03:00
Abhishek Kumar
7bfc7f04fe
server: use id column as secondary sort criteria with sortKey (#5320)
For tables that use sort_key field, incorrect results can be returned by the list* APIs while using pagination and with the same values for sort-key field. (Default value for sort_key field remains 0).
This change adds id column as secondary sort criteria in such cases.

Fixes #5316

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-08-18 16:52:25 +05:30
davidjumani
cb1078aa20
Merge remote-tracking branch 'apache/4.15' into main 2021-08-09 15:10:51 +05:30
Abhishek Kumar
1ccb42017f
server: skip zone check for PERHOST iso during attachIso (#5270)
* server: skip zone check for PERHOST iso during attachIso

Hypervisor tools ISO - vmware-toools.iso, xs-tools.iso are marked as PERHOST in DB. They are active but not downloaded to the secondary storages and hence no template-zone entry.
Skips the template-zone check for such templates.

Fixes #5265

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

* inverted check

* use constants in TemplateManager

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-08-09 14:02:25 +05:30
Spaceman1984
96c9c5a5e2
Added disk provisioning type support for VMWare (#4640)
* Added disk provisioning type support for VMWare

* Review changes

* Fixed unit test

* Review changes

* Added missing licenses

* Review changes

* Update StoragePoolInfo.java

Removed white space

* Review change - Getting disk provisioning strictness setting using the zone id and not the pool id

* Delete __init__.py

* Merge fix

* Fixed failing test

* Added comment about parameters

* Added error log when update fails

* Added exception when using API

* Ordering storage pool selection to prefer thick disk capable pools if available

* Removed unused parameter

* Reordering changes

* Returning storage pool details after update

* Removed multiple pool update, updated marvin test, removed duplicate enum

* Removed comment

* Removed unused import

* Removed for loop

* Added missing return statements for failed checks

* Class name change

* Null pointer

* Added more info when a deployment fails

* Null pointer

* Update api/src/main/java/org/apache/cloudstack/api/BaseListCmd.java

Co-authored-by: dahn <daan.hoogland@gmail.com>

* Small bug fix on API response and added missing bracket

* Removed datastore cluster code

* Removed unused imports, added missing signature

* Removed duplicate config key

* Revert "Added more info when a deployment fails"

This reverts commit 2486db78dca8e034d8ad2386174dfb11004ce654.

Co-authored-by: dahn <daan.hoogland@gmail.com>
2021-07-16 22:37:42 -03:00
Wei Zhou
9ac3925936
server: list routers by healthchecksfailed (#4886)
* server: list routers by healthchecksfailed

* #4886: fix build error

* #4886: ignore global setting

Co-authored-by: Wei Zhou <weizhou@apache.org>
2021-06-29 12:52:24 +05:30
Harikrishna
083646b3c3
server: VM dynamic scaling option granularity (#4643)
This PR introduces new granularity levels to configure VM dynamic scalability. Previously VM is configured to be dynamically scalable based on the template and global setting. Now we bringing this option to configure at service offering and VM level also.

VM can dynamically scale only when all flags are ON at VM level, template, service offering and global setting. If any of the flags is set to false then VM cannot be scalable. This result will be persisted in DB for each VM and will be honoured for that VM till it is updated.

We are introducing 'dynamicscalingallowed' parameter with permitted values of true or false for deployVM API and createServiceOffering API.

Following are the API parameter changes:
createServiceOffering API: 
          dynamicscalingenabled: an optional parameter of type Boolean with default value “true”.
deployVirtualMachine API: 
          dynamicscalingenabled: an optional parameter of type Boolean with default value “true”.

Following are the UI changes:
Service offering creation has ON/OFF switch for dynamic scaling enabled with default value true
2021-06-08 17:10:00 +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
Rohit Yadav
1abd10199c Merge remote-tracking branch 'origin/4.15' 2021-05-04 19:37:45 +05:30
Gabriel Beims Bräscher
ab790c11d5
server: Allow to upgrade service offerings from local <> shared storage pools (#4915)
This PR addresses the issue raised at #4545 (Fail to change Service offering from local <> shared storage).

When upgrading a VM service offering it is validated if the new offering has the same storage scope (local or shared) as the current offering. I think that the validation makes sense in a way of preventing running Root disks with an offering that does not match the current storage pool. However, the validation only compares both offerings and does not consider that it is possible to migrate Volumes between local <> shared storage pools.

The idea behind this implementation is that CloudStack should check the scope of the current storage pool which the ROOT volume is allocated; this, it is possible to migrate the volume between storage pools and list/upgrade according to the offerings that are supported for such pool.

This PR also fixes an issue where the API command that lists offerings for a VM should follow the same idea and list based on the storage pool that the volume is allocated and not the previous offering.

Fixes: #4545
2021-04-30 11:59:50 +05:30
Abhishek Kumar
6d0d7012f1
api,engine/schema,server: vm readonly details rename (#4671)
* api,engine/schema,server: vm readonly details rename

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

* ui: update api response key

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-04-09 13:20:11 +05:30
sureshanaparti
eba186aa40
storage: New Dell EMC PowerFlex Plugin (formerly ScaleIO, VxFlexOS) (#4304)
Added support for PowerFlex/ScaleIO (v3.5 onwards) storage pool as a primary storage in CloudStack (for KVM hypervisor) and enabled VM/Volume operations on that pool (using pool tag).
Please find more details in the FS here:
https://cwiki.apache.org/confluence/x/cDl4CQ

Documentation PR: apache/cloudstack-documentation#169

This enables support for PowerFlex/ScaleIO (v3.5 onwards) storage pool as a primary storage in CloudStack

Other improvements addressed in addition to PowerFlex/ScaleIO support:

- Added support for config drives in host cache for KVM
	=> Changed configuration "vm.configdrive.primarypool.enabled" scope from Global to Zone level
	=> Introduced new zone level configuration "vm.configdrive.force.host.cache.use" (default: false) to force host cache for config drives
	=> Introduced new zone level configuration "vm.configdrive.use.host.cache.on.unsupported.pool" (default: true) to use host cache for config drives when storage pool doesn't support config drive
	=> Added new parameter "host.cache.location" (default: /var/cache/cloud) in KVM agent.properties for specifying the host cache path and create config drives on the "/config" directory on the host cache path
	=> Maintain the config drive location and use it when required on any config drive operation (migrate, delete)

- Detect virtual size from the template URL while registering direct download qcow2 (of KVM hypervisor) templates

- Updated full deployment destination for preparing the network(s) on VM start

- Propagate the direct download certificates uploaded to the newly added KVM hosts

- Discover the template size for direct download templates using any available host from the zones specified on template registration
	=> When zones are not specified while registering template, template size discovery is performed using any available host, which is picked up randomly from one of the available zones

- Release the VM resources when VM is sync-ed to Stopped state on PowerReportMissing (after graceful period)

- Retry VM deployment/start when the host cannot grant access to volume/template

- Mark never-used or downloaded templates as Destroyed on deletion, without sending any DeleteCommand
	=> Do not trigger any DeleteCommand for never-used or downloaded templates as these doesn't exist and cannot be deleted from the datastore

- Check the router filesystem is writable or not, before performing health checks
	=> Introduce a new test "filesystem.writable.test" to check the filesystem is writable or not
	=> The router health checks keeps the config info at "/var/cache/cloud" and updates the monitor results at "/root" for health checks, both are different partitions. So, test at both the locations.
	=> Added new script: "filesystem_writable_check.py" at /opt/cloud/bin/ to check the filesystem is writable or not

- Fixed NPE issue, template is null for DATA disks. Copy template to target storage for ROOT disk (with template id), skip DATA disk(s)

* Addressed some issues for few operations on PowerFlex storage pool.

- Updated migration volume operation to sync the status and wait for migration to complete.

- Updated VM Snapshot naming, for uniqueness in ScaleIO volume name when more than one volume exists in the VM.

- Added sync lock while spooling managed storage template before volume creation from the template (non-direct download).

- Updated resize volume error message string.

- Blocked the below operations on PowerFlex storage pool:
  -> Extract Volume
  -> Create Snapshot for VMSnapshot

* Added the PowerFlex/ScaleIO client connection pool to manage the ScaleIO gateway clients, which uses a single gateway client per Powerflex/ScaleIO storage pool and renews it when the session token expires.

- The token is valid for 8 hours from the time it was created, unless there has been no activity for 10 minutes.
  Reference: https://cpsdocs.dellemc.com/bundle/PF_REST_API_RG/page/GUID-92430F19-9F44-42B6-B898-87D5307AE59B.html

Other fixes included:

- Fail the VM deployment when the host specified in the deployVirtualMachine cmd is not in the right state (i.e. either Resource State is not Enabled or Status is not Up)

- Use the physical file size of the template to check the free space availability on the host, while downloading the direct download templates.

- Perform basic tests (for connectivity and file system) on router before updating the health check config data
	=> Validate the basic tests (connectivity and file system check) on router
	=> Cleanup the health check results when router is destroyed

* Updated PowerFlex/ScaleIO storage plugin version to 4.16.0.0

* UI Changes to support storage plugin for PowerFlex/ScaleIO storage pool.
- PowerFlex pool URL generated from the UI inputs(Gateway, Username, Password, Storage Pool) when adding "PowerFlex" Primary Storage
- Updated protocol to "custom" for PowerFlex provider
- Allow VM Snapshot for stopped VM on KVM hypervisor and PowerFlex/ScaleIO storage pool

and Minor improvements in PowerFlex/ScaleIO storage plugin code

* Added support for PowerFlex/ScaleIO volume migration across different PowerFlex storage instances.

- findStoragePoolsForMigration API returns PowerFlex pool(s) of different instance as suitable pool(s), for volume(s) on PowerFlex storage pool.
- Volume(s) with snapshots are not allowed to migrate to different PowerFlex instance.
- Volume(s) of running VM are not allowed to migrate to other PowerFlex storage pools.
- Volume migration from PowerFlex pool to Non-PowerFlex pool, and vice versa are not supported.

* Fixed change service offering smoke tests in test_service_offerings.py, test_vm_snapshots.py

* Added the PowerFlex/ScaleIO volume/snapshot name to the paths of respective CloudStack resources (Templates, Volumes, Snapshots and VM Snapshots)

* Added new response parameter “supportsStorageSnapshot” (true/false) to volume response, and Updated UI to hide the async backup option while taking snapshot for volume(s) with storage snapshot support.

* Fix to remove the duplicate zone wide pools listed while finding storage pools for migration

* Updated PowerFlex/ScaleIO volume migration checks and rollback migration on failure

* Fixed the PowerFlex/ScaleIO volume name inconsistency issue in the volume path after migration, due to rename failure
2021-02-24 14:58:33 +05:30
Daan Hoogland
b6b778f003 Merge release branch 4.14 to 4.15
* 4.14:
  server: select root disk based on user input during vm import (#4591)
  kvm: Use Q35 chipset for UEFI x86_64 (#4576)
  server: fix wrong error message when create isolated network without SourceNat (#4624)
  server: add possibility to scale vm to current customer offerings (#4622)
  server: keep networks order and ips while move a vm with multiple networks (#4602)
  server: throw exception when update vm nic on L2 network (#4625)
  doc: fix typo in install notes (#4633)
2021-02-01 09:57:35 +00:00
Wei Zhou
a44fb11a02
server: add possibility to scale vm to current customer offerings (#4622)
We can use cloudmonkey to scale a vm with dynamic offering, to same offering but with different cpunumber or memory.
Enable it on UI to improve user experience.
2021-02-01 14:14:48 +05:30
Rakesh
2f5ed9eee4
Consider other conditions while listing templates with id (#4452) 2020-11-17 20:03:49 +01:00
Pearl Dsilva
7f408ec967
Fix: Listing projects comprising of only the user's on listAll=true (#4469)
Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
2020-11-16 13:37:11 +01:00
nvazquez
d864e9dc39 [VMware] Full OVF properties support 2020-10-19 15:05:56 +05:30
Harikrishna Patnala
c16b40e337 Fix list volumes cmd and update volume cmd to accept datastore cluster as storgeid 2020-10-19 14:57:16 +05:30
Harikrishna Patnala
97ae846c1e Removed unused imports caused due to some merge conflicts 2020-10-19 14:57:16 +05:30
Harikrishna Patnala
1244fca367 Handle listsystemvms cmd in case of datastore clusters 2020-10-19 14:57:16 +05:30
Harikrishna Patnala
fc05d3168f Fix ListVMsCmd with storageid as datastore cluster 2020-10-19 14:57:16 +05:30
Harikrishna Patnala
c9c38c0f37 Handle datastore clusters in list storage pools to list only parent not the children in the Datastore cluster 2020-10-19 14:57:15 +05:30
Gabriel Beims Bräscher
4c936b4690
Re-add affinity group (#4405) 2020-10-16 09:16:19 +02:00
Gabriel Beims Bräscher
2e32a3a94a
List VMs by Security Group & HA (#4397) 2020-10-14 09:26:47 +02:00
Pearl Dsilva
82b6971258
server: Handle listProjects API to list projects with user as members when listAll=true (#4316)
* added defensive checks for avoiding NPE and list projects API fix

* list projects with account name provided to not include users in the account in response

Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
2020-09-17 10:20:34 +05:30
Pearl Dsilva
b464fe41c6
server: Secondary Storage Usage Improvements (#4053)
This feature enables the following:
Balanced migration of data objects from source Image store to destination Image store(s)
Complete migration of data
setting an image store to read-only
viewing download progress of templates across all data stores
Related Primate PR: apache/cloudstack-primate#326
2020-09-17 10:12:10 +05:30
Pearl Dsilva
c578004fe5
projects: Role based users in Projects (#4128)
Enabling Role Based users in projects
Primate PR related to the FR: apache/cloudstack-primate#382
Doc PR: https://github.com/apache/cloudstack-documentation/pull/145

Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
2020-08-13 15:45:39 +05:30
Rohit Yadav
36ef85012f Merge remote-tracking branch 'origin/4.14'
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2020-07-29 14:08:02 +05:30
davidjumani
eec56025c8
api: Bug fixes for primate (#4214)
Adding the following fixes so primate can work without issues :
- Adding pagination for listNetworkAclLists
- Adding pagination for listRoles
- Returning mshost uuid rather than msid in list hosts response
- Allowing listVirtualMachinesMetrics to respect hostid
- Fixing return all details in template response
2020-07-29 12:26:39 +05:30
Rohit Yadav
5471802f86 Merge remote-tracking branch 'origin/4.14' 2020-06-24 08:24:29 +05:30
Rohit Yadav
615ab4ef2c Merge remote-tracking branch 'origin/4.13' into 4.14 2020-06-24 08:23:43 +05:30
Abhishek Kumar
8010718878
server: fix for wrong affinity group count (#4154)
Fixes wrong count in listAffinityGroup API.
API was returning the count of AffinityGroupJoinVO records. 

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2020-06-24 07:02:56 +05:30
Rohit Yadav
5f695c910d Merge remote-tracking branch 'origin/4.14' 2020-06-18 19:48:45 +05:30
Rohit Yadav
148fab4e43 Merge remote-tracking branch 'origin/4.13' into 4.14 2020-06-18 19:48:12 +05:30
davidjumani
06f3ff0b04
api: listVirtualMachinesMetrics should extend ListVMsCmd instead of ListVMsCmdByAdmin (#4145)
Fixes #4143

Co-authored-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2020-06-18 19:47:13 +05:30
Rohit Yadav
a2c92029f5 Merge remote-tracking branch 'origin/4.14' 2020-06-18 09:50:54 +05:30
Rohit Yadav
88c5e6e6df Merge remote-tracking branch 'origin/4.13' into 4.14 2020-06-18 09:50:20 +05:30
davidjumani
e9f59e2fd3
server: Adding showunique parameter to list templates and isos (#4140)
Adds a new parameter showunique to listTemplate and listIsos to return only unique templates / isos across all zones

Fixes #4041
2020-06-18 09:05:36 +05:30
Rakesh
1fe96cc426
server: Search VR using redundant state (#4075)
Allow VR's to be searched using its redundant state
Under Infrastructure -> Virtual Routers -> Search box
we can search using "MASTER", "BACKUP" and this will display
the VR's matching the state.

Co-authored-by: Rakesh Venkatesh <r.venkatesh@global.leaseweb.com>
2020-06-12 12:22:31 +05:30
Rakesh
f4f238e18e
server: Disable searching by instance name for customers (#4077)
Only admins should be able to search VM by instance name
Customers should not see or serach VM's using the instance name (i-)

Co-authored-by: Rakesh Venkatesh <r.venkatesh@global.leaseweb.com>
2020-06-11 17:22:23 +05:30
Daan Hoogland
b984184b7a Merge release branch 4.13 to master
* 4.13:
  Snapshot deletion issues (#3969)
  server: Cannot list affinity group if there are hosts dedicated… (#4025)
  server: Search zone-wide storage pool when allocation algothrim is firstfitleastconsumed (#4002)
2020-04-11 16:45:00 +02:00
Wei Zhou
e0b67a4c68
server: Cannot list affinity group if there are hosts dedicated… (#4025) 2020-04-10 09:10:51 +02:00
Rohit Yadav
db2e2136dd Merge remote-tracking branch 'origin/4.13' 2020-03-25 12:54:21 +05:30