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

TRITON-814 sapi admin network needs to be rackaware #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions boot/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ echo "Starting sapi SMF service."
# (Note that sdc_common_setup behavior differs when SAPI is in proto mode for
# initial headnode setup.)
#
# TODO: make RANish
ADMIN_IP=$(mdata-get sdc:nics | json -a -c 'this.nic_tag === "admin"' | json ip)
mdata-put sapi-url http://$ADMIN_IP

Expand Down
5 changes: 2 additions & 3 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var util = require('util');

var assert = require('assert-plus');
var bunyan = require('bunyan');
var netconfig = require('triton-netconfig');
var vasync = require('vasync');

var NEEDED_SERVICES = [
Expand Down Expand Up @@ -205,9 +206,7 @@ function loadConfig(opts, callback) {
}

var nics = JSON.parse(stdout.trim());
ctx.adminIp = nics.filter(function (nic) {
return (nic.nic_tag === 'admin');
})[0].ip;
ctx.adminIp = netconfig.adminIpFromNicsArray(nics);

if (!ctx.adminIp) {
next(new Error('Missing required ' +
Expand Down