3870 Commits

Author SHA1 Message Date
Rakesh
482e7ebf9a New feature: Acquire specific public IP for network (#3775)
Currently in cloudstack, when we click on "Acquire New Ip", it will
randomly acquire IP from the pool. With this enhancement, it is
possible to select the IP from the drop down IP list of that network.
Same thing applies for a VPC as well.
2019-12-24 10:08:53 +01:00
dahn
482d0fd85e
4.13 (#3782)
* create template from snapshot regression (partly reverted) (#3767)

* Once again allow a VM to be on multiple networks from VPCs (#3754)

to once again allow a VM to be on multiple networks from VPCs

* convert protocal names to be found as labels (#3747)

* convert protocal names to be found as labels

* format

* filter hosts to query on zone wide storage (#3733)

* config: add isdynamic flag in configuration response (#3729)

Co-authored-by: Wei Zhou <ustcweizhou@gmail.com>
2019-12-20 16:43:09 +01:00
Wei Zhou
2712decf50 config: add isdynamic flag in configuration response (#3729) 2019-12-20 15:17:21 +01:00
Anurag Awasthi
4b43c2684f Better tracking host maintanence and handling of migration jobs (#3425)
* Service layer changes for new way of tracking maintanence progress

* Fixes after offline code review

* Fix marvin tests

* Change state name and add documentation

* Fix test

* Fix and add more unit tests for different caseS

* Fix and enhance Marvin Tests

* Fixes for corner cases

* More fixes and logging

* UI fixes

* Some minor changes and reducing VMs on host for more contained tests

* Fixed ssh client auth problem causing test failure

* Code review changes + fixes + some more logging

* Fix flaky tests by adding delays between host states

* Added fetching only enabled hosts for tests

* Make port blocking KVM specific and refactor to handle failure

* Make failing migrations due to tagged host instead of port blocking

* Added additional check for migrating VMs

* Refactor to use single place for methods checking maintenance states
2019-12-19 16:36:20 +01:00
Dennis Konrad
2e8c069dd2 Load Average for KVM (#3738)
* Avgload (#2)

* Adding avgload for kvm

* Fix coding style issue

* Add getter/setter

* Fix several small errors

* Add override

* Uncomment getAverageLoad

* Override getAverageLoad()

* Checkstyle bug?

* Delete trailing spaces

* Renaming function

* Change interface to match

* Rename method in GetHostStatsAnswer

* Change method call name

* Convert double to long

* Remove trailing whitespace

* Change names around

* Make load visible to return it

* Parse string to double

* Change Long to Double

* Fix getter

* Unify naming to cpuloadaverage

* Change cpuloadaverage String to Double in listHostsMetrics
Remove some unnecessary whitespaces

* Add CPU_LOAD_AVERAGE to ApiConstants
2019-12-17 10:37:05 +01:00
Rohit Yadav
7f91964aa9
refactoring: Remove duplicate code (by Frank/Nuage) (#3538)
Refactor: Cleanup duplicate code

Make use of Java 8 default implementation in interfaces,
to remove code duplication between XxxCmd and XxxCmdAsAdmin.
Refactor checkFormat by pre-calculating the supported
extensions. Also make use of this in ImageStoreUtil.
Makes it easier to add new file and compression formats.
2019-09-25 10:21:35 +05:30
Paul Angus
50fc045f36 Updating pom.xml version numbers for release 4.14.0.0-SNAPSHOT
Signed-off-by: Paul Angus <paul.angus@shapeblue.com>
2019-09-07 09:57:46 +01:00
Paul Angus
61b8b77913 Updating pom.xml version numbers for release 4.13.1.0-SNAPSHOT
Signed-off-by: Paul Angus <paul.angus@shapeblue.com>
2019-09-01 13:36:50 +01:00
Paul Angus
8e08b47cc9 Updating pom.xml version numbers for release 4.13.0.0
Signed-off-by: Paul Angus <paul.angus@shapeblue.com>
2019-08-20 15:35:49 +01:00
Nicolas Vazquez
3c2af55d81 vmware: allow configuring appliances on the VM instance wizard when OVF properties are available (#3271)
Problem: In Vmware, appliances that have options that are required to be answered before deployments are configurable through vSphere vCenter user interface but it is not possible from the CloudStack user interface.

Root cause: CloudStack does not handle vApp configuration options during deployments if the appliance contains configurable options. These configurations are mandatory for VM deployment from the appliance on Vmware vSphere vCenter. As shown in the image below, Vmware detects there are mandatory configurations that the administrator must set before deploy the VM from the appliance (in red on the image below):

Solution:
On template registration, after it is downloaded to secondary storage, the OVF file is examined and OVF properties are extracted from the file when available.
OVF properties extracted from templates after being downloaded to secondary storage are stored on the new table 'template_ovf_properties'.
A new optional section is added to the VM deployment wizard in the UI:
If the selected template does not contain OVF properties, then the optional section is not displayed on the wizard.
If the selected template contains OVF properties, then the optional new section is displayed. Each OVF property is displayed and the user must complete every property before proceeding to the next section.
If any configuration property is empty, then a dialog is displayed indicating that there are empty properties which must be set before proceeding
image
The specific OVF properties set on deployment are stored on the 'user_vm_details' table with the prefix: 'ovfproperties-'.
The VM is configured with the vApp configuration section containing the values that the user provided on the wizard.
2019-08-09 16:14:46 +05:30
Rohit Yadav
263b404386 Revert "Refactoring to remove duplicate code. (#3152)"
This reverts commit 7a27e35a612f13a0ce43459b22e01d9b69627220.

We're near 4.13 RC1, we've low confidence if the changes from #3152
would cause other regressions so reverting this. The author may send a
PR again towards 4.14.

Regressions found are all related to template and iso registration and
upload.
2019-08-02 13:04:12 +05:30
Rohit Yadav
d3b292ace9
server: Fixes API permissions, global settings and template UX (#3534)
Fixes:

- This allows getUploadParamsForIso for all user role types, also fixes
authorised field for getUploadParamsForTemplate API.
- Fix global setting description to say what is used when value is empty/blank.
- For VM running/allocated usage description, use parenthesis to return the instance name and ID.
- Display template download progress when template is added to a project

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2019-08-01 13:30:34 +05:30
Frank Maximus
7a27e35a61 Refactoring to remove duplicate code. (#3152)
Make use of Java 8 default implementation in interfaces,
to remove code duplication between XxxCmd and XxxCmdAsAdmin.

Refactor checkFormat by pre-calculating the supported
extensions. Also make use of this in ImageStoreUtil.
Makes it easier to add new file and compression formats.
2019-07-27 20:21:43 +05:30
Nicolas Vazquez
2050a90ee8 vmware: Fix bad ovf null error when registering template (#3511)
Fix template registration regression.
2019-07-24 11:37:25 +05:30
Rohit Yadav
5d8157422d Allow users to share templates with Accounts or Projects through the UI
* Allow users to share templates with Accounts or Projects through the
updateTemplate permissions API

* Change behaviour to show only supported projects and accounts with update template permissions

* Allow admins to see accounts dropdown and only hide lists for users

* Don't allow sharing project owned templates as you cannot retrieve them in list api calls
2019-07-18 17:42:55 +01:00
Nicolas Vazquez
a1a9fb8977
KVM: Enhancements for direct download feature (#3374)
* Add revoke certificates API

* Add background task to sync certificates

* Fix marvin test and revoke certificate

* Fix certificate sent to hypervisor was missing headers

* Fix background task for uploading certificates to hosts
2019-07-18 02:39:00 -03:00
Paul Angus
e15c3112e4
Merge pull request #3248 from shapeblue/storage-offering-domains-zones
Enable service offerings to be scoped to domain(s) and zone(s)
2019-07-16 10:25:35 +01:00
Anurag Awasthi
9e6ee7c63e server: Add support for new heuristics based VM Deployement for admins (#3454)
Currently an admin can choose which host a VM is to be started on.
They should be able to 'override' the allocation algorthm to a greater
or lesser extent at will, and be able to choose the pod, cluster or host
that they wish a new VM to be deployed in.

DeployVirtualMachine API has been extended with additional, optional
parameters podid and clusterid that will be passed to and used in the
deployment planner, when selecting a viable host. If the user supplies
a pod, a suitable host in the given pod will be selected. If the user
supplies a cluster, a suitable host in the given cluster will be selected.

Based on the parameter supplied and on passing validation, the VM will
then be deployed on the selected host, cluster or pod.
2019-07-13 12:52:48 +05:30
Rohit Yadav
97df52956c
master: travis and trillian smoketests fixes and stabilisation (#3476)
Fix failing test, add more component tests, optimise and refactor test jobs.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2019-07-12 17:27:49 +05:30
Abhishek Kumar
b40fdbb2f7 api: fix account deletion event description (#3483)
Fix account deletion event description.
Fixes #3109

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2019-07-12 13:10:30 +05:30
Abhishek Kumar
7010f855b5 Merge branch 'master' into storage-offering-domains-zones 2019-07-12 10:21:51 +05:30
Anurag Awasthi
f1614aa7c2 api: allow copy tags from template/iso image to VM via deployVM API (#3297)
Support copy tags from template/iso image to VM from deploy vm command. Allow creation of tags from the source template/iso image to vm when deploy vm command creates virtual machine.

Fixes: #3048

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2019-07-05 17:08:25 +05:30
Wei Zhou
6780930ecc server: Add option 'details' to listProjects and listAccounts (#3331)
If there are many projects and accounts, listing projects/accounts will take long time getting the resource limitation and resource count in the process. However resource count/limitation are not needed sometimes.

Add an option 'details' to listProjects and listAccounts. If you do not need the resource count/limitation, please add details=min to api call. The api execution time will be reduced significantly.
2019-07-04 16:26:04 +05:30
Abhishek Kumar
18439ca84b server, api, ui: filtering network offerings for a domain while create network
Signed-off-by: Abhishek Kumar <abhishek.kumar@shapeblue.com>
2019-07-01 15:17:31 +05:30
Abhishek Kumar
fc8381549d Merge branch 'master' into storage-offering-domains-zones 2019-06-28 17:33:41 +05:30
Abhishek Kumar
58474530f6 api: snapshot, snapshotpolicy tag support (#3228)
Problem: Currently tags cannot be applied to snapshot when it is being created but through separate “create tags” API calls. For snapshot policies tags cannot be set either at creation or through “create tags” API.

Root Cause: The “create snapshots” API does not support adding tags during creation and it can only be done through “create tags” API. Snapshot policy as a resource does not support tags and no tags can be set for them through any API.

Solution: Tag support for snapshot policy has been added. Snapshot policy with tags when executed will produce snapshots containing the same tags from snapshot policy.

Following APIs have been updated:

Both “create snapshotpolicy” and “create snapshot” now accepts “tags” as a new parameter. The expected format for “tags” parameter is similar to parameter “tags” in “create tags“ API.
Deletion support for tags associated with snapshots policy has been added to “delete snapshotpolicies” API.
Tags set for snapshot policies are added to the Response of “list snapshotpolicies“ API.
UI support for setting tags to snapshots and snapshot policy is provided through the corresponding menus with a new section in each form to set tags.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2019-06-27 09:21:08 +05:30
Rohit Yadav
14bff7bd03
server: export granular volume bytes and iops metrics (#3259)
Problem: The VM metrics has aggregated volume bytes read/write and iops metrics but not on per volume basis.
Root Cause: The volume stats sub-system is not used to export the metrics, the support is not available for VMware.
Solution: Use the volume stats sub-system and DB table to export the metrics via the listVolumes and listVolumeMetrics API, and implement support for VMware and fix issue with network and disk metrics in the VM metrics view.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2019-06-27 09:18:10 +05:30
Rohit Yadav
9f4f2c5348
api: instance and template details are free text (#3240)
Problem: Users don't know what keys/values to enter for template and VM details.
Root Cause: The feature does not exist that can list possible details and options.
Solution: Based on the possible VM and template details handled by the
codebase, those details were refactored and a list API is introduced
that can return users those details along with possible values. When
users add details now, they will be presented with a list of key details
and their possible options if any.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2019-06-27 09:14:47 +05:30
Abhishek Kumar
12218e398d Merge branch 'master' into storage-offering-domains-zones
schema and server changes for VPC offering to honour changes from f653e61 in master
2019-06-26 13:27:00 +05:30
Anurag Awasthi
f653e6149c server: support sort_key for vpc_offerings table (#3268)
Fixes #2742

UI Supported ordering VPC Offerings but the API did not have that
support implemented. This makes the change in updateVPCOfferings
and listVPCOfferings API calls, along with necessary database
changes for supporting sorting of VPC Offerings.
2019-06-26 08:02:19 +05:30
Rohit Yadav
bc05bd1a0e
api: Fix API argument documentation to list supported protocols (#3423)
This fixes the API arg description to advise the user the possible
protocol options they can provide to the createLoadBalancerRule API.

Fixes #3090

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2019-06-26 07:51:41 +05:30
Abhishek Kumar
8cff58d3b8 Merge branch 'master' into storage-offering-domains-zones 2019-06-26 02:03:25 +05:30
Nicolas Vazquez
a75444a585
KVM: DPDK live migrations (#3365)
* DPDK live migrations

* Remove DPDK created ports if VM migration fails or prepare migration fails

* Rename DPDK classes lowercase
2019-06-25 12:23:09 -03:00
Abhishek Kumar
baf7e0a6c6 server, api: allowing domain(s), zone(s) overwrite while updating offerings
'domainid' and 'zoneid' param of update*Offering APIs has been made string type.
For associating multiple domains, zones to an offering, a comma-separated list of domains and zones can be passes.
To make a domain specific offering public, a value of 'public' can be given for domainid param.
To make a zone specific offering available for all zones, a value of 'all' can be given for zoneid param.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2019-06-23 20:04:01 +05:30
Rohit Yadav
2c32d60e44
server: return usage description with resource names and UUIDs (#3344)
The usage record descriptions have CloudStack's internal integer IDs
which makes it difficult for users to read their usages. This PRs
introduces a new API boolean flag `oldformat` which when set to true
would return the older description format, otherwise by default
listUsageRecords will process and return description with names and
UUIDs of resources.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2019-06-21 03:48:33 +05:30
Rohit Yadav
61ebc6a4a6
api: Set network name as part of the network usage response (#3234)
Problem: Network name is not part of the network usage response
Root Cause: Code does not set the network name
Solution: Set the network name for network usage type usage records in the API response

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2019-06-20 21:39:15 +05:30
Rohit Yadav
26a5d50760
Merge branch 'master' into storage-offering-domains-zones 2019-06-20 15:09:48 +05:30
Rohit Yadav
90cd8aa73d
server: add support for sorting zones in UI/API (#3242)
Problem: Not able to configure a sort order for the zones that are listed in various views in the UI.

Root Cause: There is no mechanism to accept sort key for existing zones or UI widget, that would allow to listing zones in the UI in a certain order.

Solution: The order of zones in listed in various views in the UI can now be configured through the newly added “sort_key” field added for the zone. It can be set using updateZone API by providing “sort_key” parameter for a zone, or by reordering the items in the zones list in the UI. UI has been updated to show ordering controls in zones list view. Database changes include updating table “data_center” by adding “sort_key” column (containing integer values and defaults to zero).

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2019-06-19 18:03:56 +05:30
Rohit Yadav
0e87040eb2
network: allow ability to specify if network's ipaddress usage need to be hidden (#3235)
Problem: Admins don’t want to charge for IP address usage on certain (shared) networks.
Root Cause: There is no flag or detail for admins to provide using UI or API when creating networks to specify if they want IP address usage of the network hidden.
Solution: A new boolean hideipaddressusage flag is added to the createNetwork API and a checkbox in the ‘Add guest network’ UI for the root admins to specify if they want the shared network’s IP address usage to be hidden in the listUsageRecords API response. The provided flag is saved as the ‘hideIpAddressUsage’ detail in the cloud.network_details table for the network. For existing (shared) networks, root admins can also specify the same boolean API parameter hideipaddressusage with the updateNetwork API request to configure the behaviour for an existing network. When the detail/flag is true, the IP address usage for the (shared) network is not exported in the listUsageRecords API response. The listNetworks API response will include the details of a network for root admin only. (note usage is still recorded in the usage database but not return by the listUsageRecords API)

The API flag works for any kind of network via the API, but the checkbox is only shown while creating shared networks in the UI.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2019-06-19 10:25:59 +05:30
Abhishek Kumar
cf347c89ea Merge branch 'master' into storage-offering-domains-zones 2019-06-18 12:52:34 +05:30
Anurag Awasthi
1c963bac13 ui: Add more info for creating volume snapshots (#3390)
Add more details in console logs and event details.
Also show popup on successful completition of snapshots.

Fixes: #3327
2019-06-13 15:50:10 +05:30
Nicolas Vazquez
0fbf5006b8 kvm: live storage migration intra cluster from NFS source and destination (#2983)
Feature Specification: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=95653548

Live storage migration on KVM under these conditions:

From source and destination hosts within the same cluster
From NFS primary storage to NFS cluster-wide primary storage
Source NFS and destination NFS storage mounted on hosts
In order to enable this functionality, database should be updated in order to enable live storage capacibilty for KVM, if previous conditions are met. This is due to existing conflicts between qemu and libvirt versions. This has been tested on CentOS 6 hosts.

Additional notes:

To use this feature set the storage_motion_supported=1 in the hypervisor_capability table for KVM. This is done by default as the feature may not work in some environments, read below.
This feature of online storage+VM migration for KVM will only work with CentOS6 and possible Ubuntu as KVM hosts but not with CentOS7 due to:
https://bugs.centos.org/view.php?id=14026
https://bugzilla.redhat.com/show_bug.cgi?id=1219541
On CentOS7 the error we see is: " error: unable to execute QEMU command 'migrate': this feature or command is not currently supported" (reference https://ask.openstack.org/en/question/94186/live-migration-unable-to-execute-qemu-command-migrate/). Reading through various lists looks like the migrate feature with qemu may be available with paid versions of RHEL-EV but not centos7 however this works with CentOS6.
Fix for CentOS 7:

Create repo file on /etc/yum.repos.d/:
[qemu-kvm-rhev]
name=oVirt rebuilds of qemu-kvm-rhev
baseurl=http://resources.ovirt.org/pub/ovirt-3.5/rpm/el7Server/
mirrorlist=http://resources.ovirt.org/pub/yum-repo/mirrorlist-ovirt-3.5-el7Server
enabled=1
skip_if_unavailable=1
gpgcheck=0
yum install qemu-kvm-common-ev-2.3.0-29.1.el7.x86_64 qemu-kvm-ev-2.3.0-29.1.el7.x86_64 qemu-img-ev-2.3.0-29.1.el7.x86_64
Reboot host

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2019-06-10 15:35:26 +05:30
Rohit Yadav
45be4a0b3c Merge remote-tracking branch 'origin/4.12' 2019-06-07 09:36:44 +05:30
Rohit Yadav
73fd62a89d Merge remote-tracking branch 'origin/4.11' into 4.12 2019-06-07 09:35:56 +05:30
Nicolas Vazquez
d108f322e3
KVM: Prevent regenerating keystore on provisionCertificate API (#3075)
* Prevent regenerating keystore and add background task to upload certificates

* Remove background task to upload certificates

* keystore-setup: delete old key in jks

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* also don't allow ca-cert alias

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2019-06-05 17:29:31 -03:00
Nicolas Vazquez
7247c5e97e server: add local ISO upload via UI (#3251)
Problem: Users can register ISOs from URL but cannot upload local ISOs.

Root cause: CloudStack provides browser-based upload support for volumes and templates, but ISOs are not supported.

Solution:
The existing browser-based upload from local functionality for templates and volumes (https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=39620237) is extended to support uploading local ISOs.

Extend the UI: A new button is created under the ISOs view: 'Upload from Local'. A new dialog form is displayed in which the user must select the ISO to upload from its local file system.
Extend the API: New 'GetUploadParamsForIso' API command is created to handle the ISO upload.
2019-06-05 23:10:51 +05:30
nvazquez
50869fec92 Merge branch '4.12' 2019-06-04 09:49:39 -03:00
nvazquez
bea627a52e Merge branch '4.11' into 4.12 2019-06-04 09:06:09 -03:00
Nicolas Vazquez
12c850ed2f
KVM: Improvements on upload direct download certificates (#2995)
* Improvements on upload direct download certificates

* Move upload direct download certificate logic to KVM plugin

* Extend unit test certificate expiration days

* Add marvin tests and command to revoke certificates

* Review comments

* Do not include revoke certificates API
2019-06-04 03:08:31 -03:00
Rohit Yadav
1c5244a0c5 Merge remote-tracking branch 'origin/4.12' 2019-06-03 17:17:51 +05:30