settingsLogin | Registersettings

[openstack-dev] [OpenStack-Dev][Nova] - https://launchpad.net/bugs/1667794 Changing hostname not to be treated as a pattern instead exact match will be done.

0 votes

Hello all,

This is regarding bug 1667794 as mentioned in subject.
Its review is going on here.
https://review.openstack.org/#/c/474949/

Bug is - Nova treats hostname as pattern

Description
Nova commands such as "hypervisor-list --matching ",
host-evacuate-live and host-evacuate and few more, treat the
user-specified "host-name" as the input to the HTTP
/os-hypervisors/{hypervisorhostnamepattern}/search API.

Nova checks "host-name" as a pattern instead of exact match,
which causes problem with some commands such as
nova host-evacuate-live compute-1 where in host-evacuate
action will apply to all "compute-1", "compute-10".
That is not right.
Correcting it by using exact match.
We have fixed it and put it for review. We need your opinion on this.

Kindly share your opinion in case this does not seem to be an acceptable fix to anyone.

Thanks
Nidhi

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
asked Jul 26, 2017 in openstack-dev by nidhi.hada_at_wipro. (940 points)   1 3

7 Responses

0 votes

On 7/14/2017 6:49 AM, nidhi.hada@wipro.com wrote:
Hello all,

This is regarding bug 1667794 as mentioned in subject.

Its review is going on here.

https://review.openstack.org/#/c/474949/

*_Bug is - _**_Nova treats hostname as pattern_*

Description

Nova commands such as "hypervisor-list --matching ",

host-evacuate-live and host-evacuate and few more, treat the

user-specified "host-name" as the input to the HTTP

/os-hypervisors/{hypervisorhostnamepattern}/search API.

Nova checks "host-name" as a pattern instead of exact match,

which causes problem with some commands such as

nova host-evacuate-live compute-1 where in host-evacuate

action will apply to all "compute-1", "compute-10".

That is not right.

Correcting it by using exact match.

We have fixed it and put it for review. We need your opinion on this.

Kindly share your opinion in case this does not seem to be an
acceptable fix to anyone.

Thanks

Nidhi

The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain proprietary, confidential or privileged information. If
you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and
destroy all copies of this message and any attachments. WARNING:
Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus
transmitted by this email. www.wipro.com


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Thanks for bringing this up. Your fix is in the wrong place, see the
comments in the patch.

--

Thanks,

Matt


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Jul 14, 2017 by mriedemos_at_gmail.c (15,720 points)   2 4 9
0 votes

Hello Matt,

Kindly see analysis below and suggest.

When we execute
stack@ubuntu14-OptiPlex-3020:~/openstack_install/devstack$ nova --debug host-evacuate wipro
.
.
.
DEBUG (session:347) REQ: curl -g -i -X GET http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers -H "OpenStack-API-Version: compute 2.46" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-OpenStack-Nova-API-Version: 2.46" -H "X-Auth-Token: {SHA1}9e9230a54eff2444ac32fa054c6bab3dbe446df9" >>>>>>>>>>>>>>>>>>>>>>>>>>

nova api that's being called is this
https://developer.openstack.org/api-ref/compute/?expanded=search-hypervisor-detail,list-hypervisor-servers-detail#list-hypervisor-servers
Where it clearly states: "List all servers belong to each hypervisor whose host name is matching a given hypervisor host name or portion of it."

Another available api for hostname match is
https://developer.openstack.org/api-ref/compute/?expanded=search-hypervisor-detail,list-hypervisor-servers-detail#search-hypervisor
which states: "Search hypervisor by a given hypervisor host name or portion of it."

There is no api available at present where hostname is matched not as a pattern. PCMIIW.

Hence it can't be just fixed in client as it is.

Solution: I thought we can fix it by changing only http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers api to match hostname as exact so that
https://developer.openstack.org/api-ref/compute/?expanded=search-hypervisor-detail,list-hypervisor-servers-detail#search-hypervisor remains unaffected.
This I still have to change in nova server code, I will use an additional function parameter to specify if exact match is desired or a pattern match is desired.

But then http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers is being used by many other commands than just host-evacuate.
Which all will be affected.

Listing commands that will be affected are .

Function in novaclient from where we call api
def search(self, hypervisormatch, servers=False): >>>>>>>>>>>>>>.servers is False by default
"""
Get a list of matching hypervisors.
:param servers: If True, server information is also retrieved.
"""
target = 'servers' if servers else 'search'
url = ('/os-hypervisors/%s/%s' %
(parse.quote(hypervisor
match, safe=''), target)) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
return self._list(url, 'hypervisors')

we are passing servers as true in these cli commands.

Servers = True
==============================================
1.
dohostmeta(cs, args):
"""Set or Delete metadata on all instances of a host."""
hypervisors = cs.hypervisors.search(args.host, servers=True)

2.
@utils.arg(
'hostname',
metavar='',
help=('The hypervisor hostname (or pattern) to search for.'))
def do
hypervisor_servers(cs, args):
"""List servers belonging to specific hypervisors."""
hypers = cs.hypervisors.search(args.hostname, servers=True)

3.
def dohostevacuate(cs, args):
"""Evacuate all instances from failed host."""

hypervisors = cs.hypervisors.search(args.host, servers=True)

4.
def dohostevacuate_live(cs, args):
"""Live migrate all instances of the specified host
to other available hosts.
"""
hypervisors = cs.hypervisors.search(args.host, servers=True)
response = []

5.
def dohostservers_migrate(cs, args):
"""Cold migrate all instances off the specified host to other available
hosts.
"""

hypervisors = cs.hypervisors.search(args.host, servers=True)
response = []
for hyper in hypervisors:

Servers = false
===============
1.
def dohypervisorlist(cs, matching=None, limit=None, marker=None):
columns = ['ID', 'Hypervisor hostname', 'State', 'Status']
if matching:
utils.print
list(cs.hypervisors.search(matching), columns)

Please suggest what is better solution?

1)Modifying http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers api code in nova server side code - to match hostname as exact not as a pattern
We can code so that http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/search remains unaffected.

2)We should introduce a new parameter in servers api which from cli which directs that exact match is to be
done in url.
http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers?exact_match=true
and query parameter then interpreted in server side code and behave as desired.
In this case we will have choice to not affect at undesired commands.

Thanks
Nidhi

-----Original Message-----
From: Matt Riedemann [mailto:mriedemos@gmail.com]
Sent: Friday, July 14, 2017 7:22 PM
To: openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [OpenStack-Dev][Nova] - https://launchpad.net/bugs/1667794 Changing hostname not to be treated as a pattern instead exact match will be done.

** This mail has been sent from an external source. Treat hyperlinks and attachments in this email with caution**

On 7/14/2017 6:49 AM, nidhi.hada@wipro.com wrote:
Hello all,

This is regarding bug 1667794 as mentioned in subject.

Its review is going on here.

https://clicktime.symantec.com/a/1/49nJvSe1Be7H66fNyloEH0VFJQ88tUzr9ao
8kyFM3jc=?d=huhMONMwyIvPyRTNVFVFEoKBc2izoSPlzhtdZ1egR7bwY3hW0n6gBw5Pf
_aKziBo
pOhFqtNZ7hwc696PKDDY0ern8LIG6XT0Pa5GnYDhIM8xtNkatqd6xu-fn6091
KREiE5rxafexQfe-rJ7RZKU7RWnI0BMsnrkU7NWqJOLUlJi9hKN2qxzIp-n8ZnSkjcNzp9
81ZLIMs7MJ--gOKTl4pZEsfb
MBwDbeOUcZA5mm8WANpU0XMEUHdqhphAf2QXPUL8oHD6l
RCzrptg5Fi9L4e2YX6ZA28AUqup5WAH1B4OTE4mbfcaZxfm9sIXtUyWvbaKBRG-syj4W
eDNjzAvxku3u9xfD1HWy1MUp36GMU4z7N3BJGZuiIu4YmCjmsKdXbm0i5CkmgPB0jOfuP
6fjyr9PfbBEtvQYMIQLTIoOCFWag30Q5VqPVnfh-Nzv
T1kbO3TCFZqoZktPT8Vo6wAk45
hsiX0HknkBnNqR21E7Fb5t2hG0HjqNSxgld9NIXGZng7JR&u=https%3A%2F%2Freview.
openstack.org%2F%23%2Fc%2F474949%2F

*_Bug is - _**_Nova treats hostname as pattern_*

Description

Nova commands such as "hypervisor-list --matching ",

host-evacuate-live and host-evacuate and few more, treat the

user-specified "host-name" as the input to the HTTP

/os-hypervisors/{hypervisorhostnamepattern}/search API.

Nova checks "host-name" as a pattern instead of exact match,

which causes problem with some commands such as

nova host-evacuate-live compute-1 where in host-evacuate

action will apply to all "compute-1", "compute-10".

That is not right.

Correcting it by using exact match.

We have fixed it and put it for review. We need your opinion on this.

Kindly share your opinion in case this does not seem to be an
acceptable fix to anyone.

Thanks

Nidhi

The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
addressee(s) and may contain proprietary, confidential or privileged
information. If you are not the intended recipient, you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately and destroy all copies of this message and any attachments. WARNING:
Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus
transmitted by this email. www.wipro.com


____ OpenStack Development Mailing List (not for usage questions)
Unsubscribe:
OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
https://clicktime.symantec.com/a/1/9RX_Q306kvu_hhDcIzBL0WNsDUY3rwoCi9T
8g25S6fc=?d=huhMONMwyIvPyRTNVFVFEoKBc2izoSPlzhtdZ1egR7bwY3hW0n6gBw5Pf
_aKziBo
pOhFqtNZ7hwc696PKDDY0ern8LIG6XT0Pa5GnYDhIM8xtNkatqd6xu-fn6091
KREiE5rxafexQfe-rJ7RZKU7RWnI0BMsnrkU7NWqJOLUlJi9hKN2qxzIp-n8ZnSkjcNzp9
81ZLIMs7MJ--gOKTl4pZEsfb
MBwDbeOUcZA5mm8WANpU0XMEUHdqhphAf2QXPUL8oHD6l
RCzrptg5Fi9L4e2YX6ZA28AUqup5WAH1B4OTE4mbfcaZxfm9sIXtUyWvbaKBRG-syj4W
eDNjzAvxku3u9xfD1HWy1MUp36GMU4z7N3BJGZuiIu4YmCjmsKdXbm0i5CkmgPB0jOfuP
6fjyr9PfbBEtvQYMIQLTIoOCFWag30Q5VqPVnfh-Nzv
T1kbO3TCFZqoZktPT8Vo6wAk45
hsiX0HknkBnNqR21E7Fb5t2hG0HjqNSxgld9NIXGZng7JR&u=http%3A%2F%2Flists.op
enstack.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fopenstack-dev

Thanks for bringing this up. Your fix is in the wrong place, see the comments in the patch.

--

Thanks,

Matt


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
https://clicktime.symantec.com/a/1/9RX_Q306kvu_hhDcIzBL0WNsDUY3rwoCi9T8g25S6fc=?d=huhMONMwyIvPyR_TNVFVFEoKBc2izoSPlzhtdZ1egR7bwY3hW0n6gBw5Pf_aKziBo_pOhFqtNZ7hwc696PKDDY0ern8LIG6XT0Pa5GnYDhIM8xtNkatqd6_xu-fn6091KREiE5rxafexQfe-rJ7RZKU7RWnI0BMsnrkU7NWqJOLUlJi9hKN2qxzIp-n8ZnSkjcNzp981ZLIMs7MJ--gOKTl4pZEsfb_MBwDbeOUcZA5mm8WANpU0XMEUHdqhphAf2QXPUL8oHD6lRCzrptg5Fi9_L4e2YX6ZA28AUqup5WAH1B4OT_E4mbfcaZxfm9sIXtUyWvbaKBRG-syj4WeDNjzAvxku3u9xfD1HWy1MUp36GMU4z7N3BJGZuiIu4YmCjmsKdXb_m0i5CkmgPB0jOfuP6fjyr9PfbBEtvQYMIQLTIoOCFWag30Q5VqPVnfh-Nzv_T1kbO3TCFZqoZktPT8Vo6wAk45hsiX0HknkBnNqR21E7Fb5t2hG0HjqNSxgld9NIXGZng7JR&u=http%3A%2F%2Flists.openstack.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fopenstack-dev


This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com ______________________________________________________________________
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com

OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Jul 25, 2017 by nidhi.hada_at_wipro. (940 points)   1 3
0 votes

Hello All,

This is follow up mail on my y'days mail regarding bug
https://bugs.launchpad.net/python-novaclient/+bug/1667794

It looks like all the cli commands that are related to
http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers api
are expecting exact match.

Commands which are affected if we change
http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers api
from pattern match to exact match are as below :
It’s clearly seen that these commands expect exact match only.

Servers = True

1.
dohostmeta(cs, args):
"""Set or Delete metadata on all instances of a host."""
hypervisors = cs.hypervisors.search(args.host, servers=True)

2.
@utils.arg(
'hostname',
metavar='',
help=('The hypervisor hostname (or pattern) to search for.')) def dohypervisor_servers(cs, args):
"""List servers belonging to specific hypervisors."""
hypers = cs.hypervisors.search(args.hostname, servers=True)

3.
def dohostevacuate(cs, args):
"""Evacuate all instances from failed host."""

hypervisors = cs.hypervisors.search(args.host, servers=True)

4.
def dohostevacuate_live(cs, args):
"""Live migrate all instances of the specified host
to other available hosts.
"""
hypervisors = cs.hypervisors.search(args.host, servers=True)
response = []

5.
def dohostservers_migrate(cs, args):
"""Cold migrate all instances off the specified host to other available
hosts.
"""

hypervisors = cs.hypervisors.search(args.host, servers=True)
response = []
for hyper in hypervisors:

Hence, I am planning to correct/change http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers api
to match hostname as exact match “NOT” as a pattern.

Please comment if any other opinion on this.

Thanks
Nidhi

-----Original Message-----
From: Nidhi Mittal Hada (Product Engineering Service)
Sent: Tuesday, July 25, 2017 12:42 PM
To: openstack-dev@lists.openstack.org
Cc: 'mriedemos@gmail.com' mriedemos@gmail.com
Subject: RE: [openstack-dev] [OpenStack-Dev][Nova] - https://launchpad.net/bugs/1667794 Changing hostname not to be treated as a pattern instead exact match will be done.

Hello Matt,

Kindly see analysis below and suggest.

When we execute
stack@ubuntu14-OptiPlex-3020:~/openstack_install/devstack$ nova --debug host-evacuate wipro .
.
.
DEBUG (session:347) REQ: curl -g -i -X GET http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers -H "OpenStack-API-Version: compute 2.46" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-OpenStack-Nova-API-Version: 2.46" -H "X-Auth-Token: {SHA1}9e9230a54eff2444ac32fa054c6bab3dbe446df9" >>>>>>>>>>>>>>>>>>>>>>>>>>

nova api that's being called is this
https://developer.openstack.org/api-ref/compute/?expanded=search-hypervisor-detail,list-hypervisor-servers-detail#list-hypervisor-servers
Where it clearly states: "List all servers belong to each hypervisor whose host name is matching a given hypervisor host name or portion of it."

Another available api for hostname match is https://developer.openstack.org/api-ref/compute/?expanded=search-hypervisor-detail,list-hypervisor-servers-detail#search-hypervisor
which states: "Search hypervisor by a given hypervisor host name or portion of it."

There is no api available at present where hostname is matched not as a pattern. PCMIIW.

Hence it can't be just fixed in client as it is.

Solution: I thought we can fix it by changing only http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers api to match hostname as exact so that https://developer.openstack.org/api-ref/compute/?expanded=search-hypervisor-detail,list-hypervisor-servers-detail#search-hypervisor remains unaffected.
This I still have to change in nova server code, I will use an additional function parameter to specify if exact match is desired or a pattern match is desired.

But then http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers is being used by many other commands than just host-evacuate.
Which all will be affected.

Listing commands that will be affected are .

Function in novaclient from where we call api
def search(self, hypervisormatch, servers=False): >>>>>>>>>>>>>>.servers is False by default
"""
Get a list of matching hypervisors.
:param servers: If True, server information is also retrieved.
"""
target = 'servers' if servers else 'search'
url = ('/os-hypervisors/%s/%s' %
(parse.quote(hypervisor
match, safe=''), target)) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
return self._list(url, 'hypervisors')

we are passing servers as true in these cli commands.

Servers = True
==============================================
1.
dohostmeta(cs, args):
"""Set or Delete metadata on all instances of a host."""
hypervisors = cs.hypervisors.search(args.host, servers=True)

2.
@utils.arg(
'hostname',
metavar='',
help=('The hypervisor hostname (or pattern) to search for.')) def dohypervisor_servers(cs, args):
"""List servers belonging to specific hypervisors."""
hypers = cs.hypervisors.search(args.hostname, servers=True)

3.
def dohostevacuate(cs, args):
"""Evacuate all instances from failed host."""

hypervisors = cs.hypervisors.search(args.host, servers=True)

4.
def dohostevacuate_live(cs, args):
"""Live migrate all instances of the specified host
to other available hosts.
"""
hypervisors = cs.hypervisors.search(args.host, servers=True)
response = []

5.
def dohostservers_migrate(cs, args):
"""Cold migrate all instances off the specified host to other available
hosts.
"""

hypervisors = cs.hypervisors.search(args.host, servers=True)
response = []
for hyper in hypervisors:

Servers = false
===============
1.
def dohypervisorlist(cs, matching=None, limit=None, marker=None):
columns = ['ID', 'Hypervisor hostname', 'State', 'Status']
if matching:
utils.print
list(cs.hypervisors.search(matching), columns)

Please suggest what is better solution?

1)Modifying http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers api code in nova server side code - to match hostname as exact not as a pattern
We can code so that http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/search remains unaffected.

2)We should introduce a new parameter in servers api which from cli which directs that exact match is to be
done in url.
http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers?exact_match=true
and query parameter then interpreted in server side code and behave as desired.
In this case we will have choice to not affect at undesired commands.

Thanks
Nidhi

-----Original Message-----
From: Matt Riedemann [mailto:mriedemos@gmail.com]
Sent: Friday, July 14, 2017 7:22 PM
To: openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [OpenStack-Dev][Nova] - https://launchpad.net/bugs/1667794 Changing hostname not to be treated as a pattern instead exact match will be done.

** This mail has been sent from an external source. Treat hyperlinks and attachments in this email with caution**

On 7/14/2017 6:49 AM, nidhi.hada@wipro.com wrote:
Hello all,

This is regarding bug 1667794 as mentioned in subject.

Its review is going on here.

https://clicktime.symantec.com/a/1/49nJvSe1Be7H66fNyloEH0VFJQ88tUzr9ao
8kyFM3jc=?d=huhMONMwyIvPyRTNVFVFEoKBc2izoSPlzhtdZ1egR7bwY3hW0n6gBw5Pf
_aKziBo
pOhFqtNZ7hwc696PKDDY0ern8LIG6XT0Pa5GnYDhIM8xtNkatqd6xu-fn6091
KREiE5rxafexQfe-rJ7RZKU7RWnI0BMsnrkU7NWqJOLUlJi9hKN2qxzIp-n8ZnSkjcNzp9
81ZLIMs7MJ--gOKTl4pZEsfb
MBwDbeOUcZA5mm8WANpU0XMEUHdqhphAf2QXPUL8oHD6l
RCzrptg5Fi9L4e2YX6ZA28AUqup5WAH1B4OTE4mbfcaZxfm9sIXtUyWvbaKBRG-syj4W
eDNjzAvxku3u9xfD1HWy1MUp36GMU4z7N3BJGZuiIu4YmCjmsKdXbm0i5CkmgPB0jOfuP
6fjyr9PfbBEtvQYMIQLTIoOCFWag30Q5VqPVnfh-Nzv
T1kbO3TCFZqoZktPT8Vo6wAk45
hsiX0HknkBnNqR21E7Fb5t2hG0HjqNSxgld9NIXGZng7JR&u=https%3A%2F%2Freview.
openstack.org%2F%23%2Fc%2F474949%2F

*_Bug is - _**_Nova treats hostname as pattern_*

Description

Nova commands such as "hypervisor-list --matching ",

host-evacuate-live and host-evacuate and few more, treat the

user-specified "host-name" as the input to the HTTP

/os-hypervisors/{hypervisorhostnamepattern}/search API.

Nova checks "host-name" as a pattern instead of exact match,

which causes problem with some commands such as

nova host-evacuate-live compute-1 where in host-evacuate

action will apply to all "compute-1", "compute-10".

That is not right.

Correcting it by using exact match.

We have fixed it and put it for review. We need your opinion on this.

Kindly share your opinion in case this does not seem to be an
acceptable fix to anyone.

Thanks

Nidhi

The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
addressee(s) and may contain proprietary, confidential or privileged
information. If you are not the intended recipient, you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately and destroy all copies of this message and any attachments. WARNING:
Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus
transmitted by this email. www.wipro.com


____ OpenStack Development Mailing List (not for usage questions)
Unsubscribe:
OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
https://clicktime.symantec.com/a/1/9RX_Q306kvu_hhDcIzBL0WNsDUY3rwoCi9T
8g25S6fc=?d=huhMONMwyIvPyRTNVFVFEoKBc2izoSPlzhtdZ1egR7bwY3hW0n6gBw5Pf
_aKziBo
pOhFqtNZ7hwc696PKDDY0ern8LIG6XT0Pa5GnYDhIM8xtNkatqd6xu-fn6091
KREiE5rxafexQfe-rJ7RZKU7RWnI0BMsnrkU7NWqJOLUlJi9hKN2qxzIp-n8ZnSkjcNzp9
81ZLIMs7MJ--gOKTl4pZEsfb
MBwDbeOUcZA5mm8WANpU0XMEUHdqhphAf2QXPUL8oHD6l
RCzrptg5Fi9L4e2YX6ZA28AUqup5WAH1B4OTE4mbfcaZxfm9sIXtUyWvbaKBRG-syj4W
eDNjzAvxku3u9xfD1HWy1MUp36GMU4z7N3BJGZuiIu4YmCjmsKdXbm0i5CkmgPB0jOfuP
6fjyr9PfbBEtvQYMIQLTIoOCFWag30Q5VqPVnfh-Nzv
T1kbO3TCFZqoZktPT8Vo6wAk45
hsiX0HknkBnNqR21E7Fb5t2hG0HjqNSxgld9NIXGZng7JR&u=http%3A%2F%2Flists.op
enstack.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fopenstack-dev

Thanks for bringing this up. Your fix is in the wrong place, see the comments in the patch.

--

Thanks,

Matt


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
https://clicktime.symantec.com/a/1/9RX_Q306kvu_hhDcIzBL0WNsDUY3rwoCi9T8g25S6fc=?d=huhMONMwyIvPyR_TNVFVFEoKBc2izoSPlzhtdZ1egR7bwY3hW0n6gBw5Pf_aKziBo_pOhFqtNZ7hwc696PKDDY0ern8LIG6XT0Pa5GnYDhIM8xtNkatqd6_xu-fn6091KREiE5rxafexQfe-rJ7RZKU7RWnI0BMsnrkU7NWqJOLUlJi9hKN2qxzIp-n8ZnSkjcNzp981ZLIMs7MJ--gOKTl4pZEsfb_MBwDbeOUcZA5mm8WANpU0XMEUHdqhphAf2QXPUL8oHD6lRCzrptg5Fi9_L4e2YX6ZA28AUqup5WAH1B4OT_E4mbfcaZxfm9sIXtUyWvbaKBRG-syj4WeDNjzAvxku3u9xfD1HWy1MUp36GMU4z7N3BJGZuiIu4YmCjmsKdXb_m0i5CkmgPB0jOfuP6fjyr9PfbBEtvQYMIQLTIoOCFWag30Q5VqPVnfh-Nzv_T1kbO3TCFZqoZktPT8Vo6wAk45hsiX0HknkBnNqR21E7Fb5t2hG0HjqNSxgld9NIXGZng7JR&u=http%3A%2F%2Flists.openstack.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fopenstack-dev


This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com ______________________________________________________________________

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Jul 26, 2017 by nidhi.hada_at_wipro. (940 points)   1 3
0 votes

On 7/26/2017 12:24 AM, nidhi.hada@wipro.com wrote:
Hello All,
This is follow up mail on my y'days mail regarding bug
_https://bugs.launchpad.net/python-novaclient/+bug/1667794_
It looks like all the cli commands that are related to
http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers api
are expecting exact match.
Commands which are affected if we change
http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers api
from pattern match to exact match are as below :
It’s clearly seen that these commands expect exact match only.

How is this clear? The help on the --host parameter to the 'nova
hypervisor-servers' command says:

"The hypervisor hostname (or pattern) to search for."

Hence, I am planning to correct/change
http://10.141.67.190:8774/v2.1/os-hypervisors/wipro/servers api
to match hostname as exact match “NOT” as a pattern.

This is basically already done for you in microversion 2.53:

https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id48

If you need to list hypervisors and get the servers hosted on those
hypervisors in the response, you can do that with the "with_servers"
query parameter on these APIs:

GET /os-hypervisors?withservers=True
GET /os-hypervisors/detail?with
servers=True

The /servers and /search routes are deprecated in the 2.53 microversion,
meaning they won't work with microversion >= 2.53, you'll get a 404
response.

The novaclient change for 2.53 is here:

https://review.openstack.org/#/c/485435/

Given this, what else do you need? Please be clear about what your use
case is and how it is not solved using the 2.53 microversion. There may
need to be changes to the CLI but let's separate that concern from the
REST API changes.

--

Thanks,

Matt


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Jul 26, 2017 by mriedemos_at_gmail.c (15,720 points)   2 4 9
0 votes

On 7/26/2017 11:23 AM, Matt Riedemann wrote:

Given this, what else do you need? Please be clear about what your use
case is and how it is not solved using the 2.53 microversion. There may
need to be changes to the CLI but let's separate that concern from the
REST API changes.

I think your issue might be with these commands which use the
hypervisors.search python API binding in novaclient:

  1. nova host-meta # Set or Delete metadata on all instances of a host.
  2. nova host-evacuate # Evacuate all instances from failed host
  3. nova host-evacuate-live # Live migrate all instances of the specified
    host (we should really rename this command since it doesn't 'evacuate'
    it live migrates)
  4. nova host-servers-migrate # Cold migrate all instances off the
    specified host

The risk with any of these is on the hostname match hitting more
hypervisors than you wanted or expected. So if I have 10 computes in a
London region in data center 1 named something like
london.dc1.compute1.foo.bar, london.dc1.compute2.foo.bar, etc, and I do:

nova host-evacuate london.dc1

It's going to match all of those and evacuate instances from all of
those dc1 computes in my london region at once, obviously probably not
something you want, unless dc1 is being attacked by Harry Potter fans
and you need to get those instances to another data center.

The solution here is you specify the fully qualified domain name for the
host you want to evacuate:

nova host-evacuate london.dc1.compute1.foo.bar

Right? What am I missing here?

If you wanted to change the CLI to be more strict, we could do that by
just adding a --strict_hostname option or something and fail if we get
back more than one host, as a way to guard the operator from making a
mistake.

But none of this sounds like changes that need to be done in the REST
API, and arguably isn't a bug in the CLI either.

--

Thanks,

Matt


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Jul 26, 2017 by mriedemos_at_gmail.c (15,720 points)   2 4 9
0 votes

On 7/26/2017 11:34 AM, Matt Riedemann wrote:
On 7/26/2017 11:23 AM, Matt Riedemann wrote:

Given this, what else do you need? Please be clear about what your use
case is and how it is not solved using the 2.53 microversion. There
may need to be changes to the CLI but let's separate that concern from
the REST API changes.

I think your issue might be with these commands which use the
hypervisors.search python API binding in novaclient:

  1. nova host-meta # Set or Delete metadata on all instances of a host.
  2. nova host-evacuate # Evacuate all instances from failed host
  3. nova host-evacuate-live # Live migrate all instances of the specified
    host (we should really rename this command since it doesn't 'evacuate'
    it live migrates)
  4. nova host-servers-migrate # Cold migrate all instances off the
    specified host

The risk with any of these is on the hostname match hitting more
hypervisors than you wanted or expected. So if I have 10 computes in a
London region in data center 1 named something like
london.dc1.compute1.foo.bar, london.dc1.compute2.foo.bar, etc, and I do:

nova host-evacuate london.dc1

It's going to match all of those and evacuate instances from all of
those dc1 computes in my london region at once, obviously probably not
something you want, unless dc1 is being attacked by Harry Potter fans
and you need to get those instances to another data center.

The solution here is you specify the fully qualified domain name for the
host you want to evacuate:

nova host-evacuate london.dc1.compute1.foo.bar

Right? What am I missing here?

If you wanted to change the CLI to be more strict, we could do that by
just adding a --strict_hostname option or something and fail if we get
back more than one host, as a way to guard the operator from making a
mistake.

But none of this sounds like changes that need to be done in the REST
API, and arguably isn't a bug in the CLI either.

Also, FYI in case you haven't read this:

http://www.danplanet.com/blog/2016/03/03/evacuate-in-nova-one-command-to-confuse-us-all/

--

Thanks,

Matt


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Jul 26, 2017 by mriedemos_at_gmail.c (15,720 points)   2 4 9
0 votes

Thanks Matt,

Thanks for explaining this well.

and bug is being taken care by chris now.

Thanks
Nidhi

-----Original Message-----
From: Matt Riedemann [mailto:mriedemos@gmail.com]
Sent: Wednesday, July 26, 2017 10:06 PM
To: OpenStack Development Mailing List (not for usage questions) openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [OpenStack-Dev][Nova] - https://launchpad.net/bugs/1667794 Changing hostname not to be treated as a pattern instead exact match will be done.

** This mail has been sent from an external source. Treat hyperlinks and attachments in this email with caution**

On 7/26/2017 11:34 AM, Matt Riedemann wrote:
On 7/26/2017 11:23 AM, Matt Riedemann wrote:

Given this, what else do you need? Please be clear about what your
use case is and how it is not solved using the 2.53 microversion.
There may need to be changes to the CLI but let's separate that
concern from the REST API changes.

I think your issue might be with these commands which use the
hypervisors.search python API binding in novaclient:

  1. nova host-meta # Set or Delete metadata on all instances of a host.
  2. nova host-evacuate # Evacuate all instances from failed host 3.
    nova host-evacuate-live # Live migrate all instances of the specified
    host (we should really rename this command since it doesn't 'evacuate'
    it live migrates)
  3. nova host-servers-migrate # Cold migrate all instances off the
    specified host

The risk with any of these is on the hostname match hitting more
hypervisors than you wanted or expected. So if I have 10 computes in a
London region in data center 1 named something like
london.dc1.compute1.foo.bar, london.dc1.compute2.foo.bar, etc, and I do:

nova host-evacuate london.dc1

It's going to match all of those and evacuate instances from all of
those dc1 computes in my london region at once, obviously probably not
something you want, unless dc1 is being attacked by Harry Potter fans
and you need to get those instances to another data center.

The solution here is you specify the fully qualified domain name for
the host you want to evacuate:

nova host-evacuate london.dc1.compute1.foo.bar

Right? What am I missing here?

If you wanted to change the CLI to be more strict, we could do that by
just adding a --strict_hostname option or something and fail if we get
back more than one host, as a way to guard the operator from making a
mistake.

But none of this sounds like changes that need to be done in the REST
API, and arguably isn't a bug in the CLI either.

Also, FYI in case you haven't read this:

https://clicktime.symantec.com/a/1/WpT1yeVBi7ncF0Ca_OTDe44XocFyzb3l8mmGaRh90eA=?d=15Eqjgzs0zz_nCSfkIZ03H85QhaaZ8qorwC1B6sNqR2qaif0YzQu9aDyucao9W0xq9TmblqjEa8vB_Uh6I73ZbcJ_aBt5DG4hUd_exR4jRYcFWvfIJ_1sJw7muMlygwsZvrfBDP-hVB_uXIw68-6qIXjtKoNEPSrkV-9tVoi_no3lioykWQyfYuIaypPH_lo9jcJ_725u3cfMocfzAqis4UJvyHrrMoOgOK2PklJIvKHbALogoTLSYmTFrN6xq8nf8PiICHVw-syDE_acSqDUCVN9XffaeX3bkJ_TyqUNTLd04O3ghc_JNsdgMV1bJLEoU802f-tZAa8ExalsfHb-X5N6KC9rAi-StOuSXqpZkLoPDifDeQoLG8KO46UxM7GC_SA_o-pD36JVzP2iPmxnbz1_pk1fg5pKYtsoxcsAHgdWlgYN-mKok_UuJXNYZci0i7D7_p-0RsbyTqrZNjuUU-O4a8j-fk0amKyj6FTVaJI-v-0kQ%3D%3D&u=http%3A%2F%2Fwww.danplanet.com%2Fblog%2F2016%2F03%2F03%2Fevacuate-in-nova-one-command-to-confuse-us-all%2F

--

Thanks,

Matt


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
https://clicktime.symantec.com/a/1/30lNRL8YgGNm4hBzvUlj4IRURgEORzz8xa3pXFvMfQk=?d=15Eqjgzs0zz_nCSfkIZ03H85QhaaZ8qorwC1B6sNqR2qaif0YzQu9aDyucao9W0xq9TmblqjEa8vB_Uh6I73ZbcJ_aBt5DG4hUd_exR4jRYcFWvfIJ_1sJw7muMlygwsZvrfBDP-hVB_uXIw68-6qIXjtKoNEPSrkV-9tVoi_no3lioykWQyfYuIaypPH_lo9jcJ_725u3cfMocfzAqis4UJvyHrrMoOgOK2PklJIvKHbALogoTLSYmTFrN6xq8nf8PiICHVw-syDE_acSqDUCVN9XffaeX3bkJ_TyqUNTLd04O3ghc_JNsdgMV1bJLEoU802f-tZAa8ExalsfHb-X5N6KC9rAi-StOuSXqpZkLoPDifDeQoLG8KO46UxM7GC_SA_o-pD36JVzP2iPmxnbz1_pk1fg5pKYtsoxcsAHgdWlgYN-mKok_UuJXNYZci0i7D7_p-0RsbyTqrZNjuUU-O4a8j-fk0amKyj6FTVaJI-v-0kQ%3D%3D&u=http%3A%2F%2Flists.openstack.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fopenstack-dev


This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com ______________________________________________________________________
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com

OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Jul 27, 2017 by nidhi.hada_at_wipro. (940 points)   1 3
...