Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 417781757D for ; Fri, 18 Sep 2015 21:20:55 +0000 (UTC) Received: (qmail 67377 invoked by uid 500); 18 Sep 2015 21:20:54 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 67324 invoked by uid 500); 18 Sep 2015 21:20:54 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 67311 invoked by uid 99); 18 Sep 2015 21:20:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Sep 2015 21:20:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2268AE0664; Fri, 18 Sep 2015 21:20:54 +0000 (UTC) From: jburwell To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin... Content-Type: text/plain Message-Id: <20150918212054.2268AE0664@git1-us-west.apache.org> Date: Fri, 18 Sep 2015 21:20:54 +0000 (UTC) Github user jburwell commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r39902362 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java --- @@ -255,43 +319,22 @@ protected boolean canHandle(NetworkOffering offering, final NetworkType networkT } @Override - public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { - long networkId = nic.getNetworkId(); - Network network = _networkDao.findById(networkId); - s_logger.debug("Handling release() call back, which is called when a VM is stopped or destroyed, to delete the VM with state " + vm.getVirtualMachine().getState() - + " from netork " + network.getName()); - if (vm.getVirtualMachine().getState().equals(VirtualMachine.State.Stopping)) { - try { - HostVO nuageVspHost = getNuageVspHost(network.getPhysicalNetworkId()); - ReleaseVmVspCommand cmd = new ReleaseVmVspCommand(network.getUuid(), vm.getUuid(), vm.getInstanceName()); - ReleaseVmVspAnswer answer = (ReleaseVmVspAnswer)_agentMgr.easySend(nuageVspHost.getId(), cmd); - if (answer == null || !answer.getResult()) { - s_logger.error("ReleaseVmNuageVspCommand for VM " + vm.getUuid() + " failed"); - if ((null != answer) && (null != answer.getDetails())) { - s_logger.error(answer.getDetails()); - } - } - } catch (InsufficientVirtualNetworkCapacityException e) { - s_logger.debug("Handling release() call back. Failed to delete CS VM " + vm.getInstanceName() + " in VSP. " + e.getMessage()); - } - } else { - s_logger.debug("Handling release() call back. VM " + vm.getInstanceName() + " is in " + vm.getVirtualMachine().getState() + " state. So, the CS VM is not deleted." - + " This could be a case where VM interface is deleted. deallocate() call back should be called later"); - } - - return super.release(nic, vm, reservationId); - } - - @Override @DB public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) { + boolean lockedNetwork = lockNetworkForUserVm(network, vm); + if (lockedNetwork) { + s_logger.debug("Locked network " + network.getId() + " for deallocation of user VM " + vm.getInstanceName()); --- 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. ---