Merge ~kgarloff/cloud-init:detect_otc_as_openstack_ds into cloud-init:master

Proposed by Kurt Garloff
Status: Rejected
Rejected by: Chad Smith
Proposed branch: ~kgarloff/cloud-init:detect_otc_as_openstack_ds
Merge into: cloud-init:master
Diff against target: 39 lines (+11/-5)
1 file modified
tools/ds-identify (+11/-5)
Reviewer Review Type Date Requested Status
cloud-init Commiters Pending
Review via email: mp+341845@code.launchpad.net

Description of the change

Two commits to address LP: #1756471.
(a) Detect gen1 Xen hosts in OpenTelekomCloud by asset tag as OpenSource DS.
(b) Downgrade OpenStack DS to DS_MAYBE if ConfigDrive2 is detected, as it is a valid fallback on many OpenStack clouds, including OpenTelekomCloud BareMetal systems.

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

Hi Kurt, Thanksk for the merge proposal.

I'd like to make a suggestion
a.) split the 'a' and 'b' to different merge requests.
  'a' is straight forward win
b.) could have side effects.
  we can discuss that more on its own MP, but I think that as it is right now config-drive would always end up taking precedence if it is present, because it runs at "local" time frame while the openstack runs in network stage.

Revision history for this message
Kurt Garloff (kgarloff) wrote :

Hi Scott,

On 21.03.2018 19:34, Scott Moser wrote:
> Hi Kurt, Thanksk for the merge proposal.
>
> I'd like to make a suggestion
> a.) split the 'a' and 'b' to different merge requests.

I intentionally did two commits to the branch, not just one, so they can
be treated as separate entities ...
You could just git cherry-pick the first one, no?
Or does that break your tooling/workflow?

> 'a' is straight forward win
Agree.
> b.) could have side effects.
> we can discuss that more on its own MP, but I think that as it is right now config-drive would always end up taking precedence if it is present, because it runs at "local" time frame while the openstack runs in network stage.

Sure, IF cloud-init / ds-identify are configured to allow the
ConfigDrive DS, then it will take precendence, so no change there.
If for some reason it's disabled or fails and if the user has configured
the ds-identify policy to also try the MAYBE sources (which is default),
then a fallback can happen.

So do you want to cherry-pick or do you want me to create a fresh branch
with the first patch and then another branch based on the first branch
with the second patch on top?
Or, if you merge quickly, I can alternatively create the second branch
on top of master with the first one already merged ...

Let me know ...

--
Kurt Garloff <email address hidden>, Cologne, DE

Revision history for this message
Scott Moser (smoser) wrote :

Kurt,
I put up just the 'Identify OpenTelecomcloud' commit as
 https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/341851

and added a ds-identify unit test for it.

After that lands (I hope shortly) we can look at the second one here.

Revision history for this message
Scott Moser (smoser) wrote :

the other is merged now, so you can rebase and push then the diff will get updated.

Revision history for this message
Kurt Garloff (kgarloff) wrote :

Rebase done. (I hope I have not screwed up the git commands.)

Revision history for this message
Scott Moser (smoser) wrote :

Kurt I suspect you didn't push without --force.

you have to push --force because you have a non-fastforward locally after the rebase.

Revision history for this message
Kurt Garloff (kgarloff) wrote :

Hi Scott,

thanks for the hint!

Better now?

-- Kurt

On 23.03.2018 17:32, Scott Moser wrote:
> Kurt I suspect you didn't push without --force.
>
> you have to push --force because you have a non-fastforward locally after the rebase.
>

--
Kurt Garloff <email address hidden>, Cologne, DE

Revision history for this message
Scott Moser (smoser) wrote :

Kurt.
Looks good. thanks.

I still have to think about this more. But you've done the right bits in the MP.
Thanks.

Revision history for this message
Chad Smith (chad.smith) wrote :

Kurt, thanks for the work on this, your work has landed in 18.2 cloud-init version 18.2 and is currently present in bionic (and xenial-proposed pocket). If you wish to test it out cloud-init 18.2 or greater will have the functionality you need as the branch which landed your functionality is here:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/341851

Marking this branch as rejected only from a documentation perspective. The content has been accepted upstream.

Unmerged commits

89abc06... by Kurt Garloff

Downgrade OpenStack DS to MAYBE is ConfigDrive2 is found.

The old code unconditionally disabled OpenStack DS when ConfigDrive2
was detected. However, we might not have ConfigDrive2 configured or
find it undesirable otr sable for some reason.

So change this to keep OpenStack as MAYBE DS that we can fall back
to if the user so desires.

OpenTelekomCloud provide a network OpenStack DS on BareMetal instances
in addition to the ConfigDrive DS provided there, so this patch
increases the options there.

Followup to LP: #1756471.

825db3a... by Kurt Garloff

Identify OpenTelekomCloud Xen as OpenStack DS.

Open Telekom Cloud gen1 (Xen) hosts do not provide nova product
names in DMI but Xen HVM domU. They can however be safely identified
by the OpenTelekomCloud Chassis asset tag. OpenTelekomCloud does
use the network OpenStack DataSource, so we better detect it.

This fixes LP: #1756471.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tools/ds-identify b/tools/ds-identify
2index 9a2db5c..a981e53 100755
3--- a/tools/ds-identify
4+++ b/tools/ds-identify
5@@ -892,23 +892,29 @@ dscheck_GCE() {
6 dscheck_OpenStack() {
7 # the openstack metadata http service
8
9- # if there is a config drive, then do not check metadata
10+ OSDS_FOUND=${DS_FOUND}
11+ # if there is a config drive, then downgrade OpenStack to fallback
12+ # datasource DS_MAYBE (if we find signs of existence).
13 # FIXME: if config drive not in the search list, then we should not
14 # do this check.
15 check_configdrive_v2
16 if [ $? -eq ${DS_FOUND} ]; then
17- return ${DS_NOT_FOUND}
18+ OSDS_FOUND=${DS_MAYBE}
19 fi
20 local nova="OpenStack Nova" compute="OpenStack Compute"
21 if dmi_product_name_matches "$nova"; then
22- return ${DS_FOUND}
23+ return ${OSDS_FOUND}
24 fi
25 if dmi_product_name_matches "$compute"; then
26 # RDO installed nova (LP: #1675349).
27- return ${DS_FOUND}
28+ return ${OSDS_FOUND}
29 fi
30 if [ "${DI_PID_1_PRODUCT_NAME}" = "$nova" ]; then
31- return ${DS_FOUND}
32+ return ${OSDS_FOUND}
33+ fi
34+ # OTC gen1 (Xen) hosts use OpenStack datasource, LP: #1756471
35+ if dmi_chassis_asset_tag_matches "OpenTelekomCloud"; then
36+ return ${OSDS_FOUND}
37 fi
38
39 if dmi_chassis_asset_tag_matches "OpenTelekomCloud"; then

Subscribers

People subscribed via source and target branches