opennebula-4.12.1-uniquenic.diff
opennebula-4.12.1-uniquenic/src/vmm/LibVirtDriverKVM.cc 2015-11-25 23:25:25.486849969 -0600 | ||
---|---|---|
747 | 747 |
for(int i=0; i<num; i++) |
748 | 748 |
{ |
749 | 749 |
nic = dynamic_cast<const VectorAttribute *>(attrs[i]); |
750 |
ostringstream target_str; |
|
751 |
target_str << "one-" << vm->get_oid() << "-" << i; |
|
750 | 752 | |
751 | 753 |
if ( nic == 0 ) |
752 | 754 |
{ |
... | ... | |
756 | 758 |
bridge = nic->vector_value("BRIDGE"); |
757 | 759 |
bridge_ovs = nic->vector_value("BRIDGE_OVS"); |
758 | 760 |
mac = nic->vector_value("MAC"); |
759 |
target = nic->vector_value("TARGET");
|
|
761 |
target = target_str.str();
|
|
760 | 762 |
script = nic->vector_value("SCRIPT"); |
761 | 763 |
model = nic->vector_value("MODEL"); |
762 | 764 |
ip = nic->vector_value("IP"); |
opennebula-4.12.1-uniquenic/src/vmm_mad/exec/one_vmm_exec.rb 2015-11-25 23:48:58.372777228 -0600 | ||
---|---|---|
792 | 792 |
begin |
793 | 793 |
source = xml_data.elements["VM/TEMPLATE/NIC[ATTACH='YES']/BRIDGE"] |
794 | 794 |
mac = xml_data.elements["VM/TEMPLATE/NIC[ATTACH='YES']/MAC"] |
795 |
nic_id = xml_data.elements["VM/TEMPLATE/NIC[ATTACH='YES']/NIC_ID"] |
|
795 | 796 | |
796 | 797 |
source = source.text.strip |
797 | 798 |
mac = mac.text.strip |
799 |
nic_id = nic_id.text.strip |
|
798 | 800 |
rescue |
799 | 801 |
send_message(action, RESULT[:failure], id, |
800 | 802 |
"Error in #{ACTION[:attach_nic]}, BRIDGE and MAC needed in NIC") |
... | ... | |
826 | 828 |
{ |
827 | 829 |
:driver => :vmm, |
828 | 830 |
:action => :attach_nic, |
829 |
:parameters => [:deploy_id, mac, source, model, net_drv] |
|
831 |
:parameters => [:deploy_id, mac, source, model, net_drv, nic_id]
|
|
830 | 832 |
}, |
831 | 833 |
# Execute post-boot networking setup |
832 | 834 |
{ |
opennebula-4.12.1-uniquenic/src/vmm_mad/remotes/kvm/attach_nic 2015-11-25 12:42:09.648335092 -0600 | ||
---|---|---|
24 | 24 |
BRIDGE=$3 |
25 | 25 |
THE_MODEL=$4 |
26 | 26 |
NET_DRV=$5 |
27 |
NIC_ID="$6" |
|
27 | 28 | |
28 | 29 |
if [ "$THE_MODEL" != "-" ]; then |
29 | 30 |
MODEL="<model type='$THE_MODEL'/>" |
... | ... | |
37 | 38 |
<interface type='bridge'> |
38 | 39 |
<source bridge='$BRIDGE'/> |
39 | 40 |
<mac address='$MAC'/> |
41 |
<target dev='${DOMAIN}-${NIC_ID}'/> |
|
40 | 42 |
$MODEL |
41 | 43 |
$VIRTUALPORT |
42 | 44 |
</interface> |