Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
deconflict sddc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-jmattson committed Aug 7, 2020
1 parent 26433d5 commit b8080c4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/TopoMojo.Abstractions/Models/VmTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class VmNet
{
public int Id { get; set; }
public string Net { get; set; }
public string Key { get; set; }
public string Type { get; set; }
public string Mac { get; set; }
public string Ip { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/TopoMojo.vSphere/DistributedNetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public override async Task<VmNetwork[]> GetVmNetworks(ManagedObjectReference mor

result.Add(new VmNetwork
{
NetworkMOR = back.port.portgroupKey,
NetworkMOR = $"DistributedVirtualPortgroup|{back.port.portgroupKey}",
VmName = vmName
});
}
Expand Down Expand Up @@ -169,7 +169,7 @@ public override void UpdateEthernetCardBacking(VirtualEthernetCard card, string
port = new DistributedVirtualSwitchPortConnection
{
switchUuid = _client.DvsUuid,
portgroupKey = netMorName
portgroupKey = netMorName.AsReference().Value
}
};
}
Expand Down
3 changes: 2 additions & 1 deletion src/TopoMojo.vSphere/HypervisorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ public async Task<Vm> Load(string id)

Vm vm = _vmCache.Values.Where(o=>o.Id == id || o.Name == id).FirstOrDefault();

CheckProgress(vm);
if (vm != null)
CheckProgress(vm);

return vm;
}
Expand Down
2 changes: 1 addition & 1 deletion src/TopoMojo.vSphere/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public async Task Provision(VmTemplate template)
_pgAllocation[eth.Net].Counter += 1;
}

eth.Net = _pgAllocation[eth.Net].Key;
eth.Key = _pgAllocation[eth.Net].Key;
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/TopoMojo.vSphere/VimTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ private static VirtualDeviceConfigSpec GetEthernetAdapter(ref int key, VmNet nic
if (nic.Net.StartsWith("nsx."))
{
eth.backing = new VirtualEthernetCardOpaqueNetworkBackingInfo {
opaqueNetworkId = nic.Net.Tag(),
opaqueNetworkType = nic.Net.Untagged()
opaqueNetworkId = nic.Key.Tag(),
opaqueNetworkType = nic.Key.Untagged()
};
}
else if (dvsuuid.HasValue())
Expand All @@ -139,13 +139,13 @@ private static VirtualDeviceConfigSpec GetEthernetAdapter(ref int key, VmNet nic
port = new DistributedVirtualSwitchPortConnection
{
switchUuid = dvsuuid,
portgroupKey = nic.Net
portgroupKey = nic.Key.AsReference().Value
}
};
}
else
{
eth.backing = new VirtualEthernetCardNetworkBackingInfo { deviceName = nic.Net };
eth.backing = new VirtualEthernetCardNetworkBackingInfo { deviceName = nic.Key };
}

devicespec = new VirtualDeviceConfigSpec();
Expand Down

0 comments on commit b8080c4

Please sign in to comment.