cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jburwell <...@git.apache.org>
Subject [GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...
Date Fri, 18 Sep 2015 21:14:50 GMT
Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/801#discussion_r39901764
  
    --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
---
    @@ -201,51 +234,82 @@ public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfil
         @Override
         public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination
dest, ReservationContext context)
                 throws InsufficientVirtualNetworkCapacityException, InsufficientAddressCapacityException
{
    -        nic.setBroadcastUri(network.getBroadcastUri());
    -        nic.setIsolationUri(network.getBroadcastUri());
    -
    -        s_logger.debug("Handling reserve() call back to with Create a new VM or add an
interface to existing VM in network " + network.getName());
    -        DataCenter dc = _dcDao.findById(network.getDataCenterId());
    -        Account networksAccount = _accountDao.findById(network.getAccountId());
    -        DomainVO networksDomain = _domainDao.findById(network.getDomainId());
    -        //Get the Account details and find the type
    -        long networkOwnedBy = network.getAccountId();
    -        AccountVO neworkAccountDetails = _accountDao.findById(networkOwnedBy);
    -        if (neworkAccountDetails.getType() == Account.ACCOUNT_TYPE_PROJECT) {
    -            throw new InsufficientVirtualNetworkCapacityException("CS project support
is " + "not yet implemented in NuageVsp", DataCenter.class, dc.getId());
    +        boolean lockedNetwork = lockNetworkForUserVm(network, vm);
    +        if (lockedNetwork) {
    +            s_logger.debug("Locked network " + network.getId() + " for creation of user
VM " + vm.getInstanceName());
             }
     
    -        //NicProfile does not contain the NIC UUID. We need this information to set it
in the VMInterface and VPort
    -        //that we create in VSP
    -        NicVO nicFrmDB = _nicDao.findById(nic.getId());
    -        long networkOfferingId = _ntwkOfferingDao.findById(network.getNetworkOfferingId()).getId();
    -        boolean isL3Network = isL3Network(networkOfferingId);
    -        Long vpcId = network.getVpcId();
    -        String vpcUuid = null;
    -        if (vpcId != null) {
    -            Vpc vpcObj = _vpcDao.findById(vpcId);
    -            vpcUuid = vpcObj.getUuid();
    -        }
    -        HostVO nuageVspHost = getNuageVspHost(network.getPhysicalNetworkId());
    -        ReserveVmInterfaceVspCommand cmd = new ReserveVmInterfaceVspCommand(nicFrmDB.getUuid(),
nic.getMacAddress(), network.getUuid(), isL3Network, vpcUuid,
    -                networksDomain.getUuid(), networksAccount.getUuid(), vm.getType().equals(VirtualMachine.Type.DomainRouter),
network.getBroadcastUri().getPath().substring(1),
    -                vm.getInstanceName(), vm.getUuid(), networksDomain.getUuid(), networksAccount.getUuid());
    -        ReserveVmInterfaceVspAnswer answer = (ReserveVmInterfaceVspAnswer)_agentMgr.easySend(nuageVspHost.getId(),
cmd);
    -
    -        if (answer == null || !answer.getResult()) {
    -            s_logger.error("ReserveVmInterfaceNuageVspCommand failed");
    -            if ((null != answer) && (null != answer.getDetails())) {
    -                s_logger.error(answer.getDetails());
    +        try {
    +            nic.setBroadcastUri(network.getBroadcastUri());
    +            nic.setIsolationUri(network.getBroadcastUri());
    +
    +            s_logger.debug("Handling reserve() call back to with Create a new VM or add
an interface to existing VM in network " + network.getName());
    --- End diff --
    
    Wrap in a if (s_logger.isDebugEnabled()) { ... } block to avoid unnecessary pressure on
the string pool when debug logging is not enabled.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message