172 Commits

Author SHA1 Message Date
Spaceman1984
005019b0e6 Endless settings on templates and instances (#3778)
* Endless settings on templates and instances

* Removed unintentionaly committed file

* Fix indentation

Co-authored-by: Anurag Awasthi <anurag.awasthi@shapeblue.com>
2020-01-08 14:48:23 +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
Anurag Awasthi
f9b3771489 Add usernames to map for remove operations as well 2019-08-01 14:17:47 +05:30
Anurag Awasthi
8190b68771 Misc fixes to sharing templates functionality
1. Fix populating g_allowUserViewAllDomainAccounts flag. This was
implemented incorrectly and caused flag's effect to not reflect
directly after login.
2. Filter account/project names only for add operation. update
template permissions API is implemented in such a way that it allows
removal of any account that could have had permissions but allows
only adding accounts/projects which are in caller's domain.
3. Added some checks where null variable could result in crash.
2019-07-31 15:19:21 +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
Spaceman1984
b509e086f9 api: Allowing template owner to download template (#3475)
Removed the download icon when a template is not extractable.

Modified the api to allow a user from the same account as the template, to change the extractable attribute on the template.

Fixes #3400
2019-07-09 12:42:41 +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
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
Abhishek Kumar
f7af27c3c8 ui: added missing hypervisor options for upload template (#3367)
Upload template form was missing some hypervisor specific options which can be seen on Register template form.
For XenServer, XenServer tool version added
For VMware, Root disk controller, NIC adapter type, Keyboard type added and HVM is hidden
For KVM, Root disk controller added

Fixes #3363

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2019-06-05 18:44:37 +05:30
Anurag Awasthi
3bf4e5c498 ui: configurable branding, keyboard list and hide-able columns through a new config.js file (#3258)
We want to support hiding table columns, specifically in metrics table, through config file so that users can make the relevant bits hidden as per their organization. Current work will support the metrics table but can be extended to any table with minimal work in future.

Config file will take the key of the metrics column from metrics.js file for the sake of minimal changes and simplicity of development.

Problem: The keyboard list in the UI is not consistent across views such as in the instance wizard and in the register template form. There is also no way to custom about url/text and doc title and help URL in the UI.
Root Cause: The list is hardcoded in the UI allowing no centralised configuration.
Solution: Introduce a new config.js file installed at the /usr/share/cloudstackmanagement/webapp/config.js location. The config.js allows configurable keyboard list, about url/text, doc title, and help URL.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2019-05-30 15:32:37 +05:30
Rohit Yadav
1af5dedfb1
ui: don't ignore project when listing templates (#3233)
Problem: When uploading template or iso in a project, the progress is not seen
Root Cause: When users upload a template/iso in project view, the template/iso is not visible in the all filter. This creates confusion that template/iso has not been uploaded.
Solution: Since the api listtemplates with a projectid acts is a superset of list templates without a project id, we should not ignore the project id when listing templates in all filter.
2019-04-09 16:40:38 +05:30
ernjvr
4f49bf6770 ui: hide hvm tickbox for vmware, otherwise display (#2781)
On the 'Register Template From URL' screen, when a user selects the VMware option from the Hypervisor dropdown:

It incorrectly displays the 'HVM' checkbox.
This checkbox must be hidden in the VMware context.
This checkbox must still be visible in any other hypervisor context.

To Reproduce:
Go to the 'Register Template From URL' screen by clicking the 'Templates' tab on the lefthand side.
On the 'Templates' screen click the 'Add' button to display the 'Register Template From URL' screen.
On the 'Register Template From URL' screen, select the VMware option from the Hypervisor dropdown:

Actual Behaviour:
It incorrectly displays the 'HVM' checkbox.

Expected behaviour:
This checkbox must be hidden in the VMware context.
This checkbox must still be visible in any other hypervisor context.
2018-08-01 16:36:11 +05:30
ernjvr
781d6bc051 register template kvm context ui fix (#2757)
On the 'Register Template From URL' screen, when a user selects the KVM option from the Hypervisor dropdown:
1) It incorrectly displays the 'Original XS Version is 6.1' checkbox. This checkbox should be hidden in the KVM context.
2) The 'Root Disk Controller' dropdown should display the default option of 'osdefault' instead of a blank default option.
2018-07-20 09:16:23 +02:00
Rohit Yadav
fa7c1e2e65
CLOUDSTACK-10227: Stabilization fixes for 4.11.0.0 (#2403)
This fixes regression failures seen in Trillian, fixes NPEs that cause Travis related failures.
This also removes the aria2 dependency from rpms that require users to enable/install epel-release.
This finally updates the checksums for 4.11 systemvmtemplates in db upgrade path.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-01-15 00:08:36 +05:30
Nicolas Vazquez
e86bb41e0e CLOUDSTACK-10146: Bypass Secondary Storage for KVM templates (#2379)
This feature allows using templates and ISOs avoiding secondary storage as intermediate cache on KVM. The virtual machine deployment process is enhanced to supported bypassed registered templates and ISOs, delegating the work of downloading them to primary storage to the KVM agent instead of the SSVM agent.

Template and ISO registration:
- When hypervisor is KVM, a checkbox is displayed with 'Direct Download' label.
- API methods registerTemplate and registerISO are both extended with this new parameter directdownload.
- On template or ISO registration, no download job is sent to SSVM agent, CloudStack would only persist an entry on template_store_ref indicating that template or ISO has been marked as 'Direct Download' (bypassing Secondary Storage). These entries are persisted as:
template_id = Template or ISO id on vm_template table
store_id NULL
download_state = BYPASSED
state = Ready
(Note: these entries allow users to deploy virtual machine from registered templates or ISOs)
- An URL validation command is sent to a random KVM host to check if template/ISO location can be reached. Metalink are also supported by this feature. In case of a metalink, it is fetched and URL check is performed on each of its URLs.
- Checksum should be provided as indicated on #2246: {ALGORITHM}CHKSUMHASH
- After template or ISO is registered, it would be displayed in the UI

Virtual machine deployment:
When a 'Direct Download' template is selected for deployment, CloudStack would delegate template downloading to destination storage pool via destination host by a new pluggable download manager.
Download manager would handle template downloading depending on URL protocol. In case of HTTP, request headers can be set by the user via vm_template_details. Those details should be persisted as:
Key: HTTP_HEADER
Value: HEADERNAME:HEADERVALUE

In case of HTTPS, a new API method is added uploadTemplateDirectDownloadCertificate to allow user importing a client certificate into all KVM hosts' keystore before deployment.
After template or ISO is downloaded to primary storage, usual entry would be persisted on template_spool_ref indicating the mapping between template/ISO and storage pool.
2018-01-09 12:22:18 +05:30
Mowgli
25b63f5e73 CLOUDSTACK-9607: Preventing template deletion when template is in use (#1773)
Consider this scenario:
1. User launches a VM from Template and keep it running
2. Admin logins and deleted that template [CloudPlatform does not check existing / running VM etc. while the deletion is done]
3. User resets the VM
4. CloudPlatform fails to star the VM as it cannot find the corresponding template.

It throws error as 
java.lang.RuntimeException: Job failed due to exception Resource [Host:11] is unreachable: Host 11: Unable to start instance due to can't find ready template: 209 for data center 1
at com.cloud.vm.VmWorkJobDispatcher.runJob(VmWorkJobDispatcher.java:113)
at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:495)

Client is requesting better handing of this scenario. We need to check existing / running VM's when the template is deleted and warn admin about the possible issue that may occur.

REPRO STEPS
==================
1. Launches a VM from Template and keep it running
2. Now delete that template 
3. Reset the VM
4. CloudPlatform fails to star the VM as it cannot find the corresponding template.

EXPECTED BEHAVIOR
==================
Cloud platform should throw some warning message while the template is deleted if that template is being used by existing / running VM's

ACTUAL BEHAVIOR
==================
Cloud platform does not throw as waring etc.
2018-01-04 10:59:39 +05:30
Rohit Yadav
0102e8593d CLOUDSTACK-10129: UX improvements and event timeline
- Fixes timezone issue where dates show up as nvalid in UI
- Introduces new event timeline listing/filtering of events
- Several UI improvements to add columns in list views
- Bulk operations support in instance list view to shutdown and destroy
  multiple-selected VMs (limitation: after operation, redundant entries
  may show up in the list view, refreshing VM list view fixes that)
- Align table thead/tbody to avoid splitting of tables

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-12-23 09:22:44 +05:30
Rajani Karuturi
44f38eae6a Merge pull request #1756 from yvsubhash/CLOUDSTACK-9585
CLOUDSTACK-9585 UI doesn't give an option to select the xentools version
2017-06-06 16:14:29 +05:30
subhash yedugundla
553eadcd7a CLOUDSTACK-9585 UI doesn't give an option to select the xentools version 2017-06-05 17:16:24 +05:30
rashmidixit
49a862b223 CLOUDSTACK-9700: Allow user to Register/Copy templates to multiple zones at the same time 2017-05-15 14:07:22 +05:30
Nathan Johnson
5c476492b1 CLOUDSTACK-8239 - Adding support for virtio-scsi on KVM hosts
This adds support for virtio-scsi on KVM hosts, either
for guests that are associated with a new os_type of 'Other PV Virtio-SCSI (64-bit)',
or when a VM or template is regstered with a detail parameter rootDiskController=scsi.

Update cloudstack add template dialog to allow for selecting rootDiskController with KVM

Update cloudstack kvm virtio-scsi to enable discard=unmap
2017-03-12 10:54:43 -05:00
Rajani Karuturi
238046fdaa Merge pull request #1834 from Accelerite/CLOUDSTACK-9679
CLOUDSTACK-9679:Allow master user to manage subordinate user uploaded template

* pr/1834:
  CLOUDSTACK-9679:Allow master user to manage subordinate user uploaded template

Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
2017-02-16 15:43:41 +05:30
Rajani Karuturi
60fd7292da Merge release branch 4.9 to master
* 4.9:
  CLOUDSTACK-9655 The template which is registered in all zones will be deleted by deleting 1 template on any zone
2017-02-16 10:39:12 +05:30
Rajani Karuturi
4f124b2775 CLOUDSTACK-9655 The template which is registered in all zones will be
deleted by deleting 1 template on any zone

added extra warning message if it's a cross-zone template ("This is a
cross zone template and will be deleted from all the zones. Are you sure
you want to proceed?").
2017-02-13 16:42:08 +05:30
nvazquez
e8049af153 CLOUDSTACK-9457: Allow retrieval and modification of VM and template details via API and UI 2016-12-27 23:33:50 -03:00
pdumbre
87849c3964 CLOUDSTACK-9679:Allow master user to manage subordinate user uploaded template 2016-12-16 19:00:26 +05:30
Will Stevens
5a79c2b6f5 Merge pull request #1477 from remibergsma/47_default_zone_name_s3
When no zone name is available display a defaultWhen a zone name is available, the previous behaviour is still there:
![screen shot 2016-03-30 at 21 00 44](https://cloud.githubusercontent.com/assets/1630096/14154026/ba41a4bc-f6ba-11e5-9f88-19cf36bfbd4f.png)

When there is no zone name, it used to display an empty name (where you had to click on to see details):
![screen shot 2016-03-30 at 21 03 06](https://cloud.githubusercontent.com/assets/1630096/14154048/d31a7b08-f6ba-11e5-9f67-f716e8d9fbf2.png)

With this change, a default name `All` is displayed (because this happens when S3 storage is used that is region wide aka all zones):
![screen shot 2016-03-30 at 20 53 50](https://cloud.githubusercontent.com/assets/1630096/14154060/e20d1d0a-f6ba-11e5-9b0a-1b5e502a2964.png)

Region wide S3:
![screen shot 2016-03-30 at 21 04 55](https://cloud.githubusercontent.com/assets/1630096/14154108/2222ff54-f6bb-11e5-845a-c22ddc745b98.png)

FYI: Screenshot shows 'All', later renamed to 'All Zones', see code.

* pr/1477:
  When no zone name is available display a default

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-11 01:30:44 -04:00
Patrick Dube
cfd2ce71ed CLOUDSTACK-9172 Added cross zones check to delete template and iso 2016-04-20 16:16:32 -04:00
Remi Bergsma
aead9f4ff4 When no zone name is available display a default
Backport from Cosmic
2016-04-07 21:57:17 +02:00
Rohit Yadav
a15187a57a CLOUDSTACK-4787: Allow users to select disk controller for VM/template
- Adds new controller types in the UI, for selecting root disk controller while
  registering templates
- Fixes bug to not override disk controller type if provided in the details (either
  vm details or from template details)

(cherry picked from commit c7d67628b3ff86802a1ac3b58e0bc05d54afd543)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-11-27 18:52:02 +05:30
Rohit Yadav
a6e8cfde3f CLOUDSTACK-8766: Fix infinite scrolling pagination for zonal iso/template listing
Due to aggregation of templates and isos on the UI/client side, it could result
that for each page we could end up having lesser templates/isos listed to have
the scroll shown that triggers infinite scrolling. In theory, there
is still a chance if there are several zones with the same template being listed
resulting in only one aggregated template which could cause the scroll to not
get shown; but in practice I believe this fix should work for most users.

Page size set based on experimental data:
https://github.com/apache/cloudstack/pull/751#issuecomment-135661968

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-28 13:07:47 +05:30
Rohit Yadav
462bb0654d CLOUDSTACK-8766: Fix infinite scrolling pagination for zonal template listing
Uses listViewDataProvider to implement pagination for listing templates and ISOs
in the zones tab. Dedupes isos and templates in the list views.

This closes #740

(cherry picked from commit 26700fbe766e06c3b953ee9ebae3f51ff1a08968)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-26 12:46:47 +05:30
Milamber
4be622e4ff Add missing localization for some labels in Web UI
- on new functionnality: upload volume/template from Local
- on the zone configuration wizard for the "Next" button
- update French messages properties from transifex
- Improve some French translations ("Téléverser" for "Upload")
2015-08-12 17:30:15 +01:00
Kevin Dierkx
3acdd916b0 Removed large chunks of commented code 2015-08-07 14:55:59 +02:00
Kevin Dierkx
471a02d6a4 Removed leading tabs from ui/scripts/*.js 2015-08-07 11:58:13 +02:00
Kevin Dierkx
2bdbaf453e Removed trailing whitespace from ui/scripts/*.js 2015-08-07 11:25:15 +02:00
Erik Weber
5e96d13944 CLOUDSTACK-8455: Use the correct label to display extractable checkbox
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #471
2015-06-17 13:14:54 +02:00
Rajani Karuturi
8571314406 Fixed blocker issues reported by sonarqube in js files
All of them are trailing comma in array or object

more details @
https://analysis.apache.org/component_issues?id=org.apache.cloudstack%3Acloudstack#resolved=false|severities=BLOCKER|languages=js
2015-05-20 17:19:20 +05:30
ramamurtis
5646a07513 CLOUDSTACK-8427: Some messages are hard-coded in javascript after Volume upload branch merge(0b835592)
Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>

This closes #208
2015-04-29 15:00:11 +05:30
Rajani Karuturi
0b8355920e Merge branch 'volume-upload' into master
This closes #206
2015-04-29 11:12:53 +05:30
Rajani Karuturi
5c152e5f3a volume upload: disabled all zones during template upload 2015-04-13 14:43:12 +05:30
ramamurtis
da1d8f9dce volume upload: fixed the UI after the change to move params to header.
Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2015-02-27 17:40:06 +05:30
Jessica Wang
48a66ace6c volume-upload: templates > (1) Shorten action label to make all items in header to fit into one line, otherwise search box will be pushed out of place. (2) Register Template dialog: move URL field to the top. 2015-01-22 13:23:08 -08:00
Jessica Wang
9acfb2eec1 volume-upload: UI > upload template from local > after uploading file to postURL, pop up a message indicating where to check the template's newest status. 2015-01-21 14:51:53 -08:00
Jessica Wang
573a4b1e43 volume-upload: tempalates > upload template from local > format dropdown > include OVA, VMDK, BareMetal, TAR, VHDX option. 2015-01-21 13:44:22 -08:00
Jessica Wang
4e569f85eb volume-upload: UI > upload template from local > fix a bug that fields below OS Type field (isPublic, isFeatured, ~ ) are not created. 2015-01-20 16:58:04 -08:00
Jessica Wang
68789b76d3 volume-upload: tempalates > upload template from local > format dropdown > show different options upon selected hypervisor. 2015-01-20 14:36:06 -08:00
Jessica Wang
7a3c2304a0 volume-upload: UI > templates > upload template from local > pass ispublic, requireshvm, isfeatured, isrouting parameter to getUploadParamsForTemplate API if corresponding fields are not hidden. 2015-01-20 14:00:23 -08:00
Jessica Wang
f0b60c742b volume-upload: UI > templates > add new action "Upload Template from Local". 2015-01-19 17:31:32 -08:00
Jessica Wang
cef4447fd4 (1) Remove UploadFile button from Register Template dialog. (2) sync latest templates.js from master branch. 2015-01-19 16:13:57 -08:00