port.getPort().setTenantId(cmd.getTenantUuid());
try {
_bigswitchVnsApi.createPort(cmd.getNetworkUuid(), port);
try {
AttachmentData attachment = new AttachmentData();
attachment.getAttachment().setId(cmd.getPortUuid());
attachment.getAttachment().setMac(cmd.getMac());
_bigswitchVnsApi.modifyPortAttachment(cmd.getTenantUuid(), cmd.getNetworkUuid(), cmd.getPortUuid(), attachment);
} catch (BigSwitchVnsApiException ex) {
s_logger.warn("modifyPortAttachment failed after switchport was created, removing switchport");
_bigswitchVnsApi.deletePort(cmd.getTenantUuid(), cmd.getNetworkUuid(), cmd.getPortUuid());