Commit Graph

77 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
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
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
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
Zuul db43af3468 Merge "Do not specify device_name when creating server with BFV" 2019-05-08 10:47:17 +00:00
Zuul 52d85539c7 Merge "Not implicitly set vol_device_name to vda" 2019-03-28 15:44:30 +00: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
manchandavishal f05e640950 Modify the success message of launch instance
This patch fixes the issue.

Change-Id: I57172c01f894a3227f39433c343229ba57f44148
Closes-Bug: #1820938
2019-03-20 17:07:19 +00: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
manchandavishal 787ede8d94 Clarify instance state after launch submission
After submitting a launch instance-workflow, an instance is technically
only scheduled for launch - and not yet actually launched.  This patch
reflects this in the message presented in the top right corner.

Closes-Bug: #1287051

Change-Id: Ie86e61c0db561eeb64101c55d304b07191f33ea8
Co-Authored-By: Trygve Vea <trygve.vea@gmail.com>
2019-02-13 10:31:39 +00: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
Feilong Wang 71c4880429 Sort image list by name when launch instance
Just like the flavor sort issue, this is another regression issue
when we shift from the legacy launch instance wizard. By default,
the image list should be ordered by name.

Change-Id: Id619ad531f7e91326694ee90c112d6a7db0d14ad
2018-05-25 15:57:54 +12: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
wei.ying a92d1658d8 Fix the network subnets check in create instance form
If a project is only one available network, we need to verify
whether it contains subnets, otherwise nova api will return
"Network f1a03328-60d0-4b0e-a4a0-d25ec0d185c4 requires
a subnet in order to boot instances on. (HTTP 400)"

The default network may not contain subnets[1]. We should first
query the networks that contains the subnets, and then get the
default network from the networks.

[1] https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js#L478-#L484

Change-Id: I16f7f8cddf045445ed026f62366957de9d289c03
Closes-Bug: #1686449
2017-11-17 13:12:23 +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
Jenkins c9f073930b Merge "Fix instance launch dialog under MSIE11" 2017-06-07 15:52:07 +00: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
Radomir Dopieralski a1dd035050 Fix instance launch dialog under MSIE11
The novaAPI.getFlavors() call takes only a single parameter, which
should be an object with params. But it is being called with two
parameters here, both "true", which makes IE11 fail with TypeError
later on, when it tries to iterate over keys of params.

Change-Id: I0dcfcdca3dda2d94509d7a574184e7f82f21ca22
Closes-Bug: #1694574
2017-06-01 23:27:30 +02:00
Rob Cresswell b0099bbb87 Make the "Select Boot Source" order deterministic
This patch makes the "Select Boot Source" dropdown in the Source step of
the new Launch Instance have a deterministic order.

The slight downside to this is that the order needs to be recalculated
as new possible boot sources are loaded. However, given that this is the
second step of the workflow, this is unlikely to ever be noticed by a
user.

Change-Id: Iaa2e37bae02c9ce5ab654ac8a3327c0834e7b49e
Closes-Bug: 1640493
2017-05-19 11:11:49 +00:00
Jenkins df2aa0d635 Merge "Fix the issue that a wrong message is shown in ng-launch instance" 2017-04-17 17:22:31 +00: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
Kenji Ishii 5f95d40294 Fix the issue that a wrong message is shown in ng-launch instance
In some case like an api response is delaying, users may see the message
"There are no Availability Zones" in Details tab.
Because the request to get availability zones is not still finished.
It makes user confuse.
This patch distinguish whether there are no availability zones or just
under requesting it and show users a proper message.

This matter may occur not only above case but also other tabs.
But at the moment, this patch is addressing only Details tab because
this tab is first one to be shown to users.

Change-Id: Iec1c18ced37b0c3a5f25a01975a8e2b0f2c1f335
Closes-Bug: #1642108
2017-01-29 03:13:29 +00:00
Jenkins f54339f316 Merge "Let Nova to pick availability zone if more than 1" 2016-12-08 23:08:06 +00:00
Jenkins 5974b0bab8 Merge "Add Apache 2.0 license to source file" 2016-12-08 12:29:29 +00:00
Cao Xuan Hoang b01c028673 Add Apache 2.0 license to source file
As per OpenStack licensing guide lines [1]:
[H102 H103] Newly contributed Source Code should be licensed under
the Apache 2.0 license.

[1] http://docs.openstack.org/developer/hacking/#openstack-licensing

Change-Id: If9ae2195d23ee8ed4bfe3da136e647f4e291a415
2016-12-02 17:40:28 +07: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
Jenkins 5401d9245a Merge "Allow wiring of <hz-dynamic-table> into <transfer-table>" 2016-07-27 14:13:23 +00:00
Jenkins 7ae9c6317e Merge "Angular LI:Make sure we always get all limits" 2016-07-26 23:02:02 +00: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
Timur Sufiev 617042b9cb Allow wiring of <hz-dynamic-table> into <transfer-table>
The framework change consists of 2 parts:

* Provide filterAvailable filter to be used inside 'items' value of
  <hz-dynamic-table> instead of 'ng-if' directve which was used before
  in manually written table layout (no longer possible with dynamic
  tables). This filter solves the task of hiding the available values
  once they become allocated.
* Provide 'allocateItemAction' and 'deallocateItemAction' actions on
  transfer-table controller which are compatible with 'itemActions'
  attribute of <hz-dynamic-table>.

Keypairs tab in Angular Launch Instance wizard is rewritten to use the
new approach.

Also a nasty bug within <hz-dynamic-table> was fixed: `scope.items`
value was set in hz-dynamic-table's post-linking function before,
which lead to `undefined` value arriving into st-table directive,
because st-table was linked before hz-dynamic-table as its child
(that's how postLink function works). Directive st-table under some
circustances was wrapping `undefined` into `[]`, causing various
issues with table row equal to `undefined`. The solution to that
problem was to extract setting `scope.items = []` to a pre-linking
function, so by the time st-table is linked, there is already an empty
array under scope's 'items' property.

Closes-Bug: #1597000
Change-Id: Ia6d707d793cefd75d869b061a313390110f620cf
2016-07-20 16:47:03 -07: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 5c5f35afc2 Angular LI:Make sure we always get all limits
When checking with nova for the absolute limits
we were not taking into account the reserved
quotas (i.e. instance in rebuilding will take
cpu and ram) so this could lead to wrongly
thinking that the user could launch more instances
that its quota allowed. It also made the overview
page display wrong quotas as it didnt took into
account those reserved resources.

Change-Id: I42d0bc1521a9da26ee2d23a5900c67badeb2d04b
Closes-bug: 1561310
2016-07-01 09:50:25 +00:00