diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
index 90a578d..7d30c87 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
@@ -466,7 +466,7 @@
         resourcesClient.createIfNotExists(uri, Optional.of(pInterface));
     }
 
-    private void updateLInterfaceVlan(final Port port, final LInterface lIf, final String hostName)
+    protected void updateLInterfaceVlan(final Port port, final LInterface lIf, final String hostName)
             throws HeatBridgeException {
         // add back all vlan logic
         Vlan vlan = new Vlan();
@@ -486,11 +486,13 @@
                             Optional.of(vlan));
         }
 
-        if (nodeType == NodeType.GREENFIELD) {
-            validatePhysicalNetwork(port, network);
-            processOVS(lIf, hostName, NodeType.GREENFIELD.getInterfaceName());
-        } else {
-            processOVS(lIf, hostName, NodeType.BROWNFIELD.getInterfaceName());
+        if (!lIf.getInterfaceType().equals(SRIOV)) {
+            if (nodeType == NodeType.GREENFIELD) {
+                validatePhysicalNetwork(port, network);
+                processOVS(lIf, hostName, NodeType.GREENFIELD.getInterfaceName());
+            } else {
+                processOVS(lIf, hostName, NodeType.BROWNFIELD.getInterfaceName());
+            }
         }
 
         List<String> privateVlans = (ArrayList<String>) port.getProfile().get(PRIVATE_VLANS);
@@ -597,33 +599,29 @@
                 lIf.setInterfaceDescription(
                         "Attached to SR-IOV port: " + pserverHostName + "::" + matchingPifName.get());
                 try {
-                    Optional<PInterface> matchingPIf = resourcesClient.get(PInterface.class,
+                    AAIResourceUri pInterfaceUri =
                             AAIUriFactory
                                     .createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
                                             .pserver(pserverHostName).pInterface(matchingPifName.get()))
-                                    .depth(Depth.ONE));
-                    if (matchingPIf.isPresent()) {
-                        SriovPfs pIfSriovPfs = matchingPIf.get().getSriovPfs();
-                        if (pIfSriovPfs == null) {
-                            pIfSriovPfs = new SriovPfs();
-                        }
-                        // Extract PCI-ID from OS port object
+                                    .depth(Depth.ONE);
+                    if (resourcesClient.exists(pInterfaceUri)) {
+                        PInterface matchingPIf = resourcesClient.get(PInterface.class, pInterfaceUri).get();
+
                         String pfPciId = port.getProfile().get(HeatBridgeConstants.OS_PCI_SLOT_KEY).toString();
 
-                        List<SriovPf> existingSriovPfs = pIfSriovPfs.getSriovPf();
-                        if (CollectionUtils.isEmpty(existingSriovPfs) || existingSriovPfs.stream()
-                                .noneMatch(existingSriovPf -> existingSriovPf.getPfPciId().equals(pfPciId))) {
-                            // Add sriov-pf object with PCI-ID to AAI
+                        if (matchingPIf.getSriovPfs() == null
+                                || CollectionUtils.isEmpty(matchingPIf.getSriovPfs().getSriovPf())
+                                || matchingPIf.getSriovPfs().getSriovPf().stream()
+                                        .noneMatch(existingSriovPf -> existingSriovPf.getPfPciId().equals(pfPciId))) {
+
                             SriovPf sriovPf = new SriovPf();
                             sriovPf.setPfPciId(pfPciId);
-                            logger.debug("Queuing AAI command to update sriov-pf object to pserver: " + pserverHostName
-                                    + "/" + matchingPifName.get());
 
                             AAIResourceUri sriovPfUri = AAIUriFactory.createResourceUri(
                                     AAIFluentTypeBuilder.cloudInfrastructure().pserver(pserverHostName)
                                             .pInterface(matchingPifName.get()).sriovPf(sriovPf.getPfPciId()));
 
-
+                            // TODO if it does exist, should check if relationship is there, if not then create?
                             if (!resourcesClient.exists(sriovPfUri)) {
                                 transaction.create(sriovPfUri, sriovPf);
 
@@ -634,6 +632,10 @@
                                 transaction.connect(sriovPfUri, sriovVfUri);
                             }
                         }
+                    } else {
+                        logger.warn(
+                                "PInterface {} does not exist in AAI. Unable to build sriov-vf to sriov-pf relationship.",
+                                matchingPifName.get());
                     }
                 } catch (WebApplicationException e) {
                     // Silently log that we failed to update the Pserver p-interface with PCI-ID
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/utils/HeatBridgeUtils.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/utils/HeatBridgeUtils.java
index 1667f98..c281dbd 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/utils/HeatBridgeUtils.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/utils/HeatBridgeUtils.java
@@ -59,7 +59,7 @@
 
     public static Optional<String> getMatchingPserverPifName(@Nonnull final String physicalNetworkName) {
         Preconditions.checkState(!Strings.isNullOrEmpty(physicalNetworkName),
-                "Physical network name is null or " + "empty!");
+                "Physical network name is null or empty!");
         if (physicalNetworkName.contains(OS_SIDE_DEDICATED_SRIOV_PREFIX)) {
             return Optional.of(
                     physicalNetworkName.replace(OS_SIDE_DEDICATED_SRIOV_PREFIX, COMPUTE_SIDE_DEDICATED_SRIOV_PREFIX));
@@ -67,7 +67,7 @@
             return Optional
                     .of(physicalNetworkName.replace(OS_SIDE_SHARED_SRIOV_PREFIX, COMPUTE_SIDE_SHARED_SRIOV_PREFIX));
         }
-        return Optional.empty();
+        return Optional.of(physicalNetworkName);
     }
 
     public static List<String> extractPciIdsFromVServer(Vserver vserver) {
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
index 110faaf..a9c3112 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
@@ -41,6 +41,7 @@
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
@@ -65,6 +66,7 @@
 import org.mockito.ArgumentCaptor;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
+import org.mockito.Spy;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.onap.aai.domain.yang.L3InterfaceIpv6AddressList;
 import org.onap.aai.domain.yang.LInterface;
@@ -131,6 +133,7 @@
     @Mock
     private Server server;
 
+    @Spy
     @InjectMocks
     private HeatBridgeImpl heatbridge = new HeatBridgeImpl(resourcesClient, cloudIdentity, CLOUD_OWNER, REGION_ID,
             REGION_ID, TENANT_ID, NodeType.GREENFIELD);
@@ -463,6 +466,63 @@
     }
 
     @Test
+    public void testUpdateLInterfaceVlan() throws HeatBridgeException {
+        // Arrange
+        List<Resource> stackResources = (List<Resource>) extractTestStackResources();
+        Port port = mock(Port.class);
+        when(port.getId()).thenReturn("test-port-id");
+        when(port.getName()).thenReturn("test-port-name");
+        when(port.getvNicType()).thenReturn(HeatBridgeConstants.OS_SRIOV_PORT_TYPE);
+        when(port.getMacAddress()).thenReturn("78:4f:43:68:e2:78");
+        when(port.getNetworkId()).thenReturn("890a203a-23gg-56jh-df67-731656a8f13a");
+        when(port.getDeviceId()).thenReturn("test-device-id");
+
+        LInterface lIf = new LInterface();
+        lIf.setInterfaceId("test-port-id");
+        lIf.setInterfaceType("SRIOV");
+        lIf.setInterfaceName("name");
+
+        String pfPciId = "0000:08:00.0";
+        when(port.getProfile()).thenReturn(ImmutableMap.of(HeatBridgeConstants.OS_PCI_SLOT_KEY, pfPciId,
+                HeatBridgeConstants.OS_PHYSICAL_NETWORK_KEY, "physical_network_id"));
+
+        IP ip = mock(IP.class);
+
+        Set<IP> ipSet = new HashSet<>();
+        ipSet.add(ip);
+        when(ip.getIpAddress()).thenReturn("2606:ae00:2e60:100::226");
+        when(ip.getSubnetId()).thenReturn("testSubnetId");
+        when(port.getFixedIps()).thenAnswer(x -> ipSet);
+
+        Subnet subnet = mock(Subnet.class);
+        when(subnet.getCidr()).thenReturn("169.254.100.0/24");
+        when(osClient.getSubnetById("testSubnetId")).thenReturn(subnet);
+
+        Network network = mock(Network.class);
+        when(network.getId()).thenReturn("test-network-id");
+        when(network.getNetworkType()).thenReturn(NetworkType.VLAN);
+        when(network.getProviderSegID()).thenReturn("2345");
+        when(network.getProviderPhyNet()).thenReturn("ovsnet");
+        doNothing().when(heatbridge).processOVS(any(), any(), any());
+
+        when(osClient.getNetworkById(anyString())).thenReturn(network);
+
+        SriovPf sriovPf = new SriovPf();
+        sriovPf.setPfPciId(pfPciId);
+        PInterface pIf = mock(PInterface.class);
+        when(pIf.getInterfaceName()).thenReturn("test-port-id");
+        when(resourcesClient.get(eq(PInterface.class), any(AAIResourceUri.class))).thenReturn(Optional.of(pIf));
+
+        // Act
+        heatbridge.updateLInterfaceVlan(port, lIf, "hostname");
+
+        // Assert
+        verify(transaction, times(2)).createIfNotExists(any(AAIResourceUri.class), any(Optional.class));
+        verify(osClient, times(1)).getNetworkById(anyString());
+        verify(heatbridge, times(0)).processOVS(any(), any(), any());
+    }
+
+    @Test
     public void testUpdateLInterfaceIps()
             throws HeatBridgeException, JsonParseException, JsonMappingException, IOException {
 
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/utils/HeatBridgeUtilsTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/utils/HeatBridgeUtilsTest.java
index bbc99bd..13a8cb2 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/utils/HeatBridgeUtilsTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/utils/HeatBridgeUtilsTest.java
@@ -26,6 +26,6 @@
     @Test
     public void matchServerName_unknown() {
         Optional<String> serverName = HeatBridgeUtils.getMatchingPserverPifName("differentServerName");
-        assertThat(serverName).isEmpty();
+        assertThat(serverName).isNotEmpty().hasValue("differentServerName");
     }
 }
