[GitHub] cloudstack pull request: CLOUDSTACK-8917 : Instance tab takes long...

2015-10-27 Thread karuturi
Github user karuturi commented on the pull request:

https://github.com/apache/cloudstack/pull/894#issuecomment-151394435
  
code LGTM. Its a nice improvement to have. Since remi already ran the 
tests, I am merging this. 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43090521
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -129,6 +145,18 @@
 AgentManager _agentMgr;
 @Inject
 NetworkOfferingDao _ntwkOfferingDao;
+@Inject
+ConfigurationDao _configDao;
+@Inject
+NuageVspManager _nuageVspManager;
+@Inject
+FirewallRulesDao _firewallRulesDao;
+@Inject
+FirewallRulesCidrsDao _firewallRulesCidrsDao;
+@Inject
+PhysicalNetworkDao _physicalNetworkDao;
+@Inject
+NetworkACLItemDao _networkACLItemDao;
 
 @Override
 public boolean applyIps(Network network, List ipAddress, Set service) throws 
ResourceUnavailableException {
--- End diff --

I moved some code here and there, it's shortened now by decomposing into 
smaller private methods.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43091274
  
--- Diff: plugins/network-elements/nuage-vsp/pom.xml ---
@@ -28,6 +28,13 @@
 4.6.0-SNAPSHOT
 ../../pom.xml
   
+  
+
+  org.apache.commons
+  commons-lang3
+  ${cs.lang3.version}
+
+  
--- End diff --

Because our client has no dependencies to CloudStack, we had to find a 
common library between the 2 which has a Pair class. Which is 
commons-lang3


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Service Offering documentation

2015-10-27 Thread Vadim Kimlaychuk

 Dear Ron,

 I suggest you to read this document: 
https://cwiki.apache.org/confluence/display/CLOUDSTACK/GPU+and+vGPU+support+for+CloudStack+Guest+VMs 
[1]. I have tested pass-through mode with XenServer 6.2 and can give 
probably a bit more information if you need. The reference document is 
good indeed, so you probably do not need my comments :)


 Regards,

 Vadim.


On 2015-⁠10-⁠26 22:47, Ron Wheeler wrote:

The GPU section on page 
http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/4.5/service_offerings.html 
[2] [1 [2]] seems to be lacking some information (at least as far as I 
can tell).
1) What does the GPU do? It says to select a card that I want to use. 
No hint about the basis on which I should make the selection or if 
there are any restrictions on the choice (based on hardware?)
2) It mentions support for 2 NVIDIA cards and says that if you want to 
use another card "make the createServiceOffering API call". How is this 
done on a UI screen?
3) The Type selection is worded in an odd way with 3 selections 
explicitly named and a "so on" thrown in. Then it goes on to talk about 
a passthrough vGPU type in a separate paragraph.


Perhaps there should be links to external web sites to clarify the 
definitions of these cards and types.


If someone can explain what this section actually means, I will try to 
write it in a clearer fashion.


Ron

Links:
-⁠-⁠-⁠-⁠-⁠-⁠
[1] 
http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/4.5/service_offerings.html 
[2]




Links:
--
[1] 
https://cwiki.apache.org/confluence/display/CLOUDSTACK/GPU+and+vGPU+support+for+CloudStack+Guest+VMs
[2] 
http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/4.5/service_offerings.html


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093202
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/ReserveVmInterfaceVspCommand.java
 ---
@@ -87,29 +114,285 @@ public boolean isDomainRouter() {
 return _isDomainRouter;
 }
 
-public String _getDomainRouterIp() {
+public String getDomainRouterIp() {
 return _domainRouterIp;
 }
 
-public String _getVmInstanceName() {
+public String getVmInstanceName() {
 return _vmInstanceName;
 }
 
-public String _getVmUuid() {
+public String getVmUuid() {
 return _vmUuid;
 }
 
-public String _getVmUserName() {
+public String getVmUserName() {
 return _vmUserName;
 }
 
-public String _getVmUserDomainName() {
+public String getVmUserDomainName() {
 return _vmUserDomainName;
 }
 
+public boolean useStaticIp() {
+return _useStaticIp;
+}
+
+public String getStaticIp() {
+return _staticIp;
+}
+
+public String getStaticNatIpUuid() {
+return _staticNatIpUuid;
+}
+
+public String getStaticNatIpAddress() {
+return _staticNatIpAddress;
+}
+
+public boolean isStaticNatIpAllocated() {
+return _isStaticNatIpAllocated;
+}
+
+public boolean isOneToOneNat() {
+return _isOneToOneNat;
+}
+
+public String getStaticNatVlanUuid() {
+return _staticNatVlanUuid;
+}
+
+public String getStaticNatVlanGateway() {
+return _staticNatVlanGateway;
+}
+
+public String getStaticNatVlanNetmask() {
+return _staticNatVlanNetmask;
+}
+
+public static class Builder implements 
CmdBuilder {
+private String _nicUuid;
+private String _nicMacAddress;
+private String _networkUuid;
+private boolean _isL3Network;
+private boolean _isSharedNetwork;
+private String _vpcUuid;
+private String _networkDomainUuid;
+private String _networksAccountUuid;
+private boolean _isDomainRouter;
+private String _domainRouterIp;
+private String _vmInstanceName;
+private String _vmUuid;
+private String _vmUserName;
+private String _vmUserDomainName;
+private boolean _useStaticIp;
+private String _staticIp;
+private String _staticNatIpUuid;
+private String _staticNatIpAddress;
+private boolean _isStaticNatIpAllocated;
+private boolean _isOneToOneNat;
+private String _staticNatVlanUuid;
+private String _staticNatVlanGateway;
+private String _staticNatVlanNetmask;
+
+public Builder nicUuid(String nicUuid) {
+this._nicUuid = nicUuid;
+return this;
+}
+
+public Builder nicMacAddress(String nicMacAddress) {
+this._nicMacAddress = nicMacAddress;
+return this;
+}
+
+public Builder networkUuid(String networkUuid) {
+this._networkUuid = networkUuid;
+return this;
+}
+
+public Builder isL3Network(boolean isL3Network) {
+this._isL3Network = isL3Network;
+return this;
+}
+
+public Builder isSharedNetwork(boolean isSharedNetwork) {
+this._isSharedNetwork = isSharedNetwork;
+return this;
+}
+
+public Builder vpcUuid(String vpcUuid) {
+this._vpcUuid = vpcUuid;
+return this;
+}
+
+public Builder networkDomainUuid(String networkDomainUuid) {
+this._networkDomainUuid = networkDomainUuid;
+return this;
+}
+
+public Builder networksAccountUuid(String networksAccountUuid) {
+this._networksAccountUuid = networksAccountUuid;
+return this;
+}
+
+public Builder isDomainRouter(boolean isDomainRouter) {
+this._isDomainRouter = isDomainRouter;
+return this;
+}
+
+public Builder domainRouterIp(String domainRouterIp) {
+this._domainRouterIp = domainRouterIp;
+return this;
+}
+
+public Builder vmInstanceName(String vmInstanceName) {
+this._vmInstanceName = vmInstanceName;
+return this;
+}
+
+public Builder 

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093132
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/DeallocateVmVspCommand.java
 ---
@@ -83,9 +92,130 @@ public String getVmUuid() {
 return _vmUuid;
 }
 
+public boolean isExpungingState() {
+return _isExpungingState;
+}
+
+public static class Builder implements 
CmdBuilder {
+private String _networkUuid;
+private String _nicFromDdUuid;
+private String _nicMacAddress;
+private String _nicIp4Address;
+private boolean _isL3Network;
+private boolean _isSharedNetwork;
+private String _vpcUuid;
+private String _networksDomainUuid;
+private String _vmInstanceName;
+private String _vmUuid;
+private boolean _isExpungingState;
+
+public Builder networkUuid(String networkUuid) {
+this._networkUuid = networkUuid;
+return this;
+}
+
+public Builder nicFromDbUuid(String nicFromDbUuid) {
+this._nicFromDdUuid = nicFromDbUuid;
+return this;
+}
+
+public Builder nicMacAddress(String nicMacAddress) {
+this._nicMacAddress = nicMacAddress;
+return this;
+}
+
+public Builder nicIp4Address(String nicIp4Address) {
+this._nicIp4Address = nicIp4Address;
+return this;
+}
+
+public Builder isL3Network(boolean isL3Network) {
+this._isL3Network = isL3Network;
+return this;
+}
+
+public Builder isSharedNetwork(boolean isSharedNetwork) {
+this._isSharedNetwork = isSharedNetwork;
+return this;
+}
+
+public Builder vpcUuid(String vpcUuid) {
+this._vpcUuid = vpcUuid;
+return this;
+}
+
+public Builder networksDomainUuid(String networksDomainUuid) {
+this._networksDomainUuid = networksDomainUuid;
+return this;
+}
+
+public Builder vmInstanceName(String vmInstanceName) {
+this._vmInstanceName = vmInstanceName;
+return this;
+}
+
+public Builder vmUuid(String vmUuid) {
+this._vmUuid = vmUuid;
+return this;
+}
+
+public Builder isExpungingState(boolean isExpungingState) {
+this._isExpungingState = isExpungingState;
+return this;
+}
+
+@Override
+public DeallocateVmVspCommand build() {
+return new DeallocateVmVspCommand(_networkUuid,_nicFromDdUuid, 
_nicMacAddress, _nicIp4Address, _isL3Network, _isSharedNetwork, _vpcUuid,
+_networksDomainUuid, _vmInstanceName, _vmUuid, 
_isExpungingState);
+}
+}
+
 @Override
 public boolean executeInSequence() {
 return false;
 }
 
+@Override
+public boolean equals(Object o) {
--- End diff --

Implemented equals method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093227
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/TrashNetworkVspCommand.java
 ---
@@ -48,13 +53,93 @@ public boolean isL3Network() {
 return _isL3Network;
 }
 
+public boolean isSharedNetwork() {
+return _isSharedNetwork;
+}
+
 public String getVpcUuid() {
 return _vpcUuid;
 }
 
+public String getDomainTemplateName() {
+return _domainTemplateName;
+}
+
+public static class Builder implements 
CmdBuilder {
+private String _domainUuid;
+private String _networkUuid;
+private boolean _isL3Network;
+private boolean _isSharedNetwork;
+private String _vpcUuid;
+private String _domainTemplateName;
+
+public Builder domainUuid(String domainUuid) {
+this._domainUuid = domainUuid;
+return this;
+}
+
+public Builder networkUuid(String networkUuid) {
+this._networkUuid = networkUuid;
+return this;
+}
+
+public Builder isL3Network(boolean isL3Network) {
+this._isL3Network = isL3Network;
+return this;
+}
+
+public Builder isSharedNetwork(boolean isSharedNetwork) {
+this._isSharedNetwork = isSharedNetwork;
+return this;
+}
+
+public Builder vpcUuid(String vpcUuid) {
+this._vpcUuid = vpcUuid;
+return this;
+}
+
+public Builder domainTemplateName(String domainTemplateName) {
+this._domainTemplateName = domainTemplateName;
+return this;
+}
+
+@Override
+public TrashNetworkVspCommand build() {
+return new TrashNetworkVspCommand(_domainUuid, _networkUuid, 
_isL3Network, _isSharedNetwork, _vpcUuid, _domainTemplateName);
+}
+}
+
 @Override
 public boolean executeInSequence() {
 return false;
 }
 
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+TrashNetworkVspCommand that = (TrashNetworkVspCommand) o;
+
+if (_isL3Network != that._isL3Network) return false;
+if (_isSharedNetwork != that._isSharedNetwork) return false;
+if (_domainTemplateName != null ? 
!_domainTemplateName.equals(that._domainTemplateName) : 
that._domainTemplateName != null)
+return false;
+if (_domainUuid != null ? !_domainUuid.equals(that._domainUuid) : 
that._domainUuid != null) return false;
+if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) 
: that._networkUuid != null) return false;
+if (_vpcUuid != null ? !_vpcUuid.equals(that._vpcUuid) : 
that._vpcUuid != null) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
--- End diff --

Implemented hashCode method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093875
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -303,13 +414,17 @@ protected boolean canHandle(Network network, Service 
service) {
 }
 
 if (!_networkModel.isProviderForNetwork(getProvider(), 
network.getId())) {
-s_logger.debug("NuageElement is not a provider for network " + 
network.getDisplayText());
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("NuageVsp is not a provider for network " + 
network.getDisplayText());
--- End diff --

This code is just checking whether NuageVsp is included as provider for the 
given network, no need for specific information about the Nuage VSP.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Mentor

2015-10-27 Thread Erik Weber
On Tue, Oct 27, 2015 at 7:57 AM, B Prakash  wrote:

> Hi, I am an experience Java EE professional (new to cloudstack though).
>
>
>I am interested in contributing to the development.  As suggested
> in the newcomer section, I have been following the jira and the dev emails
> for a few days now, but I haven't been successful in identifying an
> opportunity to start.  Please can someone help me identify/share a newcomer
> task/feature to implement?  A good starting point perhaps.
>
>
Of you're looking for ideas of what you could do, I would really appreciate
root disk resize support for XenServer :-)


It was partially completed a long time ago (it might still exist on our old
reviewboard somewhere), but never commited to master.


-- 
Erik


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43091431
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -67,25 +74,76 @@
 import com.cloud.network.dao.PhysicalNetworkVO;
 import com.cloud.network.resource.NuageVspResource;
 import com.cloud.network.sync.NuageVspSync;
+import com.cloud.network.vpc.VpcManager;
+import com.cloud.network.vpc.VpcOffering;
+import com.cloud.network.vpc.VpcOfferingServiceMapVO;
+import com.cloud.network.vpc.VpcOfferingVO;
 import com.cloud.network.vpc.dao.VpcDao;
 import com.cloud.network.vpc.dao.VpcOfferingDao;
 import com.cloud.network.vpc.dao.VpcOfferingServiceMapDao;
+import com.cloud.network.vpc.dao.VpcServiceMapDao;
+import com.cloud.offering.NetworkOffering;
+import com.cloud.offerings.NetworkOfferingServiceMapVO;
+import com.cloud.offerings.NetworkOfferingVO;
+import com.cloud.offerings.dao.NetworkOfferingDao;
+import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
 import com.cloud.resource.ResourceManager;
 import com.cloud.resource.ResourceState;
 import com.cloud.resource.ServerResource;
+import com.cloud.user.AccountManager;
+import com.cloud.user.DomainManager;
 import com.cloud.utils.component.ManagerBase;
+import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.db.TransactionCallback;
+import com.cloud.utils.db.TransactionCallbackNoReturn;
 import com.cloud.utils.db.TransactionStatus;
 import com.cloud.utils.exception.CloudRuntimeException;
+import com.cloud.utils.fsm.StateListener;
+import com.cloud.utils.fsm.StateMachine2;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Strings;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import net.nuage.vsp.acs.NuageVspPluginClientLoader;
+import org.apache.cloudstack.framework.config.ConfigKey;
+import org.apache.cloudstack.framework.config.Configurable;
+import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.cloudstack.framework.config.impl.ConfigurationVO;
+import org.apache.cloudstack.framework.messagebus.MessageBus;
+import org.apache.cloudstack.framework.messagebus.MessageSubscriber;
+import org.apache.cloudstack.network.ExternalNetworkDeviceManager;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.log4j.Logger;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.UUID;
+import java.util.concurrent.ScheduledExecutorService;
+
+import static com.cloud.agent.api.sync.SyncNuageVspCmsIdCommand.SyncType;
 
 @Local(value = {NuageVspManager.class})
-public class NuageVspManagerImpl extends ManagerBase implements 
NuageVspManager, Configurable {
+public class NuageVspManagerImpl extends ManagerBase implements 
NuageVspManager, Configurable, StateListener {
 
 private static final Logger s_logger = 
Logger.getLogger(NuageVspManagerImpl.class);
 
 private static final int ONE_MINUTE_MULTIPLIER = 60 * 1000;
 
+private static final Set NUAGE_VSP_PROVIDERS;
+private static final Map 
NUAGE_VSP_VPC_SERVICE_MAP;
+private static final ConfigKey[] NUAGE_VSP_CONFIG_KEYS = new 
ConfigKey[] { NuageVspConfigDns, NuageVspDnsExternal, NuageVspConfigGateway,
--- End diff --

Returning a copy of the array instead of the array itself now.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43091944
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/PingNuageVspCommand.java
 ---
@@ -17,18 +17,37 @@
 // under the License.
 //
 
-package com.cloud.agent.api.element;
+package com.cloud.agent.api;
 
-import com.cloud.agent.api.Answer;
+import com.cloud.host.Host;
 
-public class ShutDownVpcVspAnswer extends Answer {
+public class PingNuageVspCommand extends PingCommand {
 
-public ShutDownVpcVspAnswer(ShutDownVpcVspCommand cmd, boolean 
success, String details) {
-super(cmd, success, details);
+private final boolean shouldAudit;
+
+public PingNuageVspCommand(Host.Type type, long id, boolean 
shouldAudit) {
+super(type, id);
+this.shouldAudit = shouldAudit;
 }
 
-public ShutDownVpcVspAnswer(ShutDownVpcVspCommand cmd, Exception e) {
-super(cmd, e);
+public boolean shouldAudit() {
+return shouldAudit;
 }
 
+@Override
+public boolean equals(Object o) {
--- End diff --

Added attributes from the PingCommand super class.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43091957
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/PingNuageVspCommand.java
 ---
@@ -17,18 +17,37 @@
 // under the License.
 //
 
-package com.cloud.agent.api.element;
+package com.cloud.agent.api;
 
-import com.cloud.agent.api.Answer;
+import com.cloud.host.Host;
 
-public class ShutDownVpcVspAnswer extends Answer {
+public class PingNuageVspCommand extends PingCommand {
 
-public ShutDownVpcVspAnswer(ShutDownVpcVspCommand cmd, boolean 
success, String details) {
-super(cmd, success, details);
+private final boolean shouldAudit;
+
+public PingNuageVspCommand(Host.Type type, long id, boolean 
shouldAudit) {
+super(type, id);
+this.shouldAudit = shouldAudit;
 }
 
-public ShutDownVpcVspAnswer(ShutDownVpcVspCommand cmd, Exception e) {
-super(cmd, e);
+public boolean shouldAudit() {
+return shouldAudit;
 }
 
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+PingNuageVspCommand that = (PingNuageVspCommand) o;
+
+if (shouldAudit != that.shouldAudit) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
--- End diff --

Added attributes from the PingCommand super class.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43092995
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ApplyAclRuleVspCommand.java
 ---
@@ -79,4 +191,47 @@ public boolean executeInSequence() {
 return false;
 }
 
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+ApplyAclRuleVspCommand that = (ApplyAclRuleVspCommand) o;
+
+if (_egressDefaultPolicy != that._egressDefaultPolicy) return 
false;
+if (_isL2Network != that._isL2Network) return false;
+if (_networkAcl != that._networkAcl) return false;
+if (_networkId != that._networkId) return false;
+if (_networkReset != that._networkReset) return false;
+if (_aclRules != null ? !_aclRules.equals(that._aclRules) : 
that._aclRules != null) return false;
+if (_acsIngressAcl != null ? 
!_acsIngressAcl.equals(that._acsIngressAcl) : that._acsIngressAcl != null)
+return false;
+if (_domainTemplateName != null ? 
!_domainTemplateName.equals(that._domainTemplateName) : 
that._domainTemplateName != null)
+return false;
+if (_networkDomainUuid != null ? 
!_networkDomainUuid.equals(that._networkDomainUuid) : that._networkDomainUuid 
!= null)
+return false;
+if (_networkName != null ? !_networkName.equals(that._networkName) 
: that._networkName != null) return false;
+if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) 
: that._networkUuid != null) return false;
+if (_vpcOrSubnetUuid != null ? 
!_vpcOrSubnetUuid.equals(that._vpcOrSubnetUuid) : that._vpcOrSubnetUuid != null)
+return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
--- End diff --

Implemented hashCode method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093020
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ApplyStaticNatVspCommand.java
 ---
@@ -51,13 +61,91 @@ public boolean isL3Network() {
 return _isL3Network;
 }
 
+public boolean isVpc() {
+return _isVpc;
+}
+
 public List> getStaticNatDetails() {
 return _staticNatDetails;
 }
 
+public static class Builder implements 
CmdBuilder {
+private String _networkDomainUuid;
+private String _networkUuid;
+private String _vpcOrSubnetUuid;
+private boolean _isL3Network;
+private boolean _isVpc;
+private List> _staticNatDetails;
+
+public Builder networkDomainUuid(String networkDomainUuid) {
+this._networkDomainUuid = networkDomainUuid;
+return this;
+}
+
+public Builder networkUuid(String networkUuid) {
+this._networkUuid = networkUuid;
+return this;
+}
+
+public Builder vpcOrSubnetUuid(String vpcOrSubnetUuid) {
+this._vpcOrSubnetUuid = vpcOrSubnetUuid;
+return this;
+}
+
+public Builder isL3Network(boolean isL3Network) {
+this._isL3Network = isL3Network;
+return this;
+}
+
+public Builder isVpc(boolean isVpc) {
+this._isVpc = isVpc;
+return this;
+}
+
+public Builder staticNatDetails(List> 
staticNatDetails) {
+this._staticNatDetails = staticNatDetails;
+return this;
+}
+
+@Override
+public ApplyStaticNatVspCommand build() {
+return new ApplyStaticNatVspCommand(_networkDomainUuid, 
_networkUuid, _vpcOrSubnetUuid, _isL3Network, _isVpc, _staticNatDetails);
+}
+}
+
 @Override
 public boolean executeInSequence() {
 return false;
 }
 
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+ApplyStaticNatVspCommand that = (ApplyStaticNatVspCommand) o;
+
+if (_isL3Network != that._isL3Network) return false;
+if (_isVpc != that._isVpc) return false;
+if (_networkDomainUuid != null ? 
!_networkDomainUuid.equals(that._networkDomainUuid) : that._networkDomainUuid 
!= null)
+return false;
+if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) 
: that._networkUuid != null) return false;
+if (_staticNatDetails != null ? 
!_staticNatDetails.equals(that._staticNatDetails) : that._staticNatDetails != 
null)
+return false;
+if (_vpcOrSubnetUuid != null ? 
!_vpcOrSubnetUuid.equals(that._vpcOrSubnetUuid) : that._vpcOrSubnetUuid != null)
+return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
--- End diff --

Implemented hashCode method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43092964
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ApplyAclRuleVspCommand.java
 ---
@@ -79,4 +191,47 @@ public boolean executeInSequence() {
 return false;
 }
 
+@Override
+public boolean equals(Object o) {
--- End diff --

Implemented equals method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093192
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/ReserveVmInterfaceVspCommand.java
 ---
@@ -87,29 +114,285 @@ public boolean isDomainRouter() {
 return _isDomainRouter;
 }
 
-public String _getDomainRouterIp() {
+public String getDomainRouterIp() {
 return _domainRouterIp;
 }
 
-public String _getVmInstanceName() {
+public String getVmInstanceName() {
 return _vmInstanceName;
 }
 
-public String _getVmUuid() {
+public String getVmUuid() {
 return _vmUuid;
 }
 
-public String _getVmUserName() {
+public String getVmUserName() {
 return _vmUserName;
 }
 
-public String _getVmUserDomainName() {
+public String getVmUserDomainName() {
 return _vmUserDomainName;
 }
 
+public boolean useStaticIp() {
+return _useStaticIp;
+}
+
+public String getStaticIp() {
+return _staticIp;
+}
+
+public String getStaticNatIpUuid() {
+return _staticNatIpUuid;
+}
+
+public String getStaticNatIpAddress() {
+return _staticNatIpAddress;
+}
+
+public boolean isStaticNatIpAllocated() {
+return _isStaticNatIpAllocated;
+}
+
+public boolean isOneToOneNat() {
+return _isOneToOneNat;
+}
+
+public String getStaticNatVlanUuid() {
+return _staticNatVlanUuid;
+}
+
+public String getStaticNatVlanGateway() {
+return _staticNatVlanGateway;
+}
+
+public String getStaticNatVlanNetmask() {
+return _staticNatVlanNetmask;
+}
+
+public static class Builder implements 
CmdBuilder {
+private String _nicUuid;
+private String _nicMacAddress;
+private String _networkUuid;
+private boolean _isL3Network;
+private boolean _isSharedNetwork;
+private String _vpcUuid;
+private String _networkDomainUuid;
+private String _networksAccountUuid;
+private boolean _isDomainRouter;
+private String _domainRouterIp;
+private String _vmInstanceName;
+private String _vmUuid;
+private String _vmUserName;
+private String _vmUserDomainName;
+private boolean _useStaticIp;
+private String _staticIp;
+private String _staticNatIpUuid;
+private String _staticNatIpAddress;
+private boolean _isStaticNatIpAllocated;
+private boolean _isOneToOneNat;
+private String _staticNatVlanUuid;
+private String _staticNatVlanGateway;
+private String _staticNatVlanNetmask;
+
+public Builder nicUuid(String nicUuid) {
+this._nicUuid = nicUuid;
+return this;
+}
+
+public Builder nicMacAddress(String nicMacAddress) {
+this._nicMacAddress = nicMacAddress;
+return this;
+}
+
+public Builder networkUuid(String networkUuid) {
+this._networkUuid = networkUuid;
+return this;
+}
+
+public Builder isL3Network(boolean isL3Network) {
+this._isL3Network = isL3Network;
+return this;
+}
+
+public Builder isSharedNetwork(boolean isSharedNetwork) {
+this._isSharedNetwork = isSharedNetwork;
+return this;
+}
+
+public Builder vpcUuid(String vpcUuid) {
+this._vpcUuid = vpcUuid;
+return this;
+}
+
+public Builder networkDomainUuid(String networkDomainUuid) {
+this._networkDomainUuid = networkDomainUuid;
+return this;
+}
+
+public Builder networksAccountUuid(String networksAccountUuid) {
+this._networksAccountUuid = networksAccountUuid;
+return this;
+}
+
+public Builder isDomainRouter(boolean isDomainRouter) {
+this._isDomainRouter = isDomainRouter;
+return this;
+}
+
+public Builder domainRouterIp(String domainRouterIp) {
+this._domainRouterIp = domainRouterIp;
+return this;
+}
+
+public Builder vmInstanceName(String vmInstanceName) {
+this._vmInstanceName = vmInstanceName;
+return this;
+}
+
+public Builder 

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093221
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/TrashNetworkVspCommand.java
 ---
@@ -48,13 +53,93 @@ public boolean isL3Network() {
 return _isL3Network;
 }
 
+public boolean isSharedNetwork() {
+return _isSharedNetwork;
+}
+
 public String getVpcUuid() {
 return _vpcUuid;
 }
 
+public String getDomainTemplateName() {
+return _domainTemplateName;
+}
+
+public static class Builder implements 
CmdBuilder {
+private String _domainUuid;
+private String _networkUuid;
+private boolean _isL3Network;
+private boolean _isSharedNetwork;
+private String _vpcUuid;
+private String _domainTemplateName;
+
+public Builder domainUuid(String domainUuid) {
+this._domainUuid = domainUuid;
+return this;
+}
+
+public Builder networkUuid(String networkUuid) {
+this._networkUuid = networkUuid;
+return this;
+}
+
+public Builder isL3Network(boolean isL3Network) {
+this._isL3Network = isL3Network;
+return this;
+}
+
+public Builder isSharedNetwork(boolean isSharedNetwork) {
+this._isSharedNetwork = isSharedNetwork;
+return this;
+}
+
+public Builder vpcUuid(String vpcUuid) {
+this._vpcUuid = vpcUuid;
+return this;
+}
+
+public Builder domainTemplateName(String domainTemplateName) {
+this._domainTemplateName = domainTemplateName;
+return this;
+}
+
+@Override
+public TrashNetworkVspCommand build() {
+return new TrashNetworkVspCommand(_domainUuid, _networkUuid, 
_isL3Network, _isSharedNetwork, _vpcUuid, _domainTemplateName);
+}
+}
+
 @Override
 public boolean executeInSequence() {
 return false;
 }
 
+@Override
+public boolean equals(Object o) {
--- End diff --

Implemented equals method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093355
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/manager/SupportedApiVersionCommand.java
 ---
@@ -17,38 +17,42 @@
 // under the License.
 //
 
-package com.cloud.agent.api.guru;
+package com.cloud.agent.api.manager;
 
 import com.cloud.agent.api.Command;
 
-public class ReleaseVmVspCommand extends Command {
+public class SupportedApiVersionCommand extends Command {
 
-String _networkUuid;
-String _vmUuid;
-String _vmInstanceName;
+private final String _apiVersion;
 
-public ReleaseVmVspCommand(String networkUuid, String vmUuid, String 
vmInstanceName) {
+public SupportedApiVersionCommand(String apiVersion) {
 super();
-this._networkUuid = networkUuid;
-this._vmUuid = vmUuid;
-this._vmInstanceName = vmInstanceName;
+this._apiVersion = apiVersion;
 }
 
-public String getNetworkUuid() {
-return _networkUuid;
+public String getApiVersion() {
+return _apiVersion;
 }
 
-public String getVmUuid() {
-return _vmUuid;
+@Override
+public boolean executeInSequence() {
+return false;
 }
 
-public String getVmInstanceName() {
-return _vmInstanceName;
+@Override
+public boolean equals(Object o) {
--- End diff --

Implemented equals method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093300
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/manager/GetClientDefaultsAnswer.java
 ---
@@ -0,0 +1,79 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.agent.api.manager;
+
+import com.cloud.agent.api.Answer;
+
+import java.util.Map;
+
+public class GetClientDefaultsAnswer extends Answer {
+
+private String _currentApiVersion;
+private Integer _apiRetryCount;
+private Long _apiRetryInterval;
+
+public GetClientDefaultsAnswer(GetClientDefaultsCommand cmd, 
Map defaults) {
+super(cmd);
+this._currentApiVersion = (String) 
defaults.get("CURRENT_API_VERSION");
+this._apiRetryCount = (Integer) 
defaults.get("DEFAULT_API_RETRY_COUNT");
+this._apiRetryInterval = (Long) 
defaults.get("DEFAULT_API_RETRY_INTERVAL");
+}
+
+public GetClientDefaultsAnswer(GetClientDefaultsCommand cmd, Exception 
e) {
+super(cmd, e);
+}
+
+public String getCurrentApiVersion() {
+return _currentApiVersion;
+}
+
+public Integer getApiRetryCount() {
+return _apiRetryCount;
+}
+
+public Long getApiRetryInterval() {
+return _apiRetryInterval;
+}
+
+@Override
+public boolean equals(Object o) {
--- End diff --

Implemented equals method for the Answer super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093317
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/manager/GetClientDefaultsAnswer.java
 ---
@@ -0,0 +1,79 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.agent.api.manager;
+
+import com.cloud.agent.api.Answer;
+
+import java.util.Map;
+
+public class GetClientDefaultsAnswer extends Answer {
+
+private String _currentApiVersion;
+private Integer _apiRetryCount;
+private Long _apiRetryInterval;
+
+public GetClientDefaultsAnswer(GetClientDefaultsCommand cmd, 
Map defaults) {
+super(cmd);
+this._currentApiVersion = (String) 
defaults.get("CURRENT_API_VERSION");
+this._apiRetryCount = (Integer) 
defaults.get("DEFAULT_API_RETRY_COUNT");
+this._apiRetryInterval = (Long) 
defaults.get("DEFAULT_API_RETRY_INTERVAL");
+}
+
+public GetClientDefaultsAnswer(GetClientDefaultsCommand cmd, Exception 
e) {
+super(cmd, e);
+}
+
+public String getCurrentApiVersion() {
+return _currentApiVersion;
+}
+
+public Integer getApiRetryCount() {
+return _apiRetryCount;
+}
+
+public Long getApiRetryInterval() {
+return _apiRetryInterval;
+}
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+GetClientDefaultsAnswer that = (GetClientDefaultsAnswer) o;
+
+if (_apiRetryCount != null ? 
!_apiRetryCount.equals(that._apiRetryCount) : that._apiRetryCount != null)
+return false;
+if (_apiRetryInterval != null ? 
!_apiRetryInterval.equals(that._apiRetryInterval) : that._apiRetryInterval != 
null)
+return false;
+if (_currentApiVersion != null ? 
!_currentApiVersion.equals(that._currentApiVersion) : that._currentApiVersion 
!= null)
+return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
--- End diff --

Implemented hashCode method for the Answer super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

2015-10-27 Thread wido
Github user wido commented on the pull request:

https://github.com/apache/cloudstack/pull/977#issuecomment-151412595
  
@ustcweizhou I think we shouldn't want a enable/disable flag in the 
agent.properties, it should work for anybody.

That we already have a lot of commands being executed doesn't mean we 
should add more. We should try to get rid of all of them.

Executing subcommands limits you to only checking the exit-status, but 
proper exception handling isn't possible.

We shouldn't introduce new cases of executing subcommands. This can be 
fixed by addings these features to libvirt-java and using them afterwards.

Maybe @bhaisaab, @DaanHoogland and @remibergsma can chime in?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093698
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -194,7 +224,23 @@ public boolean configure(String name, Map params) throws Configu
 @Override
 public boolean implement(Network network, NetworkOffering offering, 
DeployDestination dest, ReservationContext context) throws 
ConcurrentOperationException,
 ResourceUnavailableException, InsufficientCapacityException {
-s_logger.debug("Entering NuageElement implement function for 
network " + network.getDisplayText() + " (state " + network.getState() + ")");
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("Entering NuageElement implement function for 
network " + network.getDisplayText() + " (state " + network.getState() + ")");
+}
+
+if (network.getVpcId() != null) {
+List rules;
+if (network.getNetworkACLId() != null) {
+rules = 
_networkACLItemDao.listByACL(network.getNetworkACLId());
+} else {
+rules = Collections.emptyList();
+}
--- End diff --

Changed parameter of NetworKACLItemDAO.listByACL(long) to 
Long, and returning an empty list in case of null.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093940
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -303,13 +414,17 @@ protected boolean canHandle(Network network, Service 
service) {
 }
 
 if (!_networkModel.isProviderForNetwork(getProvider(), 
network.getId())) {
-s_logger.debug("NuageElement is not a provider for network " + 
network.getDisplayText());
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("NuageVsp is not a provider for network " + 
network.getDisplayText());
+}
 return false;
 }
 
 if (service != null) {
 if 
(!_ntwkSrvcDao.canProviderSupportServiceInNetwork(network.getId(), service, 
getProvider())) {
-s_logger.debug("NuageElement can't provide the " + 
service.getName() + " service on network " + network.getDisplayText());
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("NuageVsp can't provide the " + 
service.getName() + " service on network " + network.getDisplayText());
--- End diff --

This code is just checking whether the NuageVsp provider supports the 
services enabled on the given network, no need for specific information about 
the Nuage VSP.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43094914
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -483,7 +663,7 @@ protected HostVO getNuageVspHost(Long 
physicalNetworkId) throws CloudException {
 nuageVspHost = _hostDao.findById(config.getHostId());
 _hostDao.loadDetails(nuageVspHost);
 } else {
-throw new CloudException("Nuage VSD is not configured on 
physical network " + physicalNetworkId);
+throw new CloudRuntimeException("Nuage VSD is not configured 
on physical network " + physicalNetworkId);
--- End diff --

Changed code to throw new CloudRuntimeException("There is not Nuage 
VSP device configured on physical network " + physicalNetworkId). We 
can't identify about the Nuage VSP device that failed since there is none 
configured.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43095297
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -114,7 +115,9 @@ public Network design(NetworkOffering offering, 
DeploymentPlan plan, Network use
 PhysicalNetworkVO physnet = 
_physicalNetworkDao.findById(plan.getPhysicalNetworkId());
 DataCenter dc = _dcDao.findById(plan.getDataCenterId());
 if (!canHandle(offering, dc.getNetworkType(), physnet)) {
-s_logger.debug("Refusing to design this network");
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("Refusing to design network using network 
offering " +  offering.getId() + (physnet != null ? " on physical network " + 
physnet.getId() : ""));
--- End diff --

Not really, all plugins are logging this as DEBUG. 
The code that's calling this method is as following
```java
for (final NetworkGuru guru : networkGurus) {
final Network network = guru.design(offering, plan, 
predefined, owner);
if (network == null) {
continue;
}
...
}
```
It's looping over all gurus, we don't want our guru to log it as 
WARN every time a network is created and we don't support it.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43095562
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -129,66 +132,93 @@ public Network design(NetworkOffering offering, 
DeploymentPlan plan, Network use
 
 @Override
 public Network implement(Network network, NetworkOffering offering, 
DeployDestination dest, ReservationContext context) throws 
InsufficientVirtualNetworkCapacityException {
+long networkId = network.getId();
+network = _networkDao.acquireInLockTable(network.getId(), 1200);
+if (network == null) {
+throw new ConcurrentOperationException("Unable to acquire lock 
on network " + networkId);
+}
+
+NetworkVO implemented = null;
+try {
+assert (network.getState() == State.Implementing) : "Why are 
we implementing " + network;
--- End diff --

Done.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8993: DHCP fails with "no addr...

2015-10-27 Thread serbaut
Github user serbaut commented on the pull request:

https://github.com/apache/cloudstack/pull/981#issuecomment-151418751
  
I tested this manually. I did not manage to get any test environment to 
work but there is some tests in test/systemvm/test_update_config.py that could 
probably be extended to test this. Not sure where to start with running those 
tests though :(


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8917 : Instance tab takes long...

2015-10-27 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cloudstack/pull/894


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: [4.6] CLOUDSTACK-8992 Allow 32 disks to b...

2015-10-27 Thread karuturi
Github user karuturi commented on the pull request:

https://github.com/apache/cloudstack/pull/980#issuecomment-151397659
  
I am running the tests for #980 and #983 together.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43090554
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -205,6 +250,75 @@ public boolean implement(Network network, 
NetworkOffering offering, DeployDestin
 return false;
 }
 
+final boolean egressDefaultPolicy = 
offering.getEgressDefaultPolicy();
+Domain networkDomain = _domainDao.findById(network.getDomainId());
+boolean isFirewallServiceSupported = 
_networkModel.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.Firewall);
+List dnsServers = _nuageVspManager.getDnsDetails(network);
+
+boolean isL2Network = false, isL3Network = false, isShared = false;
+String subnetUuid = network.getUuid();
+if (offering.getGuestType() == Network.GuestType.Shared) {
+isShared = true;
+subnetUuid = networkDomain.getUuid();
+} else if 
(_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.SourceNat)
+|| 
_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.StaticNat)
+|| 
_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.Connectivity)) {
+isL3Network = true;
+} else {
+isL2Network = true;
+}
+
+String preConfiguredDomainTemplateName = 
getPreConfiguredDomainTemplateName(network, offering);
+List firewallIngressRulesToApply =
+
_firewallRulesDao.listByNetworkPurposeTrafficType(network.getId(), 
FirewallRule.Purpose.Firewall, FirewallRule.TrafficType.Ingress);
+for (FirewallRuleVO rule : firewallIngressRulesToApply) {
+// load cidrs if any
+
rule.setSourceCidrList(_firewallRulesCidrsDao.getSourceCidrs(rule.getId()));
+}
+
+List firewallEgressRulesToApply =
+
_firewallRulesDao.listByNetworkPurposeTrafficType(network.getId(), 
FirewallRule.Purpose.Firewall, FirewallRule.TrafficType.Egress);
+for (FirewallRuleVO rule : firewallEgressRulesToApply) {
+// load cidrs if any
+
rule.setSourceCidrList(_firewallRulesCidrsDao.getSourceCidrs(rule.getId()));
+}
+
+List> ingressFirewallRules = 
Lists.transform(firewallIngressRulesToApply, new Function>() {
+@Override
+public Map apply(FirewallRuleVO 
firewallRuleVO) {
+return getACLRuleDetails(firewallRuleVO, 
egressDefaultPolicy);
+}
+});
+
+List> egressFirewallRules = 
Lists.transform(firewallEgressRulesToApply, new Function>() {
--- End diff --

Refactored so the transformation is done in a method used for retrieving 
both lists.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: Update L10N resource files with 4.6 strin...

2015-10-27 Thread milamberspace
Github user milamberspace commented on the pull request:

https://github.com/apache/cloudstack/pull/974#issuecomment-151403745
  
Mishandling git commands. I've recreated this open PR for the localization 
files, see #984 

Closes this PR.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: Update L10N resource files with 4.6 strin...

2015-10-27 Thread milamberspace
Github user milamberspace closed the pull request at:

https://github.com/apache/cloudstack/pull/974


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Service Offering documentation

2015-10-27 Thread Vadim Kimlaychuk

Dear Ron,

 I suggest you to read this document: 
https://cwiki.apache.org/confluence/display/CLOUDSTACK/GPU+and+vGPU+support+for+CloudStack+Guest+VMs. 
I have tested pass-through mode with XenServer 6.2 and can give probably 
a bit more information if you need. The reference document is good 
indeed, so you probably do not need my comments :)


Regards,

Vadim.

On 2015-10-26 22:47, Ron Wheeler wrote:

The GPU section on page 
http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/4.5/service_offerings.html 
[1] seems to be lacking some information (at least as far as I can 
tell).
1) What does the GPU do? It says to select a card that I want to use. 
No hint about the basis on which I should make the selection or if 
there are any restrictions on the choice (based on hardware?)
2) It mentions support for 2 NVIDIA cards and says that if you want to 
use another card "make the createServiceOffering API call". How is this 
done on a UI screen?
3) The Type selection is worded in an odd way with 3 selections 
explicitly named and a "so on" thrown in. Then it goes on to talk about 
a passthrough vGPU type in a separate paragraph.


Perhaps there should be links to external web sites to clarify the 
definitions of these cards and types.


If someone can explain what this section actually means, I will try to 
write it in a clearer fashion.


Ron




Links:
--
[1] 
http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/4.5/service_offerings.html


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43092262
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/UpdateNuageVspDeviceCommand.java
 ---
@@ -0,0 +1,61 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.agent.api;
+
+import com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class UpdateNuageVspDeviceCommand extends Command {
+
+private final Map _parametersToBeUpdated;
+
+public UpdateNuageVspDeviceCommand(Map 
parametersToBeUpdated) {
+super();
+this._parametersToBeUpdated = 
ImmutableMap.copyOf(parametersToBeUpdated);
+}
+
+public Map getParametersToBeUpdated() {
+return this._parametersToBeUpdated;
+}
+
+@Override
+public boolean executeInSequence() {
+return false;
+}
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+UpdateNuageVspDeviceCommand that = (UpdateNuageVspDeviceCommand) o;
+
+if (_parametersToBeUpdated != null ? 
!_parametersToBeUpdated.equals(that._parametersToBeUpdated) : 
that._parametersToBeUpdated != null)
+return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
--- End diff --

Added attributes from the Command super classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43092257
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/UpdateNuageVspDeviceCommand.java
 ---
@@ -0,0 +1,61 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.agent.api;
+
+import com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class UpdateNuageVspDeviceCommand extends Command {
+
+private final Map _parametersToBeUpdated;
+
+public UpdateNuageVspDeviceCommand(Map 
parametersToBeUpdated) {
+super();
+this._parametersToBeUpdated = 
ImmutableMap.copyOf(parametersToBeUpdated);
+}
+
+public Map getParametersToBeUpdated() {
+return this._parametersToBeUpdated;
+}
+
+@Override
+public boolean executeInSequence() {
+return false;
+}
+
+@Override
+public boolean equals(Object o) {
--- End diff --

Added attributes from the Command super classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43092627
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/VspResourceCommand.java
 ---
@@ -79,4 +79,41 @@ public String getProxyUserDomainuuid() {
 public boolean executeInSequence() {
 return false;
 }
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+VspResourceCommand that = (VspResourceCommand) o;
+
+if (_childResource != null ? 
!_childResource.equals(that._childResource) : that._childResource != null)
+return false;
+if (_entityDetails != null ? 
!_entityDetails.equals(that._entityDetails) : that._entityDetails != null)
+return false;
+if (_method != null ? !_method.equals(that._method) : that._method 
!= null) return false;
+if (_proxyUserDomainuuid != null ? 
!_proxyUserDomainuuid.equals(that._proxyUserDomainuuid) : 
that._proxyUserDomainuuid != null)
+return false;
+if (_proxyUserUuid != null ? 
!_proxyUserUuid.equals(that._proxyUserUuid) : that._proxyUserUuid != null)
+return false;
+if (_resource != null ? !_resource.equals(that._resource) : 
that._resource != null) return false;
+if (_resourceFilter != null ? 
!_resourceFilter.equals(that._resourceFilter) : that._resourceFilter != null)
+return false;
+if (_resourceId != null ? !_resourceId.equals(that._resourceId) : 
that._resourceId != null) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
--- End diff --

Implemented hashCode method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43092950
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ApplyAclRuleVspCommand.java
 ---
@@ -58,20 +73,117 @@ public String getVpcOrSubnetUuid() {
 return _vpcOrSubnetUuid;
 }
 
-public boolean isL3Network() {
-return _isL3Network;
+public String getNetworkName() {
+return _networkName;
+}
+
+public boolean isL2Network() {
+return _isL2Network;
 }
 
 public List> getAclRules() {
 return _aclRules;
 }
 
-public boolean isVpc() {
-return _isVpc;
+public long getNetworkId() {
+return _networkId;
 }
 
-public long getNetworkId() {
-return this._networkId;
+public boolean isEgressDefaultPolicy() {
+return _egressDefaultPolicy;
+}
+
+public Boolean getAcsIngressAcl() {
+return _acsIngressAcl;
+}
+
+public boolean isNetworkReset() {
+return _networkReset;
+}
+
+public String getDomainTemplateName() {
+return _domainTemplateName;
+}
+
+public static class Builder implements 
CmdBuilder {
--- End diff --

No, there shouldn't be any default values in my opinion.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093444
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncNuageVspCmsIdAnswer.java
 ---
@@ -0,0 +1,71 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.agent.api.sync;
+
+import com.cloud.agent.api.Answer;
+
+public class SyncNuageVspCmsIdAnswer extends Answer {
+
+private final boolean _success;
+private final String _nuageVspCmsId;
+private final SyncNuageVspCmsIdCommand.SyncType _syncType;
+
+public SyncNuageVspCmsIdAnswer(boolean success, String nuageVspCmsId, 
SyncNuageVspCmsIdCommand.SyncType syncType) {
+super();
+this._success = success;
+this._nuageVspCmsId = nuageVspCmsId;
+this._syncType = syncType;
+}
+
+public boolean getSuccess() {
+return _success;
+}
+
+public String getNuageVspCmsId() {
+return _nuageVspCmsId;
+}
+
+public SyncNuageVspCmsIdCommand.SyncType getSyncType() {
+return _syncType;
+}
+
+@Override
+public boolean equals(Object o) {
--- End diff --

Implemented equals method for the Answer super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093369
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/manager/SupportedApiVersionCommand.java
 ---
@@ -17,38 +17,42 @@
 // under the License.
 //
 
-package com.cloud.agent.api.guru;
+package com.cloud.agent.api.manager;
 
 import com.cloud.agent.api.Command;
 
-public class ReleaseVmVspCommand extends Command {
+public class SupportedApiVersionCommand extends Command {
 
-String _networkUuid;
-String _vmUuid;
-String _vmInstanceName;
+private final String _apiVersion;
 
-public ReleaseVmVspCommand(String networkUuid, String vmUuid, String 
vmInstanceName) {
+public SupportedApiVersionCommand(String apiVersion) {
 super();
-this._networkUuid = networkUuid;
-this._vmUuid = vmUuid;
-this._vmInstanceName = vmInstanceName;
+this._apiVersion = apiVersion;
 }
 
-public String getNetworkUuid() {
-return _networkUuid;
+public String getApiVersion() {
+return _apiVersion;
 }
 
-public String getVmUuid() {
-return _vmUuid;
+@Override
+public boolean executeInSequence() {
+return false;
 }
 
-public String getVmInstanceName() {
-return _vmInstanceName;
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+SupportedApiVersionCommand that = (SupportedApiVersionCommand) o;
+
+if (_apiVersion != null ? !_apiVersion.equals(that._apiVersion) : 
that._apiVersion != null) return false;
+
+return true;
 }
 
 @Override
-public boolean executeInSequence() {
-return false;
+public int hashCode() {
--- End diff --

Implemented hashCode method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093430
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncDomainCommand.java
 ---
@@ -0,0 +1,91 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.agent.api.sync;
+
+import com.cloud.agent.api.Command;
+
+public class SyncDomainCommand extends Command {
+
+private final String _domainUuid;
+private final String _domainName;
+private final String _domainPath;
+private final boolean _toAdd;
+private final boolean _toRemove;
+
+public SyncDomainCommand(String domainUuid, String domainName, String 
domainPath, boolean toAdd, boolean toRemove) {
+super();
+this._domainUuid = domainUuid;
+this._domainName = domainName;
+this._domainPath = domainPath;
+this._toAdd = toAdd;
+this._toRemove = toRemove;
+}
+
+public String getDomainUuid() {
+return _domainUuid;
+}
+
+public String getDomainName() {
+return _domainName;
+}
+
+public String getDomainPath() {
+return _domainPath;
+}
+
+public boolean isToAdd() {
+return _toAdd;
+}
+
+public boolean isToRemove() {
+return _toRemove;
+}
+
+@Override
+public boolean executeInSequence() {
+return false;
+}
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+SyncDomainCommand that = (SyncDomainCommand) o;
+
+if (_toAdd != that._toAdd) return false;
+if (_toRemove != that._toRemove) return false;
+if (_domainName != null ? !_domainName.equals(that._domainName) : 
that._domainName != null) return false;
+if (_domainPath != null ? !_domainPath.equals(that._domainPath) : 
that._domainPath != null) return false;
+if (_domainUuid != null ? !_domainUuid.equals(that._domainUuid) : 
that._domainUuid != null) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
--- End diff --

Implemented hashCode method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093497
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncVspCommand.java
 ---
@@ -39,4 +39,21 @@ public String getNuageVspEntity() {
 return _nuageVspEntity;
 }
 
+@Override
+public boolean equals(Object o) {
--- End diff --

Implemented equals method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093469
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncNuageVspCmsIdCommand.java
 ---
@@ -0,0 +1,70 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.agent.api.sync;
+
+import com.cloud.agent.api.Command;
+
+public class SyncNuageVspCmsIdCommand extends Command {
+
+public static enum SyncType { AUDIT, AUDIT_ONLY, REGISTER, UNREGISTER }
+
+private final SyncType _syncType;
+private final String _nuageVspCmsId;
+
+public SyncNuageVspCmsIdCommand(SyncType syncType, String 
nuageVspCmsId) {
+super();
+this._syncType = syncType;
+this._nuageVspCmsId = nuageVspCmsId;
+}
+
+public SyncType getSyncType() {
+return _syncType;
+}
+
+public String getNuageVspCmsId() {
+return _nuageVspCmsId;
+}
+
+@Override
+public boolean executeInSequence() {
+return false;
+}
+
+@Override
+public boolean equals(Object o) {
--- End diff --

Implemented equals method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093502
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncVspCommand.java
 ---
@@ -39,4 +39,21 @@ public String getNuageVspEntity() {
 return _nuageVspEntity;
 }
 
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+SyncVspCommand that = (SyncVspCommand) o;
+
+if (_nuageVspEntity != null ? 
!_nuageVspEntity.equals(that._nuageVspEntity) : that._nuageVspEntity != null)
+return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
--- End diff --

Implemented hashCode method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093482
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncNuageVspCmsIdCommand.java
 ---
@@ -0,0 +1,70 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.agent.api.sync;
+
+import com.cloud.agent.api.Command;
+
+public class SyncNuageVspCmsIdCommand extends Command {
+
+public static enum SyncType { AUDIT, AUDIT_ONLY, REGISTER, UNREGISTER }
+
+private final SyncType _syncType;
+private final String _nuageVspCmsId;
+
+public SyncNuageVspCmsIdCommand(SyncType syncType, String 
nuageVspCmsId) {
+super();
+this._syncType = syncType;
+this._nuageVspCmsId = nuageVspCmsId;
+}
+
+public SyncType getSyncType() {
+return _syncType;
+}
+
+public String getNuageVspCmsId() {
+return _nuageVspCmsId;
+}
+
+@Override
+public boolean executeInSequence() {
+return false;
+}
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+SyncNuageVspCmsIdCommand that = (SyncNuageVspCmsIdCommand) o;
+
+if (_nuageVspCmsId != null ? 
!_nuageVspCmsId.equals(that._nuageVspCmsId) : that._nuageVspCmsId != null)
+return false;
+if (_syncType != that._syncType) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
--- End diff --

Implemented hashCode method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


How to define community VLAN in ACS 4.5.2

2015-10-27 Thread Keerthiraja SJ
Hi All,

I am trying to implement ACS 4.5.2 in production environment. We thought to
implement via PVLAN

So the primary VLAN 41 inside they create secondary isolated vlan 42 and
community vlan 43.

After they did everything in switch side with promiscuous port.

Now when I choose the Add Guest Network I can only see the

*VLAN/VNI ID:
Secondary Isolated VLAN ID:
Where can I specified the community vlan.
Shall I created another Add guest network again and VLAN ID 41 and on
Secondary shall I proceed by giving the community VLAN ID.

Thanks,
Keerthi


Mentor

2015-10-27 Thread B Prakash
Hi, I am an experience Java EE professional (new to cloudstack though).


   I am interested in contributing to the development.  As suggested in the 
newcomer section, I have been following the jira and the dev emails for a few 
days now, but I haven't been successful in identifying an opportunity to start. 
 Please can someone help me identify/share a newcomer task/feature to 
implement?  A good starting point perhaps.


Thanks,

B Prakash


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43090895
  
--- 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());
+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());
+}
+
+//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());
+NetworkOffering networkOffering = 
_ntwkOfferingDao.findById(network.getNetworkOfferingId());
+boolean isDomainRouter = 
vm.getType().equals(VirtualMachine.Type.DomainRouter);
+String domainRouterIp = 

Re: Mentor

2015-10-27 Thread Daan Hoogland
Prakesh,

Thanks for the offer to step in. There are lots of improvements and
refactorings to be made. Made sure you have a good test bed first. At the
moment we are in freeze so getting contributions accepted is hard on  the
beginner.
For starters I would suggest finding the massive blobs (huge methods) in
cloudstack and dissecting them to smaller chunks and writing unit tests for
them. There's a lot of them around. It is a great beginners job for an
experienced dev.
Another one is upgrading dependencies. there is some outdated ones and I am
looking at those but have to little time to get real work done on them. If
you can identify the code using commons-httpclient and can rewrite it to
use (the newer apache) httpclient. that would be great.

I am sure a lot of people can give you a lot of clues. These are a few just
below my agenda ;)

regards,

On Tue, Oct 27, 2015 at 7:57 AM, B Prakash  wrote:

> Hi, I am an experience Java EE professional (new to cloudstack though).
>
>
>I am interested in contributing to the development.  As suggested
> in the newcomer section, I have been following the jira and the dev emails
> for a few days now, but I haven't been successful in identifying an
> opportunity to start.  Please can someone help me identify/share a newcomer
> task/feature to implement?  A good starting point perhaps.
>
>
> Thanks,
>
> B Prakash
>



-- 
Daan


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43091029
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -358,19 +441,22 @@ private String getVirtualRouterIP(Network network, 
Collection addressRan
 Set allIPsInCidr = NetUtils.getAllIpsFromCidr(subnet, 
cidrSize, new HashSet());
 
 if (allIPsInCidr.size() > 3) {
+//get the second IP and see if it the networks GatewayIP
 Iterator ipIterator = allIPsInCidr.iterator();
 long vip = ipIterator.next();
--- End diff --

Added your piece of code as extra validation for the returned Set.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43091160
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -285,60 +507,341 @@ public boolean 
deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) {
 return responseList;
 }
 
-@Override
-public boolean configure(String name, Map params) 
throws ConfigurationException {
-try {
-initNuageScheduledTasks();
-} catch (Exception ce) {
-s_logger.warn("Failed to load NuageVsp configuration 
properties. Check if the NuageVsp properties are configured correctly");
+private void registerNewNuageVspDevice(ConfigurationVO currentConfig, 
String registeredNuageVspDevice) {
+if (currentConfig == null) {
+ConfigKey configKey = new 
ConfigKey("Advanced", String.class, "nuagevsp.cms.id", 
registeredNuageVspDevice,
+": - Do 
not edit", false);
+ConfigurationVO configuration = new 
ConfigurationVO("management-server", configKey);
+_configDao.persist(configuration);
+} else {
+String newValue;
+String currentValue = currentConfig.getValue();
+if (StringUtils.isNotBlank(currentValue)) {
+newValue = currentValue + ";" + registeredNuageVspDevice;
+} else {
+newValue = registeredNuageVspDevice;
+}
+_configDao.update("nuagevsp.cms.id", newValue);
 }
-return true;
 }
 
-private void initNuageScheduledTasks() {
-Integer numOfSyncThreads = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncWorkers.key()));
-Integer syncUpIntervalInMinutes = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncInterval.key()));
-
-if (numOfSyncThreads != null && syncUpIntervalInMinutes != null) {
-ThreadFactory threadFactory = new ThreadFactory() {
-public Thread newThread(Runnable runnable) {
-Thread thread = new Thread(runnable, "Nuage Vsp sync 
task");
-if (thread.isDaemon())
-thread.setDaemon(false);
-if (thread.getPriority() != Thread.NORM_PRIORITY)
-thread.setPriority(Thread.NORM_PRIORITY);
-return thread;
+private void auditHost(HostVO host) {
+_hostDao.loadDetails(host);
+
+boolean validateDomains = true;
+List nuageVspDevices = 
_nuageVspDao.listByHost(host.getId());
+if (!CollectionUtils.isEmpty(nuageVspDevices)) {
+for (NuageVspDeviceVO nuageVspDevice : nuageVspDevices) {
+ConfigurationVO cmsIdConfig = 
_configDao.findByName("nuagevsp.cms.id");
+String nuageVspCmsId = 
findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig);
+SyncNuageVspCmsIdCommand syncCmd = new 
SyncNuageVspCmsIdCommand(SyncType.AUDIT, nuageVspCmsId);
+SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) 
_agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd);
+
+if (answer != null && !answer.getSuccess()) {
+s_logger.fatal("Nuage VSP Device with ID " + 
nuageVspDevice.getId() + " is configured with an unknown CMS ID!");
+validateDomains = false;
+} else if (answer != null && answer.getSyncType() == 
SyncType.REGISTER) {
+registerNewNuageVspDevice(cmsIdConfig, 
nuageVspDevice.getId() + ":" + answer.getNuageVspCmsId());
 }
-};
-scheduler = Executors.newScheduledThreadPool(numOfSyncThreads, 
threadFactory);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("FLOATING_IP"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE_NTWK_MACRO"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler
-.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, TimeUnit.MILLISECONDS);
-} else {
-s_logger.warn("NuageVsp configuration for syncWorkers=" + 
numOfSyncThreads + " syncInterval=" + syncUpIntervalInMinutes
-+ " could not be read properly. So, check if the 
properties are configured properly 

[GitHub] cloudstack pull request: Update L10N files for Next 4.6.

2015-10-27 Thread milamberspace
GitHub user milamberspace opened a pull request:

https://github.com/apache/cloudstack/pull/984

Update L10N files for Next 4.6.

Update the localization files for the next CloudStack version. This PR is 
open until the start of the release candidate 1 for CS 4.6.

This PR cancel and replace the #974 (which have some issues with my rebase 
from master (mishandling git command))

cc @remibergsma 

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/milamberspace/cloudstack L10N-update-forNext46

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cloudstack/pull/984.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #984


commit 8e07c981fe27cc600449ee7db51637f127a6226e
Author: Milamber 
Date:   2015-10-27T07:39:19Z

Update L10N files for Next 4.6.




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43092609
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/VspResourceCommand.java
 ---
@@ -79,4 +79,41 @@ public String getProxyUserDomainuuid() {
 public boolean executeInSequence() {
 return false;
 }
+
+@Override
+public boolean equals(Object o) {
--- End diff --

Implemented equals method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093012
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ApplyStaticNatVspCommand.java
 ---
@@ -51,13 +61,91 @@ public boolean isL3Network() {
 return _isL3Network;
 }
 
+public boolean isVpc() {
+return _isVpc;
+}
+
 public List> getStaticNatDetails() {
 return _staticNatDetails;
 }
 
+public static class Builder implements 
CmdBuilder {
+private String _networkDomainUuid;
+private String _networkUuid;
+private String _vpcOrSubnetUuid;
+private boolean _isL3Network;
+private boolean _isVpc;
+private List> _staticNatDetails;
+
+public Builder networkDomainUuid(String networkDomainUuid) {
+this._networkDomainUuid = networkDomainUuid;
+return this;
+}
+
+public Builder networkUuid(String networkUuid) {
+this._networkUuid = networkUuid;
+return this;
+}
+
+public Builder vpcOrSubnetUuid(String vpcOrSubnetUuid) {
+this._vpcOrSubnetUuid = vpcOrSubnetUuid;
+return this;
+}
+
+public Builder isL3Network(boolean isL3Network) {
+this._isL3Network = isL3Network;
+return this;
+}
+
+public Builder isVpc(boolean isVpc) {
+this._isVpc = isVpc;
+return this;
+}
+
+public Builder staticNatDetails(List> 
staticNatDetails) {
+this._staticNatDetails = staticNatDetails;
+return this;
+}
+
+@Override
+public ApplyStaticNatVspCommand build() {
+return new ApplyStaticNatVspCommand(_networkDomainUuid, 
_networkUuid, _vpcOrSubnetUuid, _isL3Network, _isVpc, _staticNatDetails);
+}
+}
+
 @Override
 public boolean executeInSequence() {
 return false;
 }
 
+@Override
+public boolean equals(Object o) {
--- End diff --

Implemented equals method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093062
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ImplementVspCommand.java
 ---
@@ -0,0 +1,295 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.agent.api.element;
+
+import com.cloud.agent.api.CmdBuilder;
+import com.cloud.agent.api.Command;
+
+import java.util.List;
+import java.util.Map;
+
+public class ImplementVspCommand extends Command {
+
+private final long _networkId;
+private final String _networkDomainUuid;
+private final String _networkUuid;
+private final String _networkName;
+private final String _vpcOrSubnetUuid;
+private final boolean _isL2Network;
+private final boolean _isL3Network;
+private final boolean _isVpc;
+private final boolean _isShared;
+private final String _domainTemplateName;
+private final boolean _isFirewallServiceSupported;
+private final List _dnsServers;
+private final List> _ingressFirewallRules;
+private final List> _egressFirewallRules;
+private final List _acsFipUuid;
+private final boolean _egressDefaultPolicy;
+
+private ImplementVspCommand(long networkId, String networkDomainUuid, 
String networkUuid, String networkName, String vpcOrSubnetUuid, boolean 
isL2Network, boolean isL3Network,
+boolean isVpc, boolean isShared, String domainTemplateName, 
boolean isFirewallServiceSupported, List dnsServers, List> ingressFirewallRules,
+List> egressFirewallRules, List 
acsFipUuid, boolean egressDefaultPolicy) {
+super();
+this._networkId = networkId;
+this._networkDomainUuid = networkDomainUuid;
+this._networkUuid = networkUuid;
+this._networkName = networkName;
+this._vpcOrSubnetUuid = vpcOrSubnetUuid;
+this._isL2Network = isL2Network;
+this._isL3Network = isL3Network;
+this._isVpc = isVpc;
+this._isShared = isShared;
+this._domainTemplateName = domainTemplateName;
+this._isFirewallServiceSupported = isFirewallServiceSupported;
+this._dnsServers = dnsServers;
+this._ingressFirewallRules = ingressFirewallRules;
+this._egressFirewallRules = egressFirewallRules;
+this._acsFipUuid = acsFipUuid;
+this._egressDefaultPolicy = egressDefaultPolicy;
+}
+
+public long getNetworkId() {
+return _networkId;
+}
+
+public String getNetworkDomainUuid() {
+return _networkDomainUuid;
+}
+
+public String getNetworkUuid() {
+return _networkUuid;
+}
+
+public String getNetworkName() {
+return _networkName;
+}
+
+public String getVpcOrSubnetUuid() {
+return _vpcOrSubnetUuid;
+}
+
+public boolean isL2Network() {
+return _isL2Network;
+}
+
+public boolean isL3Network() {
+return _isL3Network;
+}
+
+public boolean isVpc() {
+return _isVpc;
+}
+
+public boolean isShared() {
+return _isShared;
+}
+
+public String getDomainTemplateName() {
+return _domainTemplateName;
+}
+
+public boolean isFirewallServiceSupported() {
+return _isFirewallServiceSupported;
+}
+
+public List getDnsServers() {
+return _dnsServers;
+}
+
+public List> getIngressFirewallRules() {
+return _ingressFirewallRules;
+}
+
+public List> getEgressFirewallRules() {
+return _egressFirewallRules;
+}
+
+public List 

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093055
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ImplementVspCommand.java
 ---
@@ -0,0 +1,295 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.agent.api.element;
+
+import com.cloud.agent.api.CmdBuilder;
+import com.cloud.agent.api.Command;
+
+import java.util.List;
+import java.util.Map;
+
+public class ImplementVspCommand extends Command {
+
+private final long _networkId;
+private final String _networkDomainUuid;
+private final String _networkUuid;
+private final String _networkName;
+private final String _vpcOrSubnetUuid;
+private final boolean _isL2Network;
+private final boolean _isL3Network;
+private final boolean _isVpc;
+private final boolean _isShared;
+private final String _domainTemplateName;
+private final boolean _isFirewallServiceSupported;
+private final List _dnsServers;
+private final List> _ingressFirewallRules;
+private final List> _egressFirewallRules;
+private final List _acsFipUuid;
+private final boolean _egressDefaultPolicy;
+
+private ImplementVspCommand(long networkId, String networkDomainUuid, 
String networkUuid, String networkName, String vpcOrSubnetUuid, boolean 
isL2Network, boolean isL3Network,
+boolean isVpc, boolean isShared, String domainTemplateName, 
boolean isFirewallServiceSupported, List dnsServers, List> ingressFirewallRules,
+List> egressFirewallRules, List 
acsFipUuid, boolean egressDefaultPolicy) {
+super();
+this._networkId = networkId;
+this._networkDomainUuid = networkDomainUuid;
+this._networkUuid = networkUuid;
+this._networkName = networkName;
+this._vpcOrSubnetUuid = vpcOrSubnetUuid;
+this._isL2Network = isL2Network;
+this._isL3Network = isL3Network;
+this._isVpc = isVpc;
+this._isShared = isShared;
+this._domainTemplateName = domainTemplateName;
+this._isFirewallServiceSupported = isFirewallServiceSupported;
+this._dnsServers = dnsServers;
+this._ingressFirewallRules = ingressFirewallRules;
+this._egressFirewallRules = egressFirewallRules;
+this._acsFipUuid = acsFipUuid;
+this._egressDefaultPolicy = egressDefaultPolicy;
+}
+
+public long getNetworkId() {
+return _networkId;
+}
+
+public String getNetworkDomainUuid() {
+return _networkDomainUuid;
+}
+
+public String getNetworkUuid() {
+return _networkUuid;
+}
+
+public String getNetworkName() {
+return _networkName;
+}
+
+public String getVpcOrSubnetUuid() {
+return _vpcOrSubnetUuid;
+}
+
+public boolean isL2Network() {
+return _isL2Network;
+}
+
+public boolean isL3Network() {
+return _isL3Network;
+}
+
+public boolean isVpc() {
+return _isVpc;
+}
+
+public boolean isShared() {
+return _isShared;
+}
+
+public String getDomainTemplateName() {
+return _domainTemplateName;
+}
+
+public boolean isFirewallServiceSupported() {
+return _isFirewallServiceSupported;
+}
+
+public List getDnsServers() {
+return _dnsServers;
+}
+
+public List> getIngressFirewallRules() {
+return _ingressFirewallRules;
+}
+
+public List> getEgressFirewallRules() {
+return _egressFirewallRules;
+}
+
+public List 

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093086
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ShutDownVpcVspCommand.java
 ---
@@ -40,9 +43,61 @@ public String getVpcUuid() {
 return _vpcUuid;
 }
 
+public String getDomainTemplateName() {
+return _domainTemplateName;
+}
+
+public static class Builder implements 
CmdBuilder {
+private String _domainUuid;
+private String _vpcUuid;
+private String _domainTemplateName;
+
+public Builder domainUuid(String domainUuid) {
+this._domainUuid = domainUuid;
+return this;
+}
+
+public Builder vpcUuid(String vpcUuid) {
+this._vpcUuid = vpcUuid;
+return this;
+}
+
+public Builder domainTemplateName(String domainTemplateName) {
+this._domainTemplateName = domainTemplateName;
+return this;
+}
+
+@Override
+public ShutDownVpcVspCommand build() {
+return new ShutDownVpcVspCommand(_domainUuid, _vpcUuid, 
_domainTemplateName);
+}
+}
+
 @Override
 public boolean executeInSequence() {
 return false;
 }
 
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+ShutDownVpcVspCommand that = (ShutDownVpcVspCommand) o;
+
+if (_domainTemplateName != null ? 
!_domainTemplateName.equals(that._domainTemplateName) : 
that._domainTemplateName != null)
+return false;
+if (_domainUuid != null ? !_domainUuid.equals(that._domainUuid) : 
that._domainUuid != null) return false;
+if (_vpcUuid != null ? !_vpcUuid.equals(that._vpcUuid) : 
that._vpcUuid != null) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
--- End diff --

Implemented hashCode method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093076
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ShutDownVpcVspCommand.java
 ---
@@ -40,9 +43,61 @@ public String getVpcUuid() {
 return _vpcUuid;
 }
 
+public String getDomainTemplateName() {
+return _domainTemplateName;
+}
+
+public static class Builder implements 
CmdBuilder {
+private String _domainUuid;
+private String _vpcUuid;
+private String _domainTemplateName;
+
+public Builder domainUuid(String domainUuid) {
+this._domainUuid = domainUuid;
+return this;
+}
+
+public Builder vpcUuid(String vpcUuid) {
+this._vpcUuid = vpcUuid;
+return this;
+}
+
+public Builder domainTemplateName(String domainTemplateName) {
+this._domainTemplateName = domainTemplateName;
+return this;
+}
+
+@Override
+public ShutDownVpcVspCommand build() {
+return new ShutDownVpcVspCommand(_domainUuid, _vpcUuid, 
_domainTemplateName);
+}
+}
+
 @Override
 public boolean executeInSequence() {
 return false;
 }
 
+@Override
+public boolean equals(Object o) {
--- End diff --

Implemented equals method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8993: DHCP fails with "no addr...

2015-10-27 Thread wido
Github user wido commented on the pull request:

https://github.com/apache/cloudstack/pull/981#issuecomment-151412107
  
Is there any way we can test this automatically? I think there is no Unit 
Test for this, right?

I currently don't have a setup to test this, but can you explain how you 
tested this?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093426
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncDomainCommand.java
 ---
@@ -0,0 +1,91 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.agent.api.sync;
+
+import com.cloud.agent.api.Command;
+
+public class SyncDomainCommand extends Command {
+
+private final String _domainUuid;
+private final String _domainName;
+private final String _domainPath;
+private final boolean _toAdd;
+private final boolean _toRemove;
+
+public SyncDomainCommand(String domainUuid, String domainName, String 
domainPath, boolean toAdd, boolean toRemove) {
+super();
+this._domainUuid = domainUuid;
+this._domainName = domainName;
+this._domainPath = domainPath;
+this._toAdd = toAdd;
+this._toRemove = toRemove;
+}
+
+public String getDomainUuid() {
+return _domainUuid;
+}
+
+public String getDomainName() {
+return _domainName;
+}
+
+public String getDomainPath() {
+return _domainPath;
+}
+
+public boolean isToAdd() {
+return _toAdd;
+}
+
+public boolean isToRemove() {
+return _toRemove;
+}
+
+@Override
+public boolean executeInSequence() {
+return false;
+}
+
+@Override
+public boolean equals(Object o) {
--- End diff --

Implemented equals method for the Command super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093455
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncNuageVspCmsIdAnswer.java
 ---
@@ -0,0 +1,71 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package com.cloud.agent.api.sync;
+
+import com.cloud.agent.api.Answer;
+
+public class SyncNuageVspCmsIdAnswer extends Answer {
+
+private final boolean _success;
+private final String _nuageVspCmsId;
+private final SyncNuageVspCmsIdCommand.SyncType _syncType;
+
+public SyncNuageVspCmsIdAnswer(boolean success, String nuageVspCmsId, 
SyncNuageVspCmsIdCommand.SyncType syncType) {
+super();
+this._success = success;
+this._nuageVspCmsId = nuageVspCmsId;
+this._syncType = syncType;
+}
+
+public boolean getSuccess() {
+return _success;
+}
+
+public String getNuageVspCmsId() {
+return _nuageVspCmsId;
+}
+
+public SyncNuageVspCmsIdCommand.SyncType getSyncType() {
+return _syncType;
+}
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+SyncNuageVspCmsIdAnswer that = (SyncNuageVspCmsIdAnswer) o;
+
+if (_success != that._success) return false;
+if (_nuageVspCmsId != null ? 
!_nuageVspCmsId.equals(that._nuageVspCmsId) : that._nuageVspCmsId != null)
+return false;
+if (_syncType != that._syncType) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
--- End diff --

Implemented hashCode method for the Answer super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43093396
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncDomainAnswer.java
 ---
@@ -17,28 +17,38 @@
 // under the License.
 //
 
-package com.cloud.agent.api.guru;
-
-import java.util.List;
-import java.util.Map;
+package com.cloud.agent.api.sync;
 
 import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
 
-public class ReserveVmInterfaceVspAnswer extends Answer {
+public class SyncDomainAnswer extends Answer {
+
+private final boolean _success;
 
-public List> _interfaceDetails;
+public SyncDomainAnswer(boolean success) {
+super();
+this._success = success;
+}
 
-public ReserveVmInterfaceVspAnswer(Command cmd, List> interfaceDetails, String details) {
-super(cmd, true, details);
-this._interfaceDetails = interfaceDetails;
+public boolean getSuccess() {
+return _success;
 }
 
-public ReserveVmInterfaceVspAnswer(Command cmd, Exception e) {
-super(cmd, e);
+
+@Override
+public boolean equals(Object o) {
--- End diff --

Implemented equals method for the Answer super 
class, calling it from subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43094017
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -367,22 +483,16 @@ public boolean applyStaticNats(Network config, List rules)
 sourceNatDetail.put("sourceNatVlanNetmask", 
sourceNatVan.getVlanNetmask());
 sourceNatDetails.add(sourceNatDetail);
 }
-try {
-try {
-HostVO nuageVspHost = 
getNuageVspHost(config.getPhysicalNetworkId());
-ApplyStaticNatVspCommand cmd = new 
ApplyStaticNatVspCommand(networkDomain.getUuid(), vpcOrSubnetUuid, isL3Network, 
sourceNatDetails);
-ApplyStaticNatVspAnswer answer = 
(ApplyStaticNatVspAnswer)_agentMgr.easySend(nuageVspHost.getId(), cmd);
-if (answer == null || !answer.getResult()) {
-s_logger.error("ApplyStaticNatNuageVspCommand for 
network " + config.getUuid() + " failed");
-if ((null != answer) && (null != answer.getDetails())) 
{
-throw new 
ResourceUnavailableException(answer.getDetails(), Network.class, 
config.getId());
-}
-}
-} catch (Exception e) {
-s_logger.warn("Failed to apply static Nat in Vsp " + 
e.getMessage());
+
+HostVO nuageVspHost = 
getNuageVspHost(config.getPhysicalNetworkId());
+ApplyStaticNatVspCommand.Builder cmdBuilder = new 
ApplyStaticNatVspCommand.Builder().networkDomainUuid(networkDomain.getUuid())
--- End diff --

Done.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43094088
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -395,65 +505,135 @@ public IpDeployer getIpDeployer(Network network) {
 
 @Override
 public boolean applyFWRules(Network network, List rules) throws ResourceUnavailableException {
-s_logger.debug("Handling applyFWRules for network " + 
network.getName() + " with " + rules.size() + " FWRules");
-if (rules != null && rules.size() == 1 && 
rules.iterator().next().getType().equals(FirewallRuleType.System)) {
-s_logger.debug("Default ACL added by CS as system is ignored 
for network " + network.getName() + " with rule " + rules);
+if (rules == null || rules.isEmpty()) {
 return true;
 }
-return applyACLRules(network, rules, false);
+
+if (rules.size() == 1 && 
rules.iterator().next().getType().equals(FirewallRuleType.System)) {
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("Default ACL added by CS as system is 
ignored for network " + network.getName() + " with rule " + rules);
--- End diff --

This message is DEBUG severity.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43095672
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -409,8 +472,8 @@ private HostVO getNuageVspHost(long physicalNetworkId) 
throws InsufficientVirtua
 nuageVspHost = _hostDao.findById(config.getHostId());
 _hostDao.loadDetails(nuageVspHost);
 } else {
-throw new InsufficientVirtualNetworkCapacityException("Nuage 
VSD is not configured on physical network ", PhysicalNetwork.class, 
physicalNetworkId);
+throw new CloudRuntimeException("Nuage VSD is not configured 
on physical network " + physicalNetworkId);
--- End diff --

Changed code to throw new CloudRuntimeException("There is no Nuage 
VSP device configured on physical network " + physicalNetworkId). We 
can't identify about the Nuage VSP device that failed since there is none 
configured.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Project name is set to NULL if a project is deleted

2015-10-27 Thread Norbert Klein
Hi all,

if we delete a project, the name of the project is set to NULL in the
database and thus does not appear in the usage records.
But the display_text ist still available. This makes no sense imho.

We have no chance to display project names of deleted projects in a
monthly report for example.

Is it save to manually insert the project name again into the database?

Regards
Norbert
-- 
www.infosecprojects.net 



[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43102657
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +241,185 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
--- End diff --

Refactored the whole params approach to be more readable and consistent.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43103718
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -285,60 +529,334 @@ public boolean 
deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) {
 return responseList;
 }
 
-@Override
-public boolean configure(String name, Map params) 
throws ConfigurationException {
-try {
-initNuageScheduledTasks();
-} catch (Exception ce) {
-s_logger.warn("Failed to load NuageVsp configuration 
properties. Check if the NuageVsp properties are configured correctly");
+private void registerNewNuageVspDevice(ConfigurationVO currentConfig, 
String registeredNuageVspDevice) {
+if (currentConfig == null) {
+ConfigKey configKey = new 
ConfigKey("Advanced", String.class, "nuagevsp.cms.id", 
registeredNuageVspDevice,
+": - Do 
not edit", false);
+ConfigurationVO configuration = new 
ConfigurationVO("management-server", configKey);
+_configDao.persist(configuration);
+} else {
+String newValue;
+String currentValue = currentConfig.getValue();
+if (!Strings.isNullOrEmpty(currentValue)) {
+newValue = currentValue + ";" + registeredNuageVspDevice;
+} else {
+newValue = registeredNuageVspDevice;
+}
+_configDao.update("nuagevsp.cms.id", newValue);
 }
-return true;
 }
 
-private void initNuageScheduledTasks() {
-Integer numOfSyncThreads = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncWorkers.key()));
-Integer syncUpIntervalInMinutes = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncInterval.key()));
-
-if (numOfSyncThreads != null && syncUpIntervalInMinutes != null) {
-ThreadFactory threadFactory = new ThreadFactory() {
-public Thread newThread(Runnable runnable) {
-Thread thread = new Thread(runnable, "Nuage Vsp sync 
task");
-if (thread.isDaemon())
-thread.setDaemon(false);
-if (thread.getPriority() != Thread.NORM_PRIORITY)
-thread.setPriority(Thread.NORM_PRIORITY);
-return thread;
+private void auditHost(HostVO host) {
+_hostDao.loadDetails(host);
+
+boolean validateDomains = true;
+List nuageVspDevices = 
_nuageVspDao.listByHost(host.getId());
+if (!CollectionUtils.isEmpty(nuageVspDevices)) {
+for (NuageVspDeviceVO nuageVspDevice : nuageVspDevices) {
+ConfigurationVO cmsIdConfig = 
_configDao.findByName("nuagevsp.cms.id");
+String nuageVspCmsId = 
findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig);
+SyncNuageVspCmsIdCommand syncCmd = new 
SyncNuageVspCmsIdCommand(SyncType.AUDIT, nuageVspCmsId);
+SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) 
_agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd);
+
+if (answer != null && !answer.getSuccess()) {
+s_logger.error("Nuage VSP Device with ID " + 
nuageVspDevice.getId() + " is configured with an unknown CMS ID!");
+validateDomains = false;
+} else if (answer != null && answer.getSyncType() == 
SyncType.REGISTER) {
+registerNewNuageVspDevice(cmsIdConfig, 
nuageVspDevice.getId() + ":" + answer.getNuageVspCmsId());
 }
-};
-scheduler = Executors.newScheduledThreadPool(numOfSyncThreads, 
threadFactory);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("FLOATING_IP"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE_NTWK_MACRO"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler
-.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, TimeUnit.MILLISECONDS);
-} else {
-s_logger.warn("NuageVsp configuration for syncWorkers=" + 
numOfSyncThreads + " syncInterval=" + syncUpIntervalInMinutes
-+ " could not be read properly. So, check if the 
properties are configured properly 

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43104591
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java
 ---
@@ -170,20 +169,18 @@ public boolean configure(String name, Map params) throws Configu
 throw new ConfigurationException("Unable to find retry 
interval");
 }
 
-_relativePath = new 
StringBuffer().append("https://;).append(hostname).append(":").append(port).append(apiRelativePath).toString();
+_relativePath = new 
StringBuffer().append("https://;).append(_hostName).append(":").append(port).append(apiRelativePath).toString();
 
 String cmsUserPass = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.decodeBase64(cmsUserPassBase64));
 _cmsUserInfo = new String[] {CMS_USER_ENTEPRISE_NAME, cmsUser, 
cmsUserPass};
 
-try {
-loadNuageClient();
-} catch (Exception e) {
-throw new CloudRuntimeException("Failed to login to Nuage VSD 
on " + name + " as user " + cmsUser, e);
-}
+_nuageVspCmsId = (String)params.get("nuagevspcmsid");
+
+loadNuageClient();
 
 try {
 login();
-} catch (Exception e) {
+} catch (ExecutionException | ConfigurationException e) {
 s_logger.error("Failed to login to Nuage VSD on " + name + " 
as user " + cmsUser + " Exception " + e.getMessage());
--- End diff --

Done.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

2015-10-27 Thread bhaisaab
Github user bhaisaab commented on the pull request:

https://github.com/apache/cloudstack/pull/977#issuecomment-151447134
  
@ustcweizhou Can you add some unit tests for the new methods and classes, 
thanks


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

2015-10-27 Thread bhaisaab
Github user bhaisaab commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/977#discussion_r43104526
  
--- Diff: 
api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java
 ---
@@ -0,0 +1,197 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.snapshot;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.BaseAsyncCreateCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.SnapshotResponse;
+import org.apache.cloudstack.api.response.VMSnapshotResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.PermissionDeniedException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.projects.Project;
+import com.cloud.storage.Snapshot;
+import com.cloud.user.Account;
+import com.cloud.uservm.UserVm;
+import com.cloud.vm.snapshot.VMSnapshot;
+
+@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates 
an instant snapshot of a volume from vm snapshot.", responseObject = 
SnapshotResponse.class)
+public class CreateSnapshotFromVMSnapshotCmd extends BaseAsyncCreateCmd {
+public static final Logger s_logger = 
Logger.getLogger(CreateSnapshotFromVMSnapshotCmd.class.getName());
+private static final String s_name = 
"createsnapshotfromvmsnapshotresponse";
+
+// ///
+// // API parameters /
+// ///
+
+@Parameter(name=ApiConstants.VM_SNAPSHOT_ID, type=CommandType.UUID, 
entityType=VMSnapshotResponse.class,
+required=true, description="The ID of the VM snapshot")
+ private Long vmSnapshotId;
+
+@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, 
description = "the name of the snapshot")
+private String snapshotName;
+
+private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;
+
+// ///
+// / Accessors ///
+// ///
+
+public Long getVMSnapshotId() {
+return vmSnapshotId;
+}
+
+public String getSnapshotName() {
+return snapshotName;
+}
+
+private Long getVmId() {
+VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, 
getVMSnapshotId());
+if (vmsnapshot == null) {
+throw new InvalidParameterValueException("Unable to find vm 
snapshot by id=" + getVMSnapshotId());
+}
+UserVm vm = _entityMgr.findById(UserVm.class, 
vmsnapshot.getVmId());
+if (vm == null) {
+throw new InvalidParameterValueException("Unable to find vm by 
vm snapshot id=" + getVMSnapshotId());
+}
+return vm.getId();
+}
+private Long getHostId() {
+VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, 
getVMSnapshotId());
+if (vmsnapshot == null) {
+throw new InvalidParameterValueException("Unable to find vm 
snapshot by id=" + getVMSnapshotId());
+}
+UserVm vm = _entityMgr.findById(UserVm.class, 
vmsnapshot.getVmId());
+if (vm != null) {
+if(vm.getHostId() != null) {
+return vm.getHostId();
+} else if(vm.getLastHostId() != null) {
+   

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43104632
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java
 ---
@@ -191,36 +188,26 @@ public boolean configure(String name, Map params) throws Configu
 return true;
 }
 
-protected void login() throws Exception {
+protected void login() throws ConfigurationException, 
ExecutionException {
 isNuageVspApiLoaded();
 _nuageVspApiClient.login();
 }
 
-protected  void loadNuageClient() throws Exception {
+protected  void loadNuageClient() {
 
 try {
-ClassLoader loader = 
NuageVspPluginClientLoader.getClassLoader(NUAGE_PLUGIN_CLIENT_JAR_FILE);
-
-Class nuageVspApiClientClass = 
Class.forName(NUAGE_VSP_API_CLIENT_IMPL, true, loader);
-Class nuageVspSyncClientClass = 
Class.forName(NUAGE_VSP_SYNC_CLIENT_IMPL, true, loader);
-Class nuageVspGuruClientClass = 
Class.forName(NUAGE_VSP_GURU_CLIENT_IMPL, true, loader);
-Class nuageVspElementClientClass = 
Class.forName(NUAGE_VSP_ELEMENT_CLIENT_IMPL, true, loader);
-
-//Instantiate the instances
-_nuageVspApiClient = 
(NuageVspApiClient)nuageVspApiClientClass.newInstance();
-_nuageVspApiClient.setNuageVspHost(_relativePath, 
_cmsUserInfo, _numRetries, _retryInterval);
-_nuageVspSyncClient = 
(NuageVspSyncClient)nuageVspSyncClientClass.newInstance();
-_nuageVspSyncClient.setNuageVspApiClient(_nuageVspApiClient);
-_nuageVspGuruClient = 
(NuageVspGuruClient)nuageVspGuruClientClass.newInstance();
-_nuageVspGuruClient.setNuageVspApiClient(_nuageVspApiClient);
-_nuageVspElementClient = 
(NuageVspElementClient)nuageVspElementClientClass.newInstance();
-
_nuageVspElementClient.setNuageVspApiClient(_nuageVspApiClient);
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(_relativePath, _cmsUserInfo, 
_numRetries, _retryInterval, _nuageVspCmsId);
+_nuageVspApiClient = clientLoader.getNuageVspApiClient();
+_nuageVspSyncClient = clientLoader.getNuageVspSyncClient();
+_nuageVspGuruClient = clientLoader.getNuageVspGuruClient();
+_nuageVspElementClient = 
clientLoader.getNuageVspElementClient();
+_nuageVspManagerClient = 
clientLoader.getNuageVspManagerClient();
 _isNuageVspClientLoaded = true;
-} catch (Exception e) {
+} catch (ConfigurationException e) {
 _isNuageVspClientLoaded = false;
 String errorMessage = "Nuage Vsp Plugin client is not yet 
installed. Please install NuageVsp plugin client to use NuageVsp plugin in 
Cloudstack. ";
 s_logger.warn(errorMessage + e.getMessage());
--- End diff --

Done and done.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

2015-10-27 Thread wido
Github user wido commented on the pull request:

https://github.com/apache/cloudstack/pull/977#issuecomment-151442130
  
@DaanHoogland Indeed, that is the case.

The problems I had were with libvirt, not the bindings. libvirt-java is 
distributed via Maven and we include it in our pom.xml as a repository to 
libvirt.org/maven

libvirt-java is not distributed via DEB or RPM.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43102867
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +241,185 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
-return Transaction.execute(new 
TransactionCallback() {
-@Override
-public NuageVspDeviceVO 
doInTransaction(TransactionStatus status) {
-NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvcProvider.getProviderName(), deviceName);
-_nuageVspDao.persist(nuageVspDevice);
-
-DetailVO detail = new DetailVO(host.getId(), 
"nuagevspdeviceid", String.valueOf(nuageVspDevice.getId()));
-_hostDetailsDao.persist(detail);
-
-return nuageVspDevice;
-}
-  

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43102851
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +241,185 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
-return Transaction.execute(new 
TransactionCallback() {
-@Override
-public NuageVspDeviceVO 
doInTransaction(TransactionStatus status) {
-NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvcProvider.getProviderName(), deviceName);
-_nuageVspDao.persist(nuageVspDevice);
-
-DetailVO detail = new DetailVO(host.getId(), 
"nuagevspdeviceid", String.valueOf(nuageVspDevice.getId()));
-_hostDetailsDao.persist(detail);
-
-return nuageVspDevice;
-}
-  

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

2015-10-27 Thread bhaisaab
Github user bhaisaab commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/977#discussion_r43104473
  
--- Diff: 
api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java
 ---
@@ -0,0 +1,197 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.snapshot;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.BaseAsyncCreateCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.SnapshotResponse;
+import org.apache.cloudstack.api.response.VMSnapshotResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.PermissionDeniedException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.projects.Project;
+import com.cloud.storage.Snapshot;
+import com.cloud.user.Account;
+import com.cloud.uservm.UserVm;
+import com.cloud.vm.snapshot.VMSnapshot;
+
+@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates 
an instant snapshot of a volume from vm snapshot.", responseObject = 
SnapshotResponse.class)
+public class CreateSnapshotFromVMSnapshotCmd extends BaseAsyncCreateCmd {
+public static final Logger s_logger = 
Logger.getLogger(CreateSnapshotFromVMSnapshotCmd.class.getName());
+private static final String s_name = 
"createsnapshotfromvmsnapshotresponse";
+
+// ///
+// // API parameters /
+// ///
+
+@Parameter(name=ApiConstants.VM_SNAPSHOT_ID, type=CommandType.UUID, 
entityType=VMSnapshotResponse.class,
+required=true, description="The ID of the VM snapshot")
+ private Long vmSnapshotId;
+
+@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, 
description = "the name of the snapshot")
+private String snapshotName;
+
+private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;
+
+// ///
+// / Accessors ///
+// ///
+
+public Long getVMSnapshotId() {
+return vmSnapshotId;
+}
+
+public String getSnapshotName() {
+return snapshotName;
+}
+
+private Long getVmId() {
+VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, 
getVMSnapshotId());
+if (vmsnapshot == null) {
+throw new InvalidParameterValueException("Unable to find vm 
snapshot by id=" + getVMSnapshotId());
+}
+UserVm vm = _entityMgr.findById(UserVm.class, 
vmsnapshot.getVmId());
+if (vm == null) {
+throw new InvalidParameterValueException("Unable to find vm by 
vm snapshot id=" + getVMSnapshotId());
+}
+return vm.getId();
+}
+private Long getHostId() {
+VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, 
getVMSnapshotId());
+if (vmsnapshot == null) {
+throw new InvalidParameterValueException("Unable to find vm 
snapshot by id=" + getVMSnapshotId());
+}
+UserVm vm = _entityMgr.findById(UserVm.class, 
vmsnapshot.getVmId());
+if (vm != null) {
+if(vm.getHostId() != null) {
+return vm.getHostId();
+} else if(vm.getLastHostId() != null) {
+   

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

2015-10-27 Thread bhaisaab
Github user bhaisaab commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/977#discussion_r43104502
  
--- Diff: 
api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java
 ---
@@ -0,0 +1,197 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.snapshot;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.BaseAsyncCreateCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.SnapshotResponse;
+import org.apache.cloudstack.api.response.VMSnapshotResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.PermissionDeniedException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.projects.Project;
+import com.cloud.storage.Snapshot;
+import com.cloud.user.Account;
+import com.cloud.uservm.UserVm;
+import com.cloud.vm.snapshot.VMSnapshot;
+
+@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates 
an instant snapshot of a volume from vm snapshot.", responseObject = 
SnapshotResponse.class)
+public class CreateSnapshotFromVMSnapshotCmd extends BaseAsyncCreateCmd {
+public static final Logger s_logger = 
Logger.getLogger(CreateSnapshotFromVMSnapshotCmd.class.getName());
+private static final String s_name = 
"createsnapshotfromvmsnapshotresponse";
+
+// ///
+// // API parameters /
+// ///
+
+@Parameter(name=ApiConstants.VM_SNAPSHOT_ID, type=CommandType.UUID, 
entityType=VMSnapshotResponse.class,
+required=true, description="The ID of the VM snapshot")
+ private Long vmSnapshotId;
+
+@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, 
description = "the name of the snapshot")
+private String snapshotName;
+
+private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;
+
+// ///
+// / Accessors ///
+// ///
+
+public Long getVMSnapshotId() {
+return vmSnapshotId;
+}
+
+public String getSnapshotName() {
+return snapshotName;
+}
+
+private Long getVmId() {
+VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, 
getVMSnapshotId());
+if (vmsnapshot == null) {
+throw new InvalidParameterValueException("Unable to find vm 
snapshot by id=" + getVMSnapshotId());
+}
+UserVm vm = _entityMgr.findById(UserVm.class, 
vmsnapshot.getVmId());
+if (vm == null) {
+throw new InvalidParameterValueException("Unable to find vm by 
vm snapshot id=" + getVMSnapshotId());
+}
+return vm.getId();
+}
+private Long getHostId() {
+VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, 
getVMSnapshotId());
+if (vmsnapshot == null) {
+throw new InvalidParameterValueException("Unable to find vm 
snapshot by id=" + getVMSnapshotId());
+}
+UserVm vm = _entityMgr.findById(UserVm.class, 
vmsnapshot.getVmId());
+if (vm != null) {
+if(vm.getHostId() != null) {
+return vm.getHostId();
+} else if(vm.getLastHostId() != null) {
+   

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43104873
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/NuageVspPluginClientLoader.java
 ---
@@ -19,28 +19,101 @@
 
 package net.nuage.vsp.acs;
 
+import net.nuage.vsp.acs.client.NuageVspApiClient;
+import net.nuage.vsp.acs.client.NuageVspElementClient;
+import net.nuage.vsp.acs.client.NuageVspGuruClient;
+import net.nuage.vsp.acs.client.NuageVspManagerClient;
+import net.nuage.vsp.acs.client.NuageVspSyncClient;
+import org.apache.log4j.Logger;
+
+import javax.naming.ConfigurationException;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
 
 public class NuageVspPluginClientLoader {
 
-private static NuageVspPluginClientLoader 
nuageVspPluginClientClassloader;
-private ClassLoader loader = null;
+private ClassLoader _loader = null;
+private static final Logger s_logger = 
Logger.getLogger(NuageVspPluginClientLoader.class);
+
+private NuageVspApiClient _nuageVspApiClient;
+private NuageVspElementClient _nuageVspElementClient;
+private NuageVspGuruClient _nuageVspGuruClient;
+private NuageVspManagerClient _nuageVspManagerClient;
+private NuageVspSyncClient _nuageVspSyncClient;
+
+private static final String NUAGE_PLUGIN_CLIENT_JAR_FILE = 
"/usr/share/nuagevsp/lib/nuage-vsp-acs-client.jar";
+private static final String NUAGE_VSP_API_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspApiClientImpl";
+private static final String NUAGE_VSP_SYNC_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspSyncClientImpl";
+private static final String NUAGE_VSP_ELEMENT_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspElementClientImpl";
+private static final String NUAGE_VSP_GURU_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspGuruClientImpl";
+private static final String NUAGE_VSP_MANAGER_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspManagerClientImpl";
 
 private NuageVspPluginClientLoader(String 
nuagePluginClientJarLocation) {
 try {
-loader = URLClassLoader.newInstance(new URL[] {new 
URL("jar:file:" + nuagePluginClientJarLocation + "!/")},
+_loader = URLClassLoader.newInstance(new URL[] {new 
URL("jar:file:" + nuagePluginClientJarLocation + "!/")},
 getClass().getClassLoader());
 } catch (MalformedURLException e) {
-e.printStackTrace();
+throw new IllegalArgumentException(e);
 }
 }
 
-public static ClassLoader getClassLoader(String 
nuagePluginClientJarLocation) {
-if (nuageVspPluginClientClassloader == null) {
-nuageVspPluginClientClassloader = new 
NuageVspPluginClientLoader(nuagePluginClientJarLocation);
+public static NuageVspPluginClientLoader getClientLoader(String 
relativePath, String[] cmsUserInfo, int numRetries, int retryInterval,
+String nuageVspCmsId) throws ConfigurationException {
+NuageVspPluginClientLoader nuageVspPluginClientClassloader = new 
NuageVspPluginClientLoader(NUAGE_PLUGIN_CLIENT_JAR_FILE);
+nuageVspPluginClientClassloader.loadClasses(relativePath, 
cmsUserInfo, numRetries, retryInterval, nuageVspCmsId);
+return nuageVspPluginClientClassloader;
+}
+
+private void loadClasses(String relativePath, String[] cmsUserInfo, 
int numRetries, int retryInterval, String nuageVspCmsId) throws 
ConfigurationException {
+try {
+Class nuageVspApiClientClass = 
Class.forName(NUAGE_VSP_API_CLIENT_IMPL, true, _loader);
+Class nuageVspSyncClientClass = 
Class.forName(NUAGE_VSP_SYNC_CLIENT_IMPL, true, _loader);
+Class nuageVspGuruClientClass = 
Class.forName(NUAGE_VSP_GURU_CLIENT_IMPL, true, _loader);
+Class nuageVspElementClientClass = 
Class.forName(NUAGE_VSP_ELEMENT_CLIENT_IMPL, true, _loader);
+Class nuageVspManagerClientClass = 
Class.forName(NUAGE_VSP_MANAGER_CLIENT_IMPL, true, _loader);
+
+//Instantiate the instances
+_nuageVspApiClient = 
(NuageVspApiClient)nuageVspApiClientClass.newInstance();
+_nuageVspApiClient.setNuageVspHost(relativePath, cmsUserInfo, 
numRetries, retryInterval, nuageVspCmsId);
+_nuageVspSyncClient = 
(NuageVspSyncClient)nuageVspSyncClientClass.newInstance();
+_nuageVspSyncClient.setNuageVspApiClient(_nuageVspApiClient);
+_nuageVspGuruClient = 
(NuageVspGuruClient)nuageVspGuruClientClass.newInstance();
+_nuageVspGuruClient.setNuageVspApiClient(_nuageVspApiClient);
+

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43104885
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/NuageVspPluginClientLoader.java
 ---
@@ -19,28 +19,101 @@
 
 package net.nuage.vsp.acs;
 
+import net.nuage.vsp.acs.client.NuageVspApiClient;
+import net.nuage.vsp.acs.client.NuageVspElementClient;
+import net.nuage.vsp.acs.client.NuageVspGuruClient;
+import net.nuage.vsp.acs.client.NuageVspManagerClient;
+import net.nuage.vsp.acs.client.NuageVspSyncClient;
+import org.apache.log4j.Logger;
+
+import javax.naming.ConfigurationException;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
 
 public class NuageVspPluginClientLoader {
 
-private static NuageVspPluginClientLoader 
nuageVspPluginClientClassloader;
-private ClassLoader loader = null;
+private ClassLoader _loader = null;
+private static final Logger s_logger = 
Logger.getLogger(NuageVspPluginClientLoader.class);
+
+private NuageVspApiClient _nuageVspApiClient;
+private NuageVspElementClient _nuageVspElementClient;
+private NuageVspGuruClient _nuageVspGuruClient;
+private NuageVspManagerClient _nuageVspManagerClient;
+private NuageVspSyncClient _nuageVspSyncClient;
+
+private static final String NUAGE_PLUGIN_CLIENT_JAR_FILE = 
"/usr/share/nuagevsp/lib/nuage-vsp-acs-client.jar";
+private static final String NUAGE_VSP_API_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspApiClientImpl";
+private static final String NUAGE_VSP_SYNC_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspSyncClientImpl";
+private static final String NUAGE_VSP_ELEMENT_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspElementClientImpl";
+private static final String NUAGE_VSP_GURU_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspGuruClientImpl";
+private static final String NUAGE_VSP_MANAGER_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspManagerClientImpl";
 
 private NuageVspPluginClientLoader(String 
nuagePluginClientJarLocation) {
 try {
-loader = URLClassLoader.newInstance(new URL[] {new 
URL("jar:file:" + nuagePluginClientJarLocation + "!/")},
+_loader = URLClassLoader.newInstance(new URL[] {new 
URL("jar:file:" + nuagePluginClientJarLocation + "!/")},
 getClass().getClassLoader());
 } catch (MalformedURLException e) {
-e.printStackTrace();
+throw new IllegalArgumentException(e);
 }
 }
 
-public static ClassLoader getClassLoader(String 
nuagePluginClientJarLocation) {
-if (nuageVspPluginClientClassloader == null) {
-nuageVspPluginClientClassloader = new 
NuageVspPluginClientLoader(nuagePluginClientJarLocation);
+public static NuageVspPluginClientLoader getClientLoader(String 
relativePath, String[] cmsUserInfo, int numRetries, int retryInterval,
+String nuageVspCmsId) throws ConfigurationException {
+NuageVspPluginClientLoader nuageVspPluginClientClassloader = new 
NuageVspPluginClientLoader(NUAGE_PLUGIN_CLIENT_JAR_FILE);
+nuageVspPluginClientClassloader.loadClasses(relativePath, 
cmsUserInfo, numRetries, retryInterval, nuageVspCmsId);
+return nuageVspPluginClientClassloader;
+}
+
+private void loadClasses(String relativePath, String[] cmsUserInfo, 
int numRetries, int retryInterval, String nuageVspCmsId) throws 
ConfigurationException {
+try {
+Class nuageVspApiClientClass = 
Class.forName(NUAGE_VSP_API_CLIENT_IMPL, true, _loader);
+Class nuageVspSyncClientClass = 
Class.forName(NUAGE_VSP_SYNC_CLIENT_IMPL, true, _loader);
+Class nuageVspGuruClientClass = 
Class.forName(NUAGE_VSP_GURU_CLIENT_IMPL, true, _loader);
+Class nuageVspElementClientClass = 
Class.forName(NUAGE_VSP_ELEMENT_CLIENT_IMPL, true, _loader);
+Class nuageVspManagerClientClass = 
Class.forName(NUAGE_VSP_MANAGER_CLIENT_IMPL, true, _loader);
+
+//Instantiate the instances
+_nuageVspApiClient = 
(NuageVspApiClient)nuageVspApiClientClass.newInstance();
+_nuageVspApiClient.setNuageVspHost(relativePath, cmsUserInfo, 
numRetries, retryInterval, nuageVspCmsId);
+_nuageVspSyncClient = 
(NuageVspSyncClient)nuageVspSyncClientClass.newInstance();
+_nuageVspSyncClient.setNuageVspApiClient(_nuageVspApiClient);
+_nuageVspGuruClient = 
(NuageVspGuruClient)nuageVspGuruClientClass.newInstance();
+_nuageVspGuruClient.setNuageVspApiClient(_nuageVspApiClient);
+

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43104880
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/NuageVspPluginClientLoader.java
 ---
@@ -19,28 +19,101 @@
 
 package net.nuage.vsp.acs;
 
+import net.nuage.vsp.acs.client.NuageVspApiClient;
+import net.nuage.vsp.acs.client.NuageVspElementClient;
+import net.nuage.vsp.acs.client.NuageVspGuruClient;
+import net.nuage.vsp.acs.client.NuageVspManagerClient;
+import net.nuage.vsp.acs.client.NuageVspSyncClient;
+import org.apache.log4j.Logger;
+
+import javax.naming.ConfigurationException;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
 
 public class NuageVspPluginClientLoader {
 
-private static NuageVspPluginClientLoader 
nuageVspPluginClientClassloader;
-private ClassLoader loader = null;
+private ClassLoader _loader = null;
+private static final Logger s_logger = 
Logger.getLogger(NuageVspPluginClientLoader.class);
+
+private NuageVspApiClient _nuageVspApiClient;
+private NuageVspElementClient _nuageVspElementClient;
+private NuageVspGuruClient _nuageVspGuruClient;
+private NuageVspManagerClient _nuageVspManagerClient;
+private NuageVspSyncClient _nuageVspSyncClient;
+
+private static final String NUAGE_PLUGIN_CLIENT_JAR_FILE = 
"/usr/share/nuagevsp/lib/nuage-vsp-acs-client.jar";
+private static final String NUAGE_VSP_API_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspApiClientImpl";
+private static final String NUAGE_VSP_SYNC_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspSyncClientImpl";
+private static final String NUAGE_VSP_ELEMENT_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspElementClientImpl";
+private static final String NUAGE_VSP_GURU_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspGuruClientImpl";
+private static final String NUAGE_VSP_MANAGER_CLIENT_IMPL = 
"net.nuage.vsp.acs.client.impl.NuageVspManagerClientImpl";
 
 private NuageVspPluginClientLoader(String 
nuagePluginClientJarLocation) {
 try {
-loader = URLClassLoader.newInstance(new URL[] {new 
URL("jar:file:" + nuagePluginClientJarLocation + "!/")},
+_loader = URLClassLoader.newInstance(new URL[] {new 
URL("jar:file:" + nuagePluginClientJarLocation + "!/")},
 getClass().getClassLoader());
 } catch (MalformedURLException e) {
-e.printStackTrace();
+throw new IllegalArgumentException(e);
 }
 }
 
-public static ClassLoader getClassLoader(String 
nuagePluginClientJarLocation) {
-if (nuageVspPluginClientClassloader == null) {
-nuageVspPluginClientClassloader = new 
NuageVspPluginClientLoader(nuagePluginClientJarLocation);
+public static NuageVspPluginClientLoader getClientLoader(String 
relativePath, String[] cmsUserInfo, int numRetries, int retryInterval,
+String nuageVspCmsId) throws ConfigurationException {
+NuageVspPluginClientLoader nuageVspPluginClientClassloader = new 
NuageVspPluginClientLoader(NUAGE_PLUGIN_CLIENT_JAR_FILE);
+nuageVspPluginClientClassloader.loadClasses(relativePath, 
cmsUserInfo, numRetries, retryInterval, nuageVspCmsId);
+return nuageVspPluginClientClassloader;
+}
+
+private void loadClasses(String relativePath, String[] cmsUserInfo, 
int numRetries, int retryInterval, String nuageVspCmsId) throws 
ConfigurationException {
+try {
+Class nuageVspApiClientClass = 
Class.forName(NUAGE_VSP_API_CLIENT_IMPL, true, _loader);
+Class nuageVspSyncClientClass = 
Class.forName(NUAGE_VSP_SYNC_CLIENT_IMPL, true, _loader);
+Class nuageVspGuruClientClass = 
Class.forName(NUAGE_VSP_GURU_CLIENT_IMPL, true, _loader);
+Class nuageVspElementClientClass = 
Class.forName(NUAGE_VSP_ELEMENT_CLIENT_IMPL, true, _loader);
+Class nuageVspManagerClientClass = 
Class.forName(NUAGE_VSP_MANAGER_CLIENT_IMPL, true, _loader);
+
+//Instantiate the instances
+_nuageVspApiClient = 
(NuageVspApiClient)nuageVspApiClientClass.newInstance();
+_nuageVspApiClient.setNuageVspHost(relativePath, cmsUserInfo, 
numRetries, retryInterval, nuageVspCmsId);
+_nuageVspSyncClient = 
(NuageVspSyncClient)nuageVspSyncClientClass.newInstance();
+_nuageVspSyncClient.setNuageVspApiClient(_nuageVspApiClient);
+_nuageVspGuruClient = 
(NuageVspGuruClient)nuageVspGuruClientClass.newInstance();
+_nuageVspGuruClient.setNuageVspApiClient(_nuageVspApiClient);
+

Cloudmonkey column output is mixed up

2015-10-27 Thread Norbert Klein
Cloudmonkey 5.3.1.

The position of columns in the output is mixed up.


> cloudmonkey list virtualmachines listall=true
projectid=4865e6c6-b1ff-48ef-b908-1f5fde7d7b6e
filter=id,name,cpunumber,cpuspeed,memory,created  
count = 16
virtualmachine:
+---+--+--+++--+
| cpunumber |  id  | *cpuspeed* | memory
|  name  | created  |
+---+--+--+++--+
| 4 | cae26368-b450-48ef-9069-234039886ef4 |   2000   | 16384  |
bts005 | 2014-05-09T14:43:13+0200 |
| 2 | 8f3faedc-2401-4eed-9f81-4f160d3590c0 |   2400   | 16384  |
bts004 | 2014-11-07T12:21:07+0100 |
| 4 | 56f9e32d-b22c-4bba-a13a-ea13ee21aa27 |   2000   | 32768  |
bts003 | 2014-05-09T14:37:51+0200 |
| 4 | 5baf56dd-f019-4f15-acdc-6a58df67ad13 |   2000   | 32768  |
BTS013 | 2014-04-30T14:17:27+0200 |
| 1 | 17fcfd30-1fe9-44bc-897a-5228fbc0c6f7 |   2400   |  4096  |
bts002 | 2014-05-09T14:36:28+0200 |
| 4 | 246e26b6-98a5-4dd0-8270-cb2bfc8ccc8d |   2000   | 16384  |
bts008 | 2015-06-03T16:35:14+0200 |
+---+--+--+++--+
+---+--++--++--+
| cpunumber |  id  | memory | *cpuspeed*
|  name  | created  |
+---+--++--++--+
| 2 | 965d670a-c285-42f0-851b-16a40a4f8c8b |  2048  |   2048   |
bts015 | 2014-07-30T15:11:16+0200 |
| 2 | 50a91e18-4b12-4568-83b6-81594264cf99 |  2048  |   2048   |
bts001 | 2014-04-30T10:11:31+0200 |
+---+--++--++--+
+---+--+--+++--+
| cpunumber |  id  | *cpuspeed* | memory
|  name  | created  |
+---+--+--+++--+
| 4 | 678ba9a3-17ec-40f0-9ad5-f8f3b86807d7 |   2400   | 32768  |
bts017 | 2015-05-28T14:25:21+0200 |
| 2 | 7324be80-590e-4088-bf04-f4ab5e441904 |   2000   |  8192  |
bts007 | 2015-04-27T15:48:56+0200 |
| 2 | 3649e7fb-ab7d-4d13-a847-f6db84da47ba |   2000   |  8192  |
bts016 | 2014-12-09T16:38:01+0100 |
+---+--+--+++--+
+---+--++--++--+
| cpunumber |  id  | memory | *cpuspeed*
|  name  | created  |
+---+--++--++--+
| 2 | f155b013-1946-450d-8c5f-f3002861d93b | 16384  |   2400   |
bts006 | 2015-07-23T16:12:53+0200 |
| 2 | 2360e425-1171-4ad7-a6b3-eec403486b19 |  8192  |   2400   |
bts014 | 2014-09-24T09:29:01+0200 |
+---+--++--++--+
+---+--+--+++--+
| cpunumber |  id  | *cpuspeed* | memory
|  name  | created  |
+---+--+--+++--+
| 1 | fb0c0a75-13ef-4c69-9dd0-00e008812187 |   2400   |  8192  |
bts012 | 2014-05-09T15:10:41+0200 |
| 4 | d7e35046-904f-4ad9-8242-2326f1d4f30f |   2000   | 16384  |
bts011 | 2014-05-09T15:09:35+0200 |
+---+--+--+++--+
+---+--++--++--+
| cpunumber |  id  | memory | *cpuspeed*
|  name  | created  |
+---+--++--++--+
| 1 | 2ed69579-0298-4a93-aa63-28b27afc902a | 12288  |   2400   |
bts010 | 2014-05-09T15:08:16+0200 |
+---+--++--++--+


Regards
Norbert



[GitHub] cloudstack pull request: Update L10N files for Next 4.6.

2015-10-27 Thread remibergsma
Github user remibergsma commented on the pull request:

https://github.com/apache/cloudstack/pull/984#issuecomment-151455654
  
Thanks for the update @milamberspace !


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

2015-10-27 Thread DaanHoogland
Github user DaanHoogland commented on the pull request:

https://github.com/apache/cloudstack/pull/977#issuecomment-151440654
  
So @wido , is the discussion whether we should change libvirt-java and 
contribute back or use virsh?

I'm all for the first one but I recall problems you had with getting those 
people to upgrade their distro. so maybe forking and sending patches (more 
maintenance but also more control) is a good middle ground?

As for the feature; it is a customer request so for me as dev a must have.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8715: Add VirtIO channel to al...

2015-10-27 Thread wido
GitHub user wido opened a pull request:

https://github.com/apache/cloudstack/pull/985

CLOUDSTACK-8715: Add VirtIO channel to all Instances for the Qemu Gue…

…st Agent

This commit adds a additional VirtIO channel with the name 
'org.qemu.guest_agent.0'
to all Instances.

With the Qemu Guest Agent the Hypervisor gains more control over the 
Instance if
these tools are present inside the Instance, for example:

* Power control
* Flushing filesystems

In the future this should allow safer snapshots on KVM since we can 
instruct the
Instance to flush the filesystems prior to snapshotting the disk.

More information: http://wiki.qemu.org/Features/QAPI/GuestAgent

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/wido/cloudstack CLOUDSTACK-8715

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cloudstack/pull/985.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #985


commit 10447b262c30d03bc50cfba869d6e0c5957d8926
Author: Wido den Hollander 
Date:   2015-10-27T10:03:49Z

CLOUDSTACK-8715: Add VirtIO channel to all Instances for the Qemu Guest 
Agent

This commit adds a additional VirtIO channel with the name 
'org.qemu.guest_agent.0'
to all Instances.

With the Qemu Guest Agent the Hypervisor gains more control over the 
Instance if
these tools are present inside the Instance, for example:

* Power control
* Flushing filesystems

In the future this should allow safer snapshots on KVM since we can 
instruct the
Instance to flush the filesystems prior to snapshotting the disk.

More information: http://wiki.qemu.org/Features/QAPI/GuestAgent




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43102747
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +241,185 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
--- End diff --

Done.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43103443
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -285,60 +529,334 @@ public boolean 
deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) {
 return responseList;
 }
 
-@Override
-public boolean configure(String name, Map params) 
throws ConfigurationException {
-try {
-initNuageScheduledTasks();
-} catch (Exception ce) {
-s_logger.warn("Failed to load NuageVsp configuration 
properties. Check if the NuageVsp properties are configured correctly");
+private void registerNewNuageVspDevice(ConfigurationVO currentConfig, 
String registeredNuageVspDevice) {
+if (currentConfig == null) {
+ConfigKey configKey = new 
ConfigKey("Advanced", String.class, "nuagevsp.cms.id", 
registeredNuageVspDevice,
+": - Do 
not edit", false);
+ConfigurationVO configuration = new 
ConfigurationVO("management-server", configKey);
+_configDao.persist(configuration);
+} else {
+String newValue;
+String currentValue = currentConfig.getValue();
+if (!Strings.isNullOrEmpty(currentValue)) {
+newValue = currentValue + ";" + registeredNuageVspDevice;
+} else {
+newValue = registeredNuageVspDevice;
+}
+_configDao.update("nuagevsp.cms.id", newValue);
 }
-return true;
 }
 
-private void initNuageScheduledTasks() {
-Integer numOfSyncThreads = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncWorkers.key()));
-Integer syncUpIntervalInMinutes = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncInterval.key()));
-
-if (numOfSyncThreads != null && syncUpIntervalInMinutes != null) {
-ThreadFactory threadFactory = new ThreadFactory() {
-public Thread newThread(Runnable runnable) {
-Thread thread = new Thread(runnable, "Nuage Vsp sync 
task");
-if (thread.isDaemon())
-thread.setDaemon(false);
-if (thread.getPriority() != Thread.NORM_PRIORITY)
-thread.setPriority(Thread.NORM_PRIORITY);
-return thread;
+private void auditHost(HostVO host) {
+_hostDao.loadDetails(host);
+
+boolean validateDomains = true;
+List nuageVspDevices = 
_nuageVspDao.listByHost(host.getId());
+if (!CollectionUtils.isEmpty(nuageVspDevices)) {
+for (NuageVspDeviceVO nuageVspDevice : nuageVspDevices) {
+ConfigurationVO cmsIdConfig = 
_configDao.findByName("nuagevsp.cms.id");
+String nuageVspCmsId = 
findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig);
+SyncNuageVspCmsIdCommand syncCmd = new 
SyncNuageVspCmsIdCommand(SyncType.AUDIT, nuageVspCmsId);
+SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) 
_agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd);
+
+if (answer != null && !answer.getSuccess()) {
+s_logger.error("Nuage VSP Device with ID " + 
nuageVspDevice.getId() + " is configured with an unknown CMS ID!");
+validateDomains = false;
+} else if (answer != null && answer.getSyncType() == 
SyncType.REGISTER) {
+registerNewNuageVspDevice(cmsIdConfig, 
nuageVspDevice.getId() + ":" + answer.getNuageVspCmsId());
 }
-};
-scheduler = Executors.newScheduledThreadPool(numOfSyncThreads, 
threadFactory);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("FLOATING_IP"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE_NTWK_MACRO"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler
-.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, TimeUnit.MILLISECONDS);
-} else {
-s_logger.warn("NuageVsp configuration for syncWorkers=" + 
numOfSyncThreads + " syncInterval=" + syncUpIntervalInMinutes
-+ " could not be read properly. So, check if the 
properties are configured properly 

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

2015-10-27 Thread bhaisaab
Github user bhaisaab commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/977#discussion_r43104400
  
--- Diff: 
api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java
 ---
@@ -0,0 +1,197 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.snapshot;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.BaseAsyncCreateCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.SnapshotResponse;
+import org.apache.cloudstack.api.response.VMSnapshotResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.PermissionDeniedException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.projects.Project;
+import com.cloud.storage.Snapshot;
+import com.cloud.user.Account;
+import com.cloud.uservm.UserVm;
+import com.cloud.vm.snapshot.VMSnapshot;
+
+@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates 
an instant snapshot of a volume from vm snapshot.", responseObject = 
SnapshotResponse.class)
+public class CreateSnapshotFromVMSnapshotCmd extends BaseAsyncCreateCmd {
+public static final Logger s_logger = 
Logger.getLogger(CreateSnapshotFromVMSnapshotCmd.class.getName());
+private static final String s_name = 
"createsnapshotfromvmsnapshotresponse";
+
+// ///
+// // API parameters /
+// ///
+
+@Parameter(name=ApiConstants.VM_SNAPSHOT_ID, type=CommandType.UUID, 
entityType=VMSnapshotResponse.class,
+required=true, description="The ID of the VM snapshot")
+ private Long vmSnapshotId;
+
+@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, 
description = "the name of the snapshot")
+private String snapshotName;
+
+private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;
--- End diff --

What's the purpose or use of this?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

2015-10-27 Thread bhaisaab
Github user bhaisaab commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/977#discussion_r43104351
  
--- Diff: 
api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java
 ---
@@ -0,0 +1,191 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.snapshot;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.BaseAsyncCreateCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.SnapshotResponse;
+import org.apache.cloudstack.api.response.VMSnapshotResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.PermissionDeniedException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.projects.Project;
+import com.cloud.storage.Snapshot;
+import com.cloud.user.Account;
+import com.cloud.uservm.UserVm;
+import com.cloud.vm.snapshot.VMSnapshot;
+
+@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates 
an instant snapshot of a volume from vm snapshot.", responseObject = 
SnapshotResponse.class)
--- End diff --

Add from version in the @APICommand 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43104314
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java
 ---
@@ -112,8 +111,8 @@ public boolean configure(String name, Map params) throws Configu
 throw new ConfigurationException("Unable to find zone");
 }
 
-String hostname = (String)params.get("hostname");
-if (hostname == null) {
+_hostName = (String)params.get("hostname");
+if (_hostName == null) {
--- End diff --

Yes, changed for other fields which should not be empty as well.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8990: start a stopped machine ...

2015-10-27 Thread wido
Github user wido commented on the pull request:

https://github.com/apache/cloudstack/pull/978#issuecomment-151444216
  
LGTM

Nice feature indeed :)


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43103330
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +241,185 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
-return Transaction.execute(new 
TransactionCallback() {
-@Override
-public NuageVspDeviceVO 
doInTransaction(TransactionStatus status) {
-NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvcProvider.getProviderName(), deviceName);
-_nuageVspDao.persist(nuageVspDevice);
-
-DetailVO detail = new DetailVO(host.getId(), 
"nuagevspdeviceid", String.valueOf(nuageVspDevice.getId()));
-_hostDetailsDao.persist(detail);
-
-return nuageVspDevice;
-}
-  

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43104160
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -285,60 +529,334 @@ public boolean 
deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) {
 return responseList;
 }
 
-@Override
-public boolean configure(String name, Map params) 
throws ConfigurationException {
-try {
-initNuageScheduledTasks();
-} catch (Exception ce) {
-s_logger.warn("Failed to load NuageVsp configuration 
properties. Check if the NuageVsp properties are configured correctly");
+private void registerNewNuageVspDevice(ConfigurationVO currentConfig, 
String registeredNuageVspDevice) {
+if (currentConfig == null) {
+ConfigKey configKey = new 
ConfigKey("Advanced", String.class, "nuagevsp.cms.id", 
registeredNuageVspDevice,
+": - Do 
not edit", false);
+ConfigurationVO configuration = new 
ConfigurationVO("management-server", configKey);
+_configDao.persist(configuration);
+} else {
+String newValue;
+String currentValue = currentConfig.getValue();
+if (!Strings.isNullOrEmpty(currentValue)) {
+newValue = currentValue + ";" + registeredNuageVspDevice;
+} else {
+newValue = registeredNuageVspDevice;
+}
+_configDao.update("nuagevsp.cms.id", newValue);
 }
-return true;
 }
 
-private void initNuageScheduledTasks() {
-Integer numOfSyncThreads = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncWorkers.key()));
-Integer syncUpIntervalInMinutes = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncInterval.key()));
-
-if (numOfSyncThreads != null && syncUpIntervalInMinutes != null) {
-ThreadFactory threadFactory = new ThreadFactory() {
-public Thread newThread(Runnable runnable) {
-Thread thread = new Thread(runnable, "Nuage Vsp sync 
task");
-if (thread.isDaemon())
-thread.setDaemon(false);
-if (thread.getPriority() != Thread.NORM_PRIORITY)
-thread.setPriority(Thread.NORM_PRIORITY);
-return thread;
+private void auditHost(HostVO host) {
+_hostDao.loadDetails(host);
+
+boolean validateDomains = true;
+List nuageVspDevices = 
_nuageVspDao.listByHost(host.getId());
+if (!CollectionUtils.isEmpty(nuageVspDevices)) {
+for (NuageVspDeviceVO nuageVspDevice : nuageVspDevices) {
+ConfigurationVO cmsIdConfig = 
_configDao.findByName("nuagevsp.cms.id");
+String nuageVspCmsId = 
findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig);
+SyncNuageVspCmsIdCommand syncCmd = new 
SyncNuageVspCmsIdCommand(SyncType.AUDIT, nuageVspCmsId);
+SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) 
_agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd);
+
+if (answer != null && !answer.getSuccess()) {
+s_logger.error("Nuage VSP Device with ID " + 
nuageVspDevice.getId() + " is configured with an unknown CMS ID!");
+validateDomains = false;
+} else if (answer != null && answer.getSyncType() == 
SyncType.REGISTER) {
+registerNewNuageVspDevice(cmsIdConfig, 
nuageVspDevice.getId() + ":" + answer.getNuageVspCmsId());
 }
-};
-scheduler = Executors.newScheduledThreadPool(numOfSyncThreads, 
threadFactory);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("FLOATING_IP"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE_NTWK_MACRO"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler
-.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, TimeUnit.MILLISECONDS);
-} else {
-s_logger.warn("NuageVsp configuration for syncWorkers=" + 
numOfSyncThreads + " syncInterval=" + syncUpIntervalInMinutes
-+ " could not be read properly. So, check if the 
properties are configured properly 

Cloudmonkey usage data missing in output

2015-10-27 Thread Norbert Klein
Cloudmonkey 5.3.1.

Usage records are missing if a whole month is used as the time frame for
usagerecord type 6 although the usage data is in the database
So we have to call cloudmonkey for every single day in this case.


Large amounts of usage data is missing in the output:
cloudmonkey list usagerecords type=6 startdate=2015-09-01 enddate=2015-09-30


No data is missing in the output
cloudmonkey list usagerecords type=6 startdate=2015-09-01 enddate=2015-09-01
cloudmonkey list usagerecords type=6 startdate=2015-09-02 enddate=2015-09-02
...
cloudmonkey list usagerecords type=6 startdate=2015-09-30 enddate=2015-09-30


Regards
Norbert






[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43103148
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +241,185 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
-return Transaction.execute(new 
TransactionCallback() {
-@Override
-public NuageVspDeviceVO 
doInTransaction(TransactionStatus status) {
-NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvcProvider.getProviderName(), deviceName);
-_nuageVspDao.persist(nuageVspDevice);
-
-DetailVO detail = new DetailVO(host.getId(), 
"nuagevspdeviceid", String.valueOf(nuageVspDevice.getId()));
-_hostDetailsDao.persist(detail);
-
-return nuageVspDevice;
-}
-  

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43104184
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -285,60 +529,334 @@ public boolean 
deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) {
 return responseList;
 }
 
-@Override
-public boolean configure(String name, Map params) 
throws ConfigurationException {
-try {
-initNuageScheduledTasks();
-} catch (Exception ce) {
-s_logger.warn("Failed to load NuageVsp configuration 
properties. Check if the NuageVsp properties are configured correctly");
+private void registerNewNuageVspDevice(ConfigurationVO currentConfig, 
String registeredNuageVspDevice) {
+if (currentConfig == null) {
+ConfigKey configKey = new 
ConfigKey("Advanced", String.class, "nuagevsp.cms.id", 
registeredNuageVspDevice,
+": - Do 
not edit", false);
+ConfigurationVO configuration = new 
ConfigurationVO("management-server", configKey);
+_configDao.persist(configuration);
+} else {
+String newValue;
+String currentValue = currentConfig.getValue();
+if (!Strings.isNullOrEmpty(currentValue)) {
+newValue = currentValue + ";" + registeredNuageVspDevice;
+} else {
+newValue = registeredNuageVspDevice;
+}
+_configDao.update("nuagevsp.cms.id", newValue);
 }
-return true;
 }
 
-private void initNuageScheduledTasks() {
-Integer numOfSyncThreads = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncWorkers.key()));
-Integer syncUpIntervalInMinutes = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncInterval.key()));
-
-if (numOfSyncThreads != null && syncUpIntervalInMinutes != null) {
-ThreadFactory threadFactory = new ThreadFactory() {
-public Thread newThread(Runnable runnable) {
-Thread thread = new Thread(runnable, "Nuage Vsp sync 
task");
-if (thread.isDaemon())
-thread.setDaemon(false);
-if (thread.getPriority() != Thread.NORM_PRIORITY)
-thread.setPriority(Thread.NORM_PRIORITY);
-return thread;
+private void auditHost(HostVO host) {
+_hostDao.loadDetails(host);
+
+boolean validateDomains = true;
+List nuageVspDevices = 
_nuageVspDao.listByHost(host.getId());
+if (!CollectionUtils.isEmpty(nuageVspDevices)) {
+for (NuageVspDeviceVO nuageVspDevice : nuageVspDevices) {
+ConfigurationVO cmsIdConfig = 
_configDao.findByName("nuagevsp.cms.id");
+String nuageVspCmsId = 
findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig);
+SyncNuageVspCmsIdCommand syncCmd = new 
SyncNuageVspCmsIdCommand(SyncType.AUDIT, nuageVspCmsId);
+SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) 
_agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd);
+
+if (answer != null && !answer.getSuccess()) {
+s_logger.error("Nuage VSP Device with ID " + 
nuageVspDevice.getId() + " is configured with an unknown CMS ID!");
+validateDomains = false;
+} else if (answer != null && answer.getSyncType() == 
SyncType.REGISTER) {
+registerNewNuageVspDevice(cmsIdConfig, 
nuageVspDevice.getId() + ":" + answer.getNuageVspCmsId());
 }
-};
-scheduler = Executors.newScheduledThreadPool(numOfSyncThreads, 
threadFactory);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("FLOATING_IP"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE_NTWK_MACRO"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler
-.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, TimeUnit.MILLISECONDS);
-} else {
-s_logger.warn("NuageVsp configuration for syncWorkers=" + 
numOfSyncThreads + " syncInterval=" + syncUpIntervalInMinutes
-+ " could not be read properly. So, check if the 
properties are configured properly 

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

2015-10-27 Thread bhaisaab
Github user bhaisaab commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/977#discussion_r43104186
  
--- Diff: ui/scripts/cloudStack.js ---
@@ -22,13 +22,13 @@
 var sections = [];
 
 if (isAdmin()) {
-sections = ["dashboard", "instances", "storage", 
"network", "templates", "accounts", "domains", "events", "system", 
"global-settings", "configuration", "projects", "regions", "affinityGroups"];
+sections = ["dashboard", "instances", "storage", 
"network", "templates", "accounts", "domains", "events", "system", 
"global-settings", "configuration", "projects", "regions", "affinityGroups", 
"vmsnapshots"];
 } else if (isDomainAdmin()) {
-sections = ["dashboard", "instances", "storage", 
"network", "templates", "accounts", "domains", "events", "projects", 
"configuration", "regions", "affinityGroups"];
+sections = ["dashboard", "instances", "storage", 
"network", "templates", "accounts", "domains", "events", "projects", 
"configuration", "regions", "affinityGroups", "vmsnapshots"];
 } else if (g_userProjectsEnabled) {
-sections = ["dashboard", "instances", "storage", 
"network", "templates", "accounts", "events", "projects", "regions", 
"affinityGroups"];
+sections = ["dashboard", "instances", "storage", 
"network", "templates", "accounts", "events", "projects", "regions", 
"affinityGroups", "vmsnapshots"];
 } else { //normal user
-sections = ["dashboard", "instances", "storage", 
"network", "templates", "accounts", "events", "regions", "affinityGroups"];
+sections = ["dashboard", "instances", "storage", 
"network", "templates", "accounts", "events", "regions", "affinityGroups", 
"vmsnapshots"];
--- End diff --

Add a new section in the storage -> drop down (just like we've volumes and 
disk snapshots?) to keep consistency; or break apart Storage tab into two tabs: 
volumes and disk snapshots


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-27 Thread nlivens
Github user nlivens commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r43104207
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -348,6 +866,6 @@ public String getConfigComponentName() {
 
 @Override
 public ConfigKey[] getConfigKeys() {
-return new ConfigKey[] {NuageVspSyncWorkers, 
NuageVspSyncInterval};
+return NUAGE_VSP_CONFIG_KEYS;
--- End diff --

Done.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8975:skip test case if niciraN...

2015-10-27 Thread remibergsma
Github user remibergsma commented on the pull request:

https://github.com/apache/cloudstack/pull/960#issuecomment-151455578
  
@pvr9711 There are so many things to do for 4.6, do you really want _me_ to 
send a PR for moving a file? Please send it yourself, and both @miguelaferreira 
and me will OK it.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8990: start a stopped machine ...

2015-10-27 Thread remibergsma
Github user remibergsma commented on the pull request:

https://github.com/apache/cloudstack/pull/978#issuecomment-151487786
  
@borisroman Can you review this again please?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8993: DHCP fails with "no addr...

2015-10-27 Thread remibergsma
Github user remibergsma commented on the pull request:

https://github.com/apache/cloudstack/pull/981#issuecomment-151489464
  
pinging @wilderrodrigues to have a look


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: Add Unit Tests for Libvirt/KVM storage co...

2015-10-27 Thread borisroman
Github user borisroman commented on the pull request:

https://github.com/apache/cloudstack/pull/986#issuecomment-151490397
  
Ping @remibergsma, when Jenkins is happy to may merge.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


  1   2   >