Commit Graph

52 Commits

Author SHA1 Message Date
Andrey Kurilin c8ee8c1965 Fix applying OPENSTACK_SERVER_DEFAULT_USER_DATA value
The final revision of I86ac21bf82c1667135abd4f20fb4514da0899450 is buggy
and doesn't work.
This commit fixes it and adds a proper test.

Also, this commit updates the docs with a proper horizon version that
corresponds to Zed release (the feature was introduced before final Zed
cut so the author tried to guess the final release number).

Change-Id: Id921b69df13af3cc209236f0446d82dd30e4d8a2
2023-01-26 14:42:15 +01:00
Victor Coutellier 01afd1ba70 Handle empty image_type in launch-instance workflow
Fix the getImageType function to handle edge case
when image_type attribute is present but is an
empty string.

Closes-Bug: 1993579
Change-Id: Ie08cf1010d64ff927515b4792e9b052a76b6344d
2022-10-20 10:33:28 +02:00
Andrey Kurilin 3a2e82ab75 Extend settings with OPENSTACK_SERVER_DEFAULT_USER_DATA
The new setting should allow an administrator to specify default user_data
for new VMs. The default user_data can be a string template that accepts
request object which has info about the user, so the default user_data can
be personalized.

Change-Id: I86ac21bf82c1667135abd4f20fb4514da0899450
2022-09-01 19:23:00 +03:00
Tatiana Ovchinnikova f044c4b0a3 Migrate to AngularJS v1.8.2
This patch aligns current code with AngularJS v1.8.2 requirements.

Change-Id: Ifdad18e805953957bfaa1b42908dfbbe8976dbcb
2022-06-08 15:43:13 -05:00
Brian Rosmaita b58ac2894b Drop cinder v2 API support
Cinder v2 API is deprecated since pike release. Along with the removal
of cinder v2 API support in cinderclient (change I335db5c1799e drops
v2 support), this commit drops cinder v2 support in horizon.

The next release of python-cinderclient drops v2 support,
so horizon needs to use v3 classes.

Includes a workaround in unit tests for two cinderclient.v3 classes
that are missing in the cinderclient releases prior to 8.0.0.  The
workaround can be removed once cinderclient change I335db5c1799edb2
is merged and released.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Iab0f097fab6696462572dc6ea53767c91e5411b1
2021-07-19 08:00:58 -04:00
David Hill fc8603a499 Add default_availability_zone for VM creation
Add the LAUNCH_INSTANCE_DEFAULTS.default_availability_zone settings in
VM creation dashboard in order to let administrator select a default
availability zone instead of a random one when many are available.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I297ff7f3c8e725c24c7f7687786c784f61f5d4e2
2021-03-13 19:28:16 +00:00
Akihiro Motoki c9bb0e95ea Fix community image handling in launch instance form
Community images which are not owned by a focused project are not
included in the normal image list API (i.e., without specifying
"community" as visibility), so we need an extra call of the image
list API specifying "community" visibility in a filter.

It was originally fixed by [1] but was dropped in [2].
The main motivation of [2] is to address "Duplicates in a repeater
are not allowed" error in the JavaScript console.

The approach of [2] was to drop multiple glance API calls, but
the right solution would be to check duplicated images included
in both API calls. This situation with duplicated images happens
when a community image is owned by a focused project. In such case,
the community image is included in the responses of both API calls.

This commit adds a logic to check image IDs already processed.

[1] https://review.opendev.org/c/openstack/horizon/+/614688
[2] https://review.opendev.org/c/openstack/horizon/+/640762

Closes-Bug: #1914045
Related-Bug: #1779250
Related-Bug: #1818508

Change-Id: I2ed1b6064ddd6f62818d6112e98e5d5a98beae9d
2021-02-26 10:36:30 +09:00
Tatiana Ovchinnikova c2d3f61d4d Set Admin Password at NG Launch Instance dialog
This patch allows to set admin password at Angular Launch Instance
dialog when 'can_set_password' is true in OPENSTACK_HYPERVISOR_FEATURES.

Closes-Bug: #1439905
Closes-Bug: #1609777

Change-Id: I3307521df524da30b910f0001165cefa2be6c8bb
2021-01-22 10:45:34 -06:00
Tatiana Ovchinnikova b532943a31 Update devDependencies in package.json
This patch updates outdated JavaScript dev dependencies.

The latest Jasmine version makes nested beforeEach and unhandled
promise rejection fail, this was fixed.

Also, the latest Jasmine version runs tests in random order by default,
random is set to false for now to prevent tests failures.

Finally, the latest Jasmine version supports a new configuration option
failSpecWithNoExpectations. By default, this option is set to false and
Jasmine reports specs that have no expectations as passed. Setting this
option to true tells Jasmine to report specs without as expectations as
failed. For now, it is set to false for openstack-dashboard tests, this
should be changed in future.

Change-Id: I04d5c3ce7f7e0a9a38251e975b68bfa1998e556f
2020-12-17 12:21:31 -06:00
Zuul 6b702f4a1c Merge "Drop the usage of nova extensions in JavaScript code" 2020-11-18 13:33:11 +00:00
pengyuesheng a8158f6c31 On the create instance from, when the image name is empty, show id
Change-Id: I4ac734e0fb4ac3151ff56fa2c53d3071cdb9131d
Closes-Bug: #1853551
2020-11-03 15:37:24 -06:00
Akihiro Motoki 3c6286a9e9 Drop the usage of nova extensions in JavaScript code
Part of the removal of OPENSTACK_NOVA_EXTENSIONS_BLACKLIST (2/3)

References to nova extensions are cleaned up.
The logic to fetch nova extension list is finally dropped.

Change-Id: If4876634276eff37ab0a18a49e6e97851d41911b
2020-10-27 20:00:45 +09:00
Tatiana Ovchinnikova 91298f9b5f Make getPorts and setBreadcrumb tests work
This patch adds expectations to the tests and make them work.

Partial-Bug: #1894127

Change-Id: Ic22033343c344a42148b0ec5a31bccb1e08478c6
2020-09-11 12:58:39 -05:00
Ivan Kolodyazhny 3e7bc83c4b Allow to set default instance boot source
This introduces a new config option `DEFAULT_BOOT_SOURCE` to allow
operators to configure a default instance boot source.

Change-Id: Ia9b0d1d24ae69958b6606b9a645bd54f70b3aacc
Implements: blueprint default-instance-boot-source
2020-02-18 11:46:39 +02:00
Akihiro Motoki 5ab15c49da Do not specify device_name when creating server with BFV
When creating a server using an existing volume or volume snapshot,
horizon specified a device_name 'vda'.
However the device name depends on bus type or something and
this causes incorrect volume information in the instance detail page
(and nova volume-attachments CLI output).
For detail background, see bug 1560965.

block_device_mapping v1 required device_name but it is no longer
required to specify device_name 'vda' in block_device_mapping v2
in Nova create-server API.

This commit changes to use block_device_mapping v2 so that
we can avoid specifying device_name.

Change-Id: Ice1a6bb2dcddab0a89c99f345d1f2cd101955b28
Partial-Bug: #1560965
2019-03-28 18:18:15 +09:00
Eric Desrochers 4788c4d2f5 Not implicitly set vol_device_name to vda
Using a scsi decorated image with:
hw_disk_bus='scsi'
hw_scsi_model='virtio-scsi'

This solve the case where an instance is
launched with 'image' selected as boot
source with a new volume. This will result
in /dev/vda instead of /dev/sda as it
should.

Not specifying device name in
setFinalSpecBootImageToVolume() leaves the
decision to nova to determine it.

Example:
-------
VM boot volume without scsi meta data decoration:
Attached To
0a0cd660-7ce3-4033-9983-2e1099edc5f0 on /dev/vda

VM boot volume with scsi meta data decoration:
Attached To
91f50dbc-8bdf-4293-84ea-fc5df27b5ee4 on /dev/sda
--------

Note: This commit doesn't address cases for
where instances are launched using existing
volume and snapshot, this will involve more
work to migrate the code from BDMv1 to BDMv2.

Closes-Bug #1560965

Change-Id: I9d114c2c2e6736a8f1a8092afa568f930b656f09
2019-03-27 21:28:44 -04:00
mareklycka ff5f74d5d0 Fixes double loading in Image source loading
This patch removes a redundant image API call, which caused
images to be loaded twice in the UI. Image filtering for
snapshot/'normal' images has been merged into a single iteration
for the sake of optimization.

Additionally, tests have been changed to more comprehensively
check which data is loaded into which data structures during
model population. Code redundancy has also been removed in
tests.

Change-Id: Ie78900dae54ff63d41b7ddca3fa83f627d4260c4
Closes-Bug: #1818508
2019-03-06 20:54:08 +09:00
Andy Botting d641e6d105 Better support for community images
This commit updates several places where image information is processed
and extends support for the 'community' image visibility value.

Some support did exist already, which was mostly just the main Images
tab of the dashboard, but this commit also includes support for:
  - image name in the instances list/details
  - 'Community' visibility label in the Images tab
  - Listing of community images in launch instance wizard

Closes-Bug: #1779250

Change-Id: Iedea0b7d20313837a72a2759511251a7bb324869
2018-12-27 09:04:53 +09:00
wangliangyu 5f4057f8b5 Show snapshots list correctly when launching instance
In launch instance modal, when a user selects 'Instance Snapshots',
not all snapshots are listed. The snapshots which are created from
an instance with new volume or an instance created from volume
or volume snapshot don't have 'image_type' but 'block_device_mapping'.
So, judging only by image_type is not enough.

Change-Id: I7e175b6a7260ca3d82560427a8f742f8cfa35565
Closes-Bug: #1627619
2018-11-06 22:06:52 +00:00
Tobias Urdin 132243183a Add hide_create_volume to LAUNCH_INSTANCE_DEFAULTS
This adds a new option named hide_create_volume to the
LAUNCH_INSTANCE_DEFAULTS dict.

With this option you can select if you want to hide
the "Create New Volume" option to your users and have
it rely on the default value that is provide with the
create_volume option.

This is currently the only way to make sure the end-users
utilizing the web interface is forced to spawn a volume-backed
instance until Nova supports Cinder as a images backend.

Change-Id: I3a78593ada0d39cc7f1e30fb0a6300887b7b1a00
2018-09-29 00:48:12 +02:00
wangliangyu fd67e0f664 Only display the bootable volume snapshots when creating instance
The volume snapshot of non-bootable volume could not be as the instance source.
But now,when we select volume snapshot as source, not only bootable volume
snapshots but also non-bootable ones show up.

Change-Id: I36cd02f34029eedb693047a1bf3f01dad05aa1b3
Closes-Bug: #1748724
2018-03-30 10:47:05 +08:00
liyingjun 2161b91264 [Micro version] Support description for instance
In Nova Compute API microversion 2.19, you can specify a “description”
attribute when creating, rebuilding, or updating a server instance. This
description can be retrieved by getting server details, or list details
for servers, this patch adds support for this attribute for instance in
horizon.

Change-Id: Ic9217234021d236aee8295915f1a9c3c544396b0
Implement-blueprint: support-description-for-instance
2017-10-26 22:36:00 +08:00
Ferenc Cserepkei 748d9860bb TrunkPort, Horizon workflow: launch instance
Ethernet trunks (network interfaces having a vlan tag) cannot be used
as a boot interface. This is a DHCP/PXE limitation. So instead the
interface without the vlan tag can be used. In neutron's nomenclature
they are the trunk parents. It is also an OpenStack limitation. Subports
should not be passed to 'openstack server create --nic ...'. But if you
do, there's no clear error message about it. Please see Armando's
analysis here why:
https://bugs.launchpad.net/neutron/+bug/1636485/comments/9

The server part of this patch signals port kind (i.e. plain, trunkparent,
trunksubport) so the launch widget can easily filter out trunksubports,
what are not suitable for boot interface.

Change-Id: Ie3a6710eeffefcb472c569898d0f1f1554e599f7
Partially-Implements: blueprint neutron-trunk-ui
Signed-off-by: Ferenc Cserepkei <ferenc.cserepkei@ericsson.com>
2017-08-31 21:33:56 +00:00
Pascal Boutin f93c546c14 Prevent getServerGroups if the policy disallows it
The old implementation did not wait for the
promise to resolve before doing the call, thus
ignoring the policy.

Change-Id: I2a7a55ddf287e660371dd6b268953a75afa2a380
Closes-Bug: #1702925
2017-07-07 19:09:04 -04:00
Jenkins cbb85753fb Merge "Add charts to show volume quotas on Angular launch instance modal" 2017-06-20 12:04:53 +00:00
Ying Zuo 336d0a0525 Add charts to show volume quotas on Angular launch instance modal
Added two charts for Number of Volumes and Total Volume Storage quotas
on Angular launch instance modal when cinder is enabled.

The charts reflect the volume usage of the new instances to be created
as the user changes the configuration on the modal.

Updated the chart styling for the charts to align better.

Change-Id: Ie744ada2317624153fcfdf9abdf4d7b26996a35e
Partially-implements: blueprint launch-instance-volume-quotas
2017-06-11 21:38:35 -07:00
Mohammed Naser d734f482ec Add config for default create volume option
This patch adds the ability to configure the default "create volume"
value when launching an instance with Cinder enabled.

Co-Authored-By: Rob Cresswell <robert.cresswell@outlook.com>

Closes-Bug: 1678109
Change-Id: I272f7f1b20cc1276976c464a82d1776de92d17e7
2017-06-06 15:38:45 +02:00
Jenkins 5f9e22f15b Merge "Change checking cinder v1 to check v2 in panels" 2017-03-27 22:04:38 +00:00
Lucas H. Xu 5ced2f87ef Change checking cinder v1 to check v2 in panels
In general, in the case where there is no cinder v1 endpoint created
(or deleted - use openstack service delete cinder to reproduce) certain
volume related menu entries are not displayed

This patch add a a new function to check cinder v2/v3 endpoints instead
of only checking the v1 endpoint in instance launch model.

Also, in the image panel, instead of checking v1 endpoint,
it should check v2 and v3 as well.

Change-Id: I642b2f62bb9502f958593c9fcad76e21ee1c80ad
Closes-Bug: #1670789
2017-03-27 16:29:14 -04:00
Rob Cresswell a8f17150bf Remove all remaining vendor specific code
There's some vendor specific code still lingering from several cycles
ago. This patch removes all usage of it, all related tests, and all
default settings.

Implements: blueprint horizon-vendor-split
Change-Id: Ic0bb84f547b07b130480e587bd365f6e7805dfb5
2017-03-22 20:23:12 +00:00
Jenkins f54339f316 Merge "Let Nova to pick availability zone if more than 1" 2016-12-08 23:08:06 +00:00
Akihiro Motoki 18c90b4887 Launch Instance: Creating new volume for image snapshot
"Create new volume" option is supported when image snapshot
is chosen as a boot source in Nova API. It is worth supporting
this option in Horizon.

Change-Id: I4f7fc6f850d9830557fca833ee9abea1f5b9f0bf
Closes-Bug: #1627416
Co-Authored-By: Kenji-i<ken-ishii@sx.jp.nec.com>
2016-11-02 08:44:56 +00:00
Sean Mooney 723e547e84 Fix Launch Instance without Cinder
A previous patch altered the defaults in the angular Launch Instance,
but didn't account for those running without Cinder. This patch fixes
those assumptions.

Co-Authored-By: Rob Cresswell <robert.cresswell@outlook.com>
Change-Id: I8dc54fa40fa7eb8ae95a13741405f2a80337b33d
Closes-Bug: 1585761
2016-09-23 13:07:37 +00:00
Matt Borland be6bcef452 Let Nova to pick availability zone if more than 1
In the Angular Launch Instance, if there is more than one availability zone,
default to the option for the Nova scheduler to pick.  This is a regression
from the legacy Launch Instance feature.

If you want to simulate testing the logic with multiple avaiability zones,
go to:  .../launch-instance/launch-instance-model.service.js line 785 and add:

model.availabilityZones.push({label: 'another one', value: 'another one'});

Change-Id: Ib81447382bc9d43e33ce97f78c085d2a94ff2018
Closes-Bug: 1613900
2016-08-29 10:03:37 -06:00
Itxaka 4a9f988813 Angular: Configuration of boot sources for launch instance
Adds new configs to LAUNCH_INSTANCE_DEFAULTS to configure
which sources are available when launching an instance.
Provides an info message  if no boot sources are enabled.
Prevents doing extra calls if a boot source is disabled.
Adds tests to check for the proper filling of allowedBootSources.
Removes one test as the object being checked no longer exists.

Co-Authored-By: Brad Pokorny <brad_pokorny@symantec.com>
Co-Authored-By: Yosef Hoffman <yh128t@att.com>

Change-Id: I90f76c34dbfb20cb54d5f3e599052388bd0dba39
Implements: blueprint configurable-boot-sources
2016-08-17 13:50:15 -04:00
woodm1979 7cbd3b7019 No more space-in-parens eslint errors
Running eslint is effectively useless nowdays because of the
overwhelming number of warnings returned.

This patch fixes the existing "space-in-parens" errors.

I've decided to only fix those errors here to keep the patch small, and
not destroy any chance of success by needing to rebase every 5 minutes.
Other fixes will be incoming.

Change-Id: Ie9292da293eea6a93751e6c17d24068b66c5d62a
Partial-Bug: #1554824
2016-07-22 15:27:22 -06:00
Brad Pokorny cf91124d0c Choose a server group when booting a VM with NG launch instance
Allow users to choose a server group when booting a VM.  Adds
an optional workflow step to the launch instance workflow that
shows the available server groups and details about each group.
The ability to choose a server groups already exists for the
legacy launch instance workflow as a dropdown list, but having
it as a separate step in the angular workflow provides the added
capability of seeing group details.

To test this patch, create a server group via the nova CLI. Example:
  nova server-group-create group1 affinity

And use the angular launch instance workflow to select a server
group. To validate the new instance was added to the server group,
use the nova CLI:
  nova server-group-get [ID of server group]

Change-Id: I651817850ef8a5afec047a9a481843a5eddbf5a9
Implements: blueprint nova-server-groups
2016-07-19 09:25:52 -07:00
Itxaka feb0ad027f Exclude networks with no subnets angular
Nova doesnt allow to boot from a network which has
no subnet, so we should not show those networks on the
new instance launch angular panel.
On the python launch instance this was solved in patch
1b6807baf3

Change-Id: I8b94d45e95f8e22b579d04f6cec7345d947f8e12
Closes-Bug: #1237711
2016-06-07 14:47:57 +02:00
Rob Cresswell b3b88310e1 Add missing unit tests to NG launch instance
https://review.openstack.org/#/c/323623/ added a few new defaults to the
Launch Instance but didn't add any tests, so the backport is blocked on
coverage. Rather than lower coverage, we should just add the tests and
squash the two commits in the backport.

Fastest way to verify is to generate coverage in master, look at the
lines added by https://review.openstack.org/#/c/323623/ (red) then apply
this patch and run again. You'll see they are all white.

Change-Id: I07d2f5ebcb1771a548c0066699194ea619e7461c
Related-Bug: #1587681
2016-06-03 13:18:17 +01:00
Rob Cresswell 3e65e337ee Improve Volume selection handling in LI
The code for updating the Volume Size error in the Launch Instance
source step appears to be incorrect. This patch updates and improves the
handling to also bump the current value to the minimum for the chosen
image (rather than just a form field error). Also changed the default to
create a new volume, as it was advised that this is the more common
workflow.

Change-Id: Iecb679d967b2285776278f23018e4151ebb18df2
Closes-Bug: 1568866
2016-04-30 10:05:19 -05:00
Justin Pomeroy 4254165250 Support scheduler hints when launching instance
This adds the Scheduler Hints step to the angular Launch Instance
workflow and allows specifying arbitrary hints when launching an
instance. It also displays available hints from the glance metadata
definitions catalog OS::Nova::Server namespace that use the
"scheduler_hints" properties target.

Implements: blueprint add-scheduler-hints
Change-Id: Ic33c31e645f45b7a4cbdf13e9a115c96399d5e32
2016-04-15 22:47:57 +00:00
Itxaka 9697a9f580 bump eslint version to 1.10.3
bumps the eslint version to 1.10.3 which fixes a lot of
issues, especially rules not working as expected
or being ignored and brings the js code up to date to
comply with those rules.

Change-Id: I1234e7991f98d4ceb0c5333dc036c6a30206ff64
2016-03-31 14:06:45 +00:00
Itxaka 2aeb99a145 Add Network Port selection to new instance launch
Adds a new step to the new instance launch
with the available ports.
The operator can add or remove ports to be
attached to the instance on boot.
This allows the operator to use ports
at launch instead or together with a network.
Adds tests and modifies other tests to take
into account the new number of steps and the
new addition to the model.

Change-Id: I29fdce433a5a8a9e3ebedbd1a1d96399890e4c6c
Implements: blueprint allow-launching-ports
2016-03-16 17:00:02 +00:00
Justin Pomeroy 73bb9a5943 Allow setting default value for config_drive
This adds a setting that can be used to specify the default value
for the Configuration Drive option when launching an instance.

Closes-Bug: #1537106
Change-Id: If402d3331158b462bece27fa6fce2bdb7f6a4a2e
2016-02-10 21:24:10 -06:00
Jenkins 2b0747ca11 Merge "Add Metadata page to angular Launch Instance wizard" 2016-01-14 03:05:45 +00:00
Justin Pomeroy 98c4d0548f Add Metadata page to angular Launch Instance wizard
This adds the Metadata page to the angular Launch Instance wizard and
allows users to add metadata to an instance when launching.

Limits will only be enforced once this patch merges:
    https://review.openstack.org/209680

Implements: blueprint add-server-metadata
Change-Id: If4202e2e0c934d969ebfb1a566cb04848ad1c28e
2016-01-04 08:53:08 -06:00
Bo Wang 4b00d94cab Trivial: Remove unused services injecting
Change-Id: I1cfe11d3a95b348de170a4966713522b36de00b1
Close-Bug: #1529556
2015-12-28 14:38:36 +08:00
Jenkins 64869259a0 Merge "Show a toast with success on instance creation" 2015-12-17 11:13:16 +00:00
Itxaka 2c7ae7efc9 Show a toast with success on instance creation
toast message was missing from new instance launch
modal

Change-Id: I956255a98e1f6e027181efe55da5f7366316249b
Closes-Bug: #1512428
2015-12-02 17:53:35 +01:00
Akihiro Motoki 5fc26b0a11 Replace "Terminate Instance" with "Delete Instance"
"Delete" is being used almost everywhere in OpenStack Dashboard
except the instance panel. Using "Delete" looks more consistent.
In addition, "Delete" tells non-native English speakers that
deleted instances will be no longer usable again compared to
"Terminate".

DocImpact
Closes-Bug: #1502773
Change-Id: Idccaf3c45566f20f11d02ada64c1d3934a6f3002
2015-11-30 03:55:19 +09:00