You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Alexey Serbin (Code Review)" <ge...@cloudera.org> on 2020/03/19 01:02:16 UTC

[kudu-CR] [util] KUDU-3067 add OpenStack metadata detector

Alexey Serbin has uploaded this change for review. ( http://gerrit.cloudera.org:8080/15488


Change subject: [util] KUDU-3067 add OpenStack metadata detector
......................................................................

[util] KUDU-3067 add OpenStack metadata detector

This patch adds OpenStack metadata detector that works with OpenStack
Nova metadata server (see [1] for details).  In addition, this patch
fixes the existing AWS detector to tell apart a true EC2 instance
from a masquerading OpenStack one [2].

I couldn't get access to an OpenStack instance, but I asked the reporter
of KUDU-3067 to test how it works and report back.

1. https://docs.openstack.org/nova/latest/user/metadata.html#metadata-service
2. https://docs.openstack.org/nova/latest/user/metadata.html#metadata-ec2-format

Change-Id: I84cc6d155ab1fbd7b401f5349d292f46fcac3a34
---
M src/kudu/util/cloud/instance_detector-test.cc
M src/kudu/util/cloud/instance_detector.cc
M src/kudu/util/cloud/instance_metadata.cc
M src/kudu/util/cloud/instance_metadata.h
4 files changed, 89 insertions(+), 10 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/88/15488/1
-- 
To view, visit http://gerrit.cloudera.org:8080/15488
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I84cc6d155ab1fbd7b401f5349d292f46fcac3a34
Gerrit-Change-Number: 15488
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>

[kudu-CR] [util] KUDU-3067 add OpenStack metadata detector

Posted by "liusheng (Code Review)" <ge...@cloudera.org>.
liusheng has posted comments on this change. ( http://gerrit.cloudera.org:8080/15488 )

Change subject: [util] KUDU-3067 add OpenStack metadata detector
......................................................................


Patch Set 1: Code-Review+1

@Alexey Serbin Thanks for address this, LGTM


-- 
To view, visit http://gerrit.cloudera.org:8080/15488
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I84cc6d155ab1fbd7b401f5349d292f46fcac3a34
Gerrit-Change-Number: 15488
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: liusheng <li...@gmail.com>
Gerrit-Comment-Date: Thu, 19 Mar 2020 06:58:50 +0000
Gerrit-HasComments: No

[kudu-CR] [util] KUDU-3067 add OpenStack metadata detector

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15488 )

Change subject: [util] KUDU-3067 add OpenStack metadata detector
......................................................................


Patch Set 1: Code-Review+2

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15488/1/src/kudu/util/cloud/instance_metadata.cc
File src/kudu/util/cloud/instance_metadata.cc:

http://gerrit.cloudera.org:8080/#/c/15488/1/src/kudu/util/cloud/instance_metadata.cc@189
PS1, Line 189:   if (openstack.Init().ok()) {
So we'll need two curls to identify the common case of a bog-standard AWS instance? That's unfortunate.



-- 
To view, visit http://gerrit.cloudera.org:8080/15488
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I84cc6d155ab1fbd7b401f5349d292f46fcac3a34
Gerrit-Change-Number: 15488
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: liusheng <li...@gmail.com>
Gerrit-Comment-Date: Thu, 19 Mar 2020 05:52:39 +0000
Gerrit-HasComments: Yes

[kudu-CR] [util] KUDU-3067 add OpenStack metadata detector

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/15488 )

Change subject: [util] KUDU-3067 add OpenStack metadata detector
......................................................................

[util] KUDU-3067 add OpenStack metadata detector

This patch adds OpenStack metadata detector that works with OpenStack
Nova metadata server (see [1] for details).  In addition, this patch
fixes the existing AWS detector to tell apart a true EC2 instance
from a masquerading OpenStack one [2].

I couldn't get access to an OpenStack instance, but I asked the reporter
of KUDU-3067 to test how it works and report back.

1. https://docs.openstack.org/nova/latest/user/metadata.html#metadata-service
2. https://docs.openstack.org/nova/latest/user/metadata.html#metadata-ec2-format

Change-Id: I84cc6d155ab1fbd7b401f5349d292f46fcac3a34
Reviewed-on: http://gerrit.cloudera.org:8080/15488
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Reviewed-by: liusheng <li...@gmail.com>
---
M src/kudu/util/cloud/instance_detector-test.cc
M src/kudu/util/cloud/instance_detector.cc
M src/kudu/util/cloud/instance_metadata.cc
M src/kudu/util/cloud/instance_metadata.h
4 files changed, 89 insertions(+), 10 deletions(-)

Approvals:
  Kudu Jenkins: Verified
  Adar Dembo: Looks good to me, approved
  liusheng: Looks good to me, but someone else must approve

-- 
To view, visit http://gerrit.cloudera.org:8080/15488
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I84cc6d155ab1fbd7b401f5349d292f46fcac3a34
Gerrit-Change-Number: 15488
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: liusheng <li...@gmail.com>

[kudu-CR] [util] KUDU-3067 add OpenStack metadata detector

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15488 )

Change subject: [util] KUDU-3067 add OpenStack metadata detector
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15488/1/src/kudu/util/cloud/instance_metadata.cc
File src/kudu/util/cloud/instance_metadata.cc:

http://gerrit.cloudera.org:8080/#/c/15488/1/src/kudu/util/cloud/instance_metadata.cc@189
PS1, Line 189:   if (openstack.Init().ok()) {
> So we'll need two curls to identify the common case of a bog-standard AWS i
I could not find another way doing so that would seem reliable given current OpenStack Nova & AWS documentation.  I  considered checking HTTP response headers fields, but it's more fragile given it's not documented as a part of API, and there isn't a guarantee that OpenStack will not emulate response headers of EC2 servers as well.



-- 
To view, visit http://gerrit.cloudera.org:8080/15488
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I84cc6d155ab1fbd7b401f5349d292f46fcac3a34
Gerrit-Change-Number: 15488
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: liusheng <li...@gmail.com>
Gerrit-Comment-Date: Thu, 19 Mar 2020 15:55:08 +0000
Gerrit-HasComments: Yes

[kudu-CR] [util] KUDU-3067 add OpenStack metadata detector

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15488 )

Change subject: [util] KUDU-3067 add OpenStack metadata detector
......................................................................


Patch Set 2:

> @Alexey Serbin Thanks for address this, LGTM

Thank you for the review.

Did you have a chance to verify the fix against a real OpenStack instance?  I would appreciate if you confirm it works as expected for you.


-- 
To view, visit http://gerrit.cloudera.org:8080/15488
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I84cc6d155ab1fbd7b401f5349d292f46fcac3a34
Gerrit-Change-Number: 15488
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: liusheng <li...@gmail.com>
Gerrit-Comment-Date: Thu, 19 Mar 2020 15:56:39 +0000
Gerrit-HasComments: No

[kudu-CR] [util] KUDU-3067 add OpenStack metadata detector

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15488 )

Change subject: [util] KUDU-3067 add OpenStack metadata detector
......................................................................


Patch Set 2:

> > > @Alexey Serbin Thanks for address this, LGTM
 > >
 > > Thank you for the review.
 > >
 > > Did you have a chance to verify the fix against a real OpenStack
 > > instance?  I would appreciate if you confirm it works as expected
 > > for you.
 > 
 > sure, I have verified, the hybrid_clock-test test can pass in VM in
 > OpenStack based cloud after applying this patch, thank you!

Perfect, I'm glad it works for you.  Thank you for verifying!


-- 
To view, visit http://gerrit.cloudera.org:8080/15488
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I84cc6d155ab1fbd7b401f5349d292f46fcac3a34
Gerrit-Change-Number: 15488
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: liusheng <li...@gmail.com>
Gerrit-Comment-Date: Fri, 20 Mar 2020 16:50:23 +0000
Gerrit-HasComments: No

[kudu-CR] [util] KUDU-3067 add OpenStack metadata detector

Posted by "liusheng (Code Review)" <ge...@cloudera.org>.
liusheng has posted comments on this change. ( http://gerrit.cloudera.org:8080/15488 )

Change subject: [util] KUDU-3067 add OpenStack metadata detector
......................................................................


Patch Set 2:

> > @Alexey Serbin Thanks for address this, LGTM
 > 
 > Thank you for the review.
 > 
 > Did you have a chance to verify the fix against a real OpenStack
 > instance?  I would appreciate if you confirm it works as expected
 > for you.

sure, I have verified, the hybrid_clock-test test can pass in VM in OpenStack based cloud after applying this patch, thank you!


-- 
To view, visit http://gerrit.cloudera.org:8080/15488
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I84cc6d155ab1fbd7b401f5349d292f46fcac3a34
Gerrit-Change-Number: 15488
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: liusheng <li...@gmail.com>
Gerrit-Comment-Date: Fri, 20 Mar 2020 02:03:50 +0000
Gerrit-HasComments: No