Commit Graph

101 Commits

Author SHA1 Message Date
Ghanshyam Mann 8325044e7a Retire Tripleo: remove repo content
TripleO project is retiring
- https://review.opendev.org/c/openstack/governance/+/905145

this commit remove the content of this project repo

Change-Id: Ib988f3b567e31c2b9402f41e5dd222b7fc006756
2024-02-24 11:41:49 -08:00
Dzmitry Stremkouski 002b2d201b Improving parameters processing
- parametrize BMC credentials.
- adding ability to set variables from the ENV to avoid sensitive
  data leak to a terminal or process listing.

'required=True' has been removed from the '--instance' parameter
to allow setting it from the ENV.

Change-Id: Ida5df11fc3c50dcdabd2741b9a8abfa5fb87ed45
2022-09-22 11:34:44 +02:00
Steve Baker e7f4a60f4d Build a minimal bmc clouds.yaml
Currently every auth attribute (including every service endpoint
version) ends up in the generated BMC clouds.yaml, but most of these
values are not required and are discovered via the catalog.

This change builds a bare-minimal clouds.yaml.

Change-Id: Ic408cefa03f0c1ae7ba00fa891aa4bf3f81b3d1e
2022-08-18 08:44:05 +12:00
Steve Baker ae8499e00d Support setting any interface in build-nodes-json
build-nodes-json now has an --interface argument which allows setting
any of the supported ironic node interfaces. For example, the
following will result in "boot_interface": "pxe" being set for every
node entry:

--interface boot=pxe

Change-Id: I209456464e5e605f777b02869e3aae4c9c192fe5
2022-08-18 08:38:27 +12:00
Zuul e757f3c6f4 Merge "Set explicit boot mode even for bios boot" 2021-09-23 16:04:59 +00:00
Steve Baker 041df632fc Set explicit boot mode even for bios boot
OVB correctly detects when the image is UEFI boot enabled and sets
boot_mode:uefi. However non-UEFI images will use the ironic configured
default, and this will soon change from 'bios' to 'uefi'.

This change explicitly sets to boot mode to either 'bios' or 'uefi'
based on discovered image properties so that ironic defaults can
change without causing CI failures.

Change-Id: If97d33aee65a05f6fb860eb4f3c1655bc4605908
2021-09-22 14:49:42 +12:00
Harald Jensås fa2c425843 Handle bmc-none in build_nodes_json.py
When there are less bmc_ports, compared to bm_ports filter
away bm_ports without a match bmc_port and set up the
baremetal to bmc pairs in bmc_bm_port_pairs.

All bm_ports are returned, and used with the new separate
function to build network_details. The new bmc_bm_port_pairs
is used with the _build_nodes method to create the a "nodes"
section containing only the bm nodes with a bmc port peer.

This is useful when using multiple roles, where one role
is hosting extra nodes that is not intended as virtual
baremetal nodes.

Change-Id: Ifc36d15b72c7421d7e0ec810d1ead17f4232b3ab
2021-06-29 17:07:45 +02:00
Harald Jensås 23914fab1a build-nodes-json - use ports by default, mac is deprecated
The mac field in TripleO nodes JSON has been deprecated
since Rocky. Let's switch to use the 'ports' field by
default.

Add the argument '--use-mac' to allow the user to choose
to use the legacy "mac" field.

Change-Id: I3728bb8589a82fea71f54505c6f7c17e79d8378e
2021-06-22 17:37:17 +02:00
yatinkarel 02cdcbb752 When private network is created suffix it with identifier
It's needed when environments/create-private-network.yaml
is used with ovb jobs where '--id' is used, in this
case each ovb env should have seperate private network
with different id.

Related-Change: https://review.rdoproject.org/r/#/c/32142/

Change-Id: Icf5c87ae1ab083a143a0f3f8a991426bb5433c37
2021-03-04 21:19:03 +05:30
Harald Jensås 2a08c50da8 Add option to strip '--id' from physical_network
When using routed networks it is required to set the
physical_network property for baremetal ports. The
'--physical-network' option makes the build-nodes-json
command add this.

Whith this change the '--id' arg can be used with the
build-nodes-json command to strip the id added with the
deploy commands '--id' option from the resource name
when setting the physical_network property.

Usage:
 ovb-build-nodes-json --env my-env.yaml \
   --nodes_json instackenv.json \
   --physical_network \
   --id <ID-to-strip>

Change-Id: Ic5fea591464a9f8bb91bcaef9a99d0b9e994e19e
2020-10-21 13:09:23 +02:00
Harald Jensås 4dedbd95c4 Add --id support for routed network resources
Append the 'id' to router resources, and also the server
name for the dhcpv6-ralay

Change-Id: Ic72bb921f5f23acf49eb2f967e242031ae87fa94
2020-09-24 02:08:17 +02:00
Harald Jensås 6b3d7f1aaa Add prefix --id support for the radvd and dhcrelay
Add prefix support for radvd and dhcrelay instances.
Also adds missing parameters for these instances in
the sample env generator environment.

Change-Id: I86bd6b014b62c3a382458f68443cfb02ed2e7031
2020-07-08 09:45:36 +00:00
Hervé Beraud 99841adb93 Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I292be888fef955705fae5e29c27d4083ae455d59
2020-06-02 20:34:33 +02:00
Sean McGinnis bdaa7473b5 Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I78a70c535950f645fcb3a5f1e820d70cc6958d36
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-22 20:39:38 +00:00
Harald Jensås 92df14be1b Update default power managemnt driver to 'ipmi'
The 'pxe_ipmitool' driver was replaced by the 'ipmi'
driver. Let's update the default.

Change-Id: I098bffd81d387cefaa8d07a9db1ec28c1c5d961c
2020-03-16 14:29:25 +01:00
Mohammed Naser 60ceab89c4 bmc: assume powering-on state is ACTIVE
Inside newer deployments of OpenStack, it's possible that powering
on takes quite sometime especially with a large amount of ports
attached to the VM.  This is because Nova has to unplug and plug
all of the ports which can take a period of time.

During the period of time that Nova is starting the instance up,
the state of the VM is 'powering-on' and eventually it becomes
ACTIVE.  However, the IPMI status value presented is still offline
which is inaccurate.

In order to model this more towards a real bare metal environment,
we now maintain that 'powering-up' means the instance is active
which will let tools be able to move on with other steps like
PXE boot which was going to take sometime anyways.

If the booting fails, the instance will likely timeout and fail to
provision anyways, so we don't really lose much and on the next
refresh we'll figure out that state is SHUTOFF with no task state.

Change-Id: Ifa4d0152ec3086ef2e2b65e03a4499798964b78e
2019-12-09 16:51:39 -05:00
Ben Nemec 6210189b04 Make BMC optional
When using pre-deployed servers, you may want all of the networking
setup of OVB but don't actually need to control the instances via
IPMI. While this could already be done, it left a useless BMC
instance lying around. This change allows the BMC to be disabled
completely to clean up such environments.

Change-Id: Icd6936977684d178277ebb721a7fbb3ffad51d9a
2019-03-21 12:56:31 -05:00
Ben Nemec 277a36dd26 Enable pip install
Previously no entry points were defined for the OVB scripts because
they were intended to be used directly out of the bin directory.
However, because of changes in the way Python 3 handles relative
imports we can't continue to do that going forward, so we need to
be able to pip install OVB and have callable binaries.

This adds entry points for the necessary user-called files, but
does not yet update the documentation as the previous method
should still work. Once the pip version has been more thoroughly
tested the docs will be updated to the new method.

Change-Id: I158f58a58314c985baaeb7309cee6f284cb53985
2019-02-12 16:09:21 -06:00
Sagi Shnaidman 53c6fe95a8 Import auth with try/except
To make it pass python2/3 linters and fix OVB stack creating.

Change-Id: I6994f2f31cf16b9ccd73e8d92c029ff0789c54c1
Related-Bug: 1815660
2019-02-12 19:32:25 +00:00
Ben Nemec 9e7ee5dd5c Add python36 job to repo
Also fixes a python 3 issue that was causing these tests to fail.

Note that I don't think we need to worry about supporting py35 in
this repo. I believe the only python 3 platforms we'll ever use it
on are py36 or higher.

Change-Id: I4ade3e0ae1ffa2253d998275f73044cacf656c0e
2019-01-16 12:39:10 -06:00
Ben Nemec 5b2ca11ff1 Add Zuul config
Without this I don't think we can merge any patches. Just a minimal
one for now while we sort out which jobs need to and can run on this
repo.

Also fixes a pep8 error so this can pass the pep8 job.

Change-Id: If2601ecd3d3596455d9826a9a0e1c5c8c27d3aab
2019-01-15 09:59:32 -06:00
Ben Nemec 51b31cd9a2 Remove deprecated bmc_bm_pairs file
Now that nodes.json contains the name of the baremetal instances,
there's no need to have a separate mapping file for the bmc ips.
This has been deprecated for close to a year, so let's remove it
in 2.0.
2019-01-11 17:16:49 -06:00
Ben Nemec 16f1fa30df Remove unused imports
I failed to run pep8 after removing the legacy code that used these.
2018-12-14 17:31:05 +00:00
Ben Nemec 3a73a83fb1 Add symlinks for old port-security environments
For ease of migration to OVB 2.0, let's provide a compatibility
interface from the old names. A deprecation warning is also added
to deploy.py to notify users that they are using outdated
environments and should switch.

port-security.yaml is not symlinked because there's no analog in
OVB 2.0. port-security.yaml is just the default now. I suppose that
could be an empty file, but I'm not sure anyone is using it
anyway so for the moment I'm omitting it. That decision can be
revisited if necessary.
2018-12-14 17:08:14 +00:00
Ben Nemec 247c2d02d2 Remove non-port-security templates
OVB 2.0 won't support clouds that lack the port-security extension,
so these are no longer needed.
2018-12-12 22:31:13 +00:00
Ben Nemec c655b38624 Remove deprecated options from openstackbmc
These have been deprecated for over a year now and can be safely
removed in 2.0.
2018-12-12 20:36:23 +00:00
Ben Nemec adef2029f6 Remove support for parameters section
It hasn't been recommended to pass settings in via the parameters
section for quite a while now, and in 2.0 let's remove it completely.
This simplifies a lot of the logic around id and role processing.
2018-12-12 20:24:42 +00:00
Ben Nemec db5c1e4d69 Correct logic for adding id when processing role
Previously the id was always appended, but when the network names
were inherited from the parent data they already had it. This change
looks for whether the name already ends in -id and if so it skips
the id addition.
2018-10-23 16:56:13 +00:00
Harald Jensås 026eeb342b Revert changes to deploy.py in c13640 and update unit tests
Revert the change to _process_role() method done in commit:
c1364026fa. Passing networks
will only be supported via parameters_defaults.

Update the unit tests to include the data in parameter_defaults.
2018-10-18 12:48:02 +02:00
Harald Jensås 6c8d9c5da9 Only add identifyer if arg.id is set
When deploying routed networks using quintupleo and roles
without '--id' arg specified the role stack fail with
property error:
 resources.internal_port.properties.network: \
   Error validating value 'overcloud_internal-None'

By only appending id if arg.id is set, the above problem is
fixed.

Additionally: The TripleO undercloud hard codes the physical
network for the provisioning network which is L2 local to the
undercloud to 'ctlplane'.

It makes sense to set the following in ovb environment:
  provision_net: ctlplane
  provision_net2: ctlplane-leaf1
  provision_net3: ctlplane-leaf2

By ommitting the '-id <id>' parameter in combination with the
above  the nodes.json build by build-nodes-json works out of
the box.
2018-10-10 01:02:17 +02:00
Harald Jensås 43a37ee843 Fix build-nodes-json for routed networks
When using routed networks, i.e multiple provision networks
passing in the evironment file to build-nodes-json did'nt work.
It resulted in key errors when looking up the mac address of the
provision_net interface.

This change automates this by creating a provision_net_map, mapping
baremetal_port id's to subnet names.

Also deprecates the --provision-net option as it is no longer needed.
2018-10-10 01:02:17 +02:00
Harald Jensås c1364026fa Fix a key error in _process_role() + pep8 and py27 tests
The role does not always override the network information.
Update the networks in role_env, get the network from
parameter_defaults, fallback to parameters if not set and
finally if the netwok is not in parameters set default.

Also make default for networks: in templates json instead
of literal string.
2018-10-10 01:02:09 +02:00
Ben Nemec 22612113ee Add id support to routed networks
Previously routed networks only worked when --id was not used with
deploy.py.  This adds the routed networks to the list of parameters
that can be updated with an id.
2018-10-05 16:42:46 +00:00
Ben Nemec 096f7217d6 Allow roles to specify their networks
For a routed network topology we want to be able to deploy roles
that don't necessarily connect to the same networks as the base
role.  By default the behavior will be the same as before, but now
it will be possible to override the parameters in a role env.
2018-10-05 16:42:46 +00:00
Ben Nemec c61719f8c4 Add --physical_network option to build-nodes-json
This will be needed for routed networks support.
2018-07-27 19:16:43 +00:00
Ben Nemec 6d23f5906e Allow key_name to be overridden in role files
There's no reason this has to be the same across all roles and in
some cases it may be necessary to have it different.
2018-05-22 11:45:17 -05:00
Ben Nemec 3449a8263f Fix power_shutdown target_status
Clearly the shutdown action should not have had a target_status of
ACTIVE.  This should only have impacted bmcs using the status cache,
which is off by default.
2018-03-16 11:52:39 -05:00
Ben Nemec d43ce6228a Print warning for unimplemented function
Instead of noop'ing on a power_reset request to the bmc, print a
message so it is obvious that we received something that couldn't
be handled.
2018-03-16 11:50:57 -05:00
Adriano Petrich 247cc163ce Merge branch 'frac/fix_pep8' of github.com:frac/openstack-virtual-baremetal into frac/fix_pep8 2018-03-14 08:02:46 +00:00
Adriano Petrich 8dde4a4945 Fix tox pep8 errors and add parenthesis to print. 2018-03-14 08:00:05 +00:00
Adriano Petrich bfdb9698df Fix tox pep8 errors and add parenthesis to print. 2018-02-16 15:18:31 +00:00
Dmitry Tantsur 4a624fa676 Allow customizing driver for build-nodes-json
We're deprecating the old drivers, including pxe_ipmitool. The new
--driver argument allows specifying the driver to use.
2018-02-14 17:41:59 +01:00
Ben Nemec e051d91fd9 Correctly retrieve disk size for boot from volume
Previously the flavor size was used unconditionally, which in the
boot from volume case would generally be incorrect.  This is
particularly problematic with flavors of a 0 disk size that can only
be used with boot from volume as the resulting Ironic nodes appear
to have no storage.

This change adds functionality to look up the volume size if we
detect that a baremetal instance was booted from volume.
2018-01-30 16:58:15 -06:00
Ben Nemec a0fa1b36b3 Prevent overwrite of input env file
When deploying an environment with --id, it is possible for the
input env file to be overwritten.  For example, consider the deploy
command `bin/deploy.py --quintupleo --id foo -e env-foo.yaml`.
Because the output id env file would be named the same as the input
env file the input env file would be overwritten and lost.

This change prevents such a situation by checking for an input env
file named 'env-ID.yaml' and raising an error if one is found.
2018-01-24 11:33:16 -06:00
Ben Nemec 783843678c Disallow _ in role names
This will break the name processing that happens in build-nodes-json,
so we should prevent users from creating such an environment in the
first place.
2018-01-24 10:31:52 -06:00
Ben Nemec c65fbbb9b5 Deprecate bmc_bm_pairs
This file is no longer needed now that we set the name of each
instance in nodes.json itself.  Deprecate it for removal in about
six months.
2018-01-24 10:31:52 -06:00
Sagi Shnaidman ec2ed40a32 Print stack error message if failed to create
If stack isn't created it's impossible to see from logs why.
Add printing error message before raising exception.
2018-01-24 11:02:42 +02:00
Ben Nemec 71652499e0 Fix default env file handling
When multiple environment support was added, backwards compatibility
was supposed to be maintained by setting the env list to env.yaml
if no envs were passed.  Unfortunately, this was done _after_ the
env list was read so it was ineffective.

This is a fairly uncommon use case as most OVB deploys will use at
least one environment file these days, but it should work so this
commit fixes it.
2018-01-22 14:35:31 -06:00
Ben Nemec 2e4dd517d1 Add --network_details to build-nodes-json
This is useful as a general way to easily retrieve the assigned
network addresses for all the deployed nodes.  This also deprecates
the --add_undercloud parameter as those details will be included
in the network_details data.
2017-10-18 16:13:48 -05:00
Ben Nemec 0a9b703611 Allow overriding bmc_flavor in roles
When deploying a large number of nodes in a single role, it may be
necessary to specify a larger bmc flavor.  Allowing override of that
parameter allows that to happen without requiring all roles to use
the larger bmc.
2017-09-27 10:10:13 -05:00