mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 05:04:56 +09:00
1 parent
d9ee08235b
commit
42d83f59bf
1 file changed
+29
-1
@@ -191,10 +191,38 @@ void get_network_attribute(VirtualMachine * vm,
|
||||
}
|
||||
}
|
||||
|
||||
if (vnet_id == -1)
|
||||
vector<const VectorAttribute *> alias;
|
||||
int alias_num = vm->get_template_attribute("NIC_ALIAS", alias);
|
||||
|
||||
if (vnet_id == -1 && alias_num == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i=0; i < alias_num ;i++)
|
||||
{
|
||||
if ( alias[i]->vector_value(net_name.c_str()) == net_value )
|
||||
{
|
||||
if (alias[i]->vector_value("NETWORK_ID", vnet_id) != 0)
|
||||
{
|
||||
vnet_id = -1;
|
||||
}
|
||||
|
||||
if (alias[i]->vector_value("AR_ID", ar_id) != 0)
|
||||
{
|
||||
vnet_id = -1;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (vnet_id == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------
|
||||
// Get the attribute template from the image
|
||||
|
||||
Reference in new issue
Block a user