Commit 6398a712 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Fix another Mike reported problem of not getting the right virtnode

count.
parent cab36c26
......@@ -177,13 +177,15 @@ NODE: foreach my $node_id (@node_ids) {
# Make sure that the new node is of a valid type, and grab a few other
# things to fill in as initial values
#
$query_result = DBQueryFatal("SELECT control_iface FROM node_types " .
"WHERE type='$type'");
$query_result = DBQueryFatal("SELECT control_iface,virtnode_capacity ".
"FROM node_types WHERE type='$type'");
if (!$query_result->num_rows()) {
warn "Node $node_id failed: Type $type does not exist!\n";
next NODE;
}
my ($control_iface) = $query_result->fetchrow();
my ($control_iface,$virtnode_capacity) = $query_result->fetchrow();
$virtnode_capacity = 0
if (!defined($virtnode_capacity));
#
# Grab the node's MACs from the new_interfaces table
......@@ -389,9 +391,9 @@ NODE: foreach my $node_id (@node_ids) {
$vtype = "$vtype-vm";
}
DBQueryFatal("INSERT INTO node_auxtypes set node_id='$node_id', " .
"type='pcvm', count=$DEFAULT_PCVM_COUNT");
"type='pcvm', count=$virtnode_capacity");
DBQueryFatal("INSERT INTO node_auxtypes set node_id='$node_id', " .
"type='$vtype', count=$DEFAULT_PCVM_COUNT");
"type='$vtype', count=$virtnode_capacity");
}
while (my ($card, $aref) = each %interfaces) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment