Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update provision_start_ip fails with does not exist #17

Open
joshzitting opened this issue Jul 27, 2016 · 4 comments
Open

update provision_start_ip fails with does not exist #17

joshzitting opened this issue Jul 27, 2016 · 4 comments
Assignees

Comments

@joshzitting
Copy link

we have an ip range 204.198.20.128/27 and on initial set up we only gave it access to 8 IPs.

"provision_start_ip": "204.198.20.143",
"provision_end_ip": "204.198.20.150",

we now need to expand the DHCP range to start at .130.

We formated our put like so..

sdc-napi '/networks/374d4d11-fbdd-44db-9c4b-60c0e9256381' -X PUT -d '{"provision_start_ip": "204.198.20.130"}' 

and it returned

{
  "message": "napi_ips_374d4d11_fbdd_44db_9c4b_60c0e9256381::204.198.20.142 does not exist"
}

We also tried doing this from the adminui and got the same error. Thanks

@melloc
Copy link
Contributor

melloc commented Jul 27, 2016

@joshzitting Did you originally create this network with a much older NAPI? This sounds like it may be related to the bug fixed in 47ab1da, where if you had a network created with an older NAPI, and then updated to a newer NAPI (from before the fix in 20151224), updating provision_{start,end}_ip would change the format of the boundary record's key, making it so that it can't be found again during a later update. If you log into your NAPI zone, you can run:

[root@headnode (coal) ~]# sdc-login napi
[Connected to zone '06c2e4cc-bf38-4721-9b70-b67a6701950f' pts/5]
Last login: Mon Jul 25 22:51:44 on pts/5
[root@06c2e4cc-bf38-4721-9b70-b67a6701950f (coal:napi0) ~]# cd /opt/smartdc/napi/
[root@06c2e4cc-bf38-4721-9b70-b67a6701950f (coal:napi0) /opt/smartdc/napi]# ./bin/ip2num 204.198.20.142
3435533454

And then log into the Moray zone, you should be able to see and do something like this:

[root@headnode (coal) ~]# sdc-login moray
[Connected to zone '0789d234-ee9f-4a35-a9ae-35d4161c6ac9' pts/4]
[root@0789d234-ee9f-4a35-a9ae-35d4161c6ac9 (coal:moray0) ~]# findobjects napi_ips_374d4d11_fbdd_44db_9c4b_60c0e9256381 '(|(ip=3435533454)(ipaddr=204.198.20.142))'
{ 
  "bucket": "napi_ips_374d4d11_fbdd_44db_9c4b_60c0e9256381",
  "key": "204.198.20.142",
  "value": {
    "reserved": false,
    "ip": 3435533454
  },
  "_id": 5,
  "_etag": "6CBB67E4",
  "_mtime": 1469074036350,
  "_txn_snap": null,
  "_count": 1
}

Can you confirm that this is the case?

@melloc
Copy link
Contributor

melloc commented Jul 27, 2016

Actually, reviewing the old code, I think that just upgrading to a version past 20151224 will fix your issue.

@joshzitting
Copy link
Author

@melloc
Thank you for your help!
Trying your cmds above I actually get..

napi_ips_374d4d11_fbdd_44db_9c4b_60c0e9256381 does not have indexes that support (|(ip=3340095118)(ipaddr=204.198.20.142))

if we run the ldap command without the ipaddr= it returns the following...

# findobjects napi_ips_374d4d11_fbdd_44db_9c4b_60c0e9256381 '(ip=3340095118)'
{
  "bucket": "napi_ips_374d4d11_fbdd_44db_9c4b_60c0e9256381",
  "key": "3340095118",
  "value": {
    "ip": 3340095118,
    "reserved": false
  },
  "_id": 2,
  "_etag": "1DB98AC9",
  "_mtime": 1469652981628,
  "_txn_snap": null,
  "_count": 1
}

We have been planning an upgrade for a while but have to get a few more issues sorted out (these IPs being one of the hurdles)

is there any NON upgrade solution that we may try until we can do an upgrade?

Thanks!

@melloc
Copy link
Contributor

melloc commented Jul 27, 2016

@joshzitting You should be able to cleanly apply the changes in 47ab1da to /opt/smartdc/napi/lib/models/network.js in your local NAPI zone, and then run svcadm restart napi. With those changes, you should then be able to update.

You can also upgrade just NAPI if you want, with sdcadm update napi.

@melloc melloc self-assigned this Jul 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants