Revision d357afee
src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb | ||
---|---|---|
583 | 583 |
# Returns an array of actions to be included in :deviceChange |
584 | 584 |
def calculate_add_nic_spec(nic) |
585 | 585 |
|
586 |
#TODO include VCENTER_NET_REF usage it should be in one_item
|
|
586 |
#TODO include VCENTER_NET_MODEL usage it should be in one_item
|
|
587 | 587 |
mac = nic["MAC"] |
588 | 588 |
bridge = nic["BRIDGE"] |
589 |
model = nic["MODEL"] |
|
589 |
model = nic["VCENTER_NET_MODEL"]
|
|
590 | 590 |
vnet_ref = nic["VCENTER_NET_REF"] |
591 | 591 |
backing = nil |
592 | 592 |
|
... | ... | |
686 | 686 |
end |
687 | 687 |
|
688 | 688 |
# Add NIC to VM |
689 |
def attach_nic(nic) |
|
690 |
|
|
689 |
def attach_nic |
|
691 | 690 |
spec_hash = {} |
691 |
nic = nil |
|
692 |
|
|
693 |
# Extract nic from driver action |
|
694 |
nic = one_item.retrieve_xmlelements("TEMPLATE/NIC[ATTACH='YES']").first |
|
692 | 695 |
|
693 | 696 |
# A new NIC requires a vcenter spec |
694 | 697 |
attach_nic_array = [] |
... | ... | |
726 | 729 |
end |
727 | 730 |
|
728 | 731 |
# Detach NIC from VM |
729 |
def detach_nic(nic) |
|
730 |
|
|
732 |
def detach_nic |
|
731 | 733 |
spec_hash = {} |
734 |
nic = nil |
|
735 |
|
|
736 |
# Extract nic from driver action |
|
737 |
nic = one_item.retrieve_xmlelements("TEMPLATE/NIC[ATTACH='YES']").first |
|
732 | 738 |
|
733 | 739 |
mac = nic["MAC"] |
734 | 740 |
|
... | ... | |
800 | 806 |
position = 0 |
801 | 807 |
attach_disk_array = [] |
802 | 808 |
disks.each do |disk| |
803 |
attach_disk_array << calculate_add_disk_spec(disk) |
|
809 |
attach_disk_array << calculate_add_disk_spec(disk, position)
|
|
804 | 810 |
position += 1 |
805 | 811 |
end |
806 | 812 |
|
... | ... | |
1093 | 1099 |
|
1094 | 1100 |
used_numbers << dev.scsiCtlrUnitNumber |
1095 | 1101 |
scsi_schema[dev.key][:device] = dev |
1096 |
end |
|
1102 |
end
|
|
1097 | 1103 |
|
1098 | 1104 |
next if dev.class != RbVmomi::VIM::VirtualDisk |
1099 | 1105 |
used_numbers << dev.unitNumber |
Also available in: Unified diff