[GitHub] blueorangutan commented on issue #2493: CLOUDSTACK-10326: Prevent hosts fall into Maintenance when there are running VMs on it

2018-06-12 Thread GitBox
blueorangutan commented on issue #2493: CLOUDSTACK-10326: Prevent hosts fall 
into Maintenance when there are running VMs on it
URL: https://github.com/apache/cloudstack/pull/2493#issuecomment-396779895
 
 
   @nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been 
kicked to run smoke tests


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nvazquez commented on issue #2493: CLOUDSTACK-10326: Prevent hosts fall into Maintenance when there are running VMs on it

2018-06-12 Thread GitBox
nvazquez commented on issue #2493: CLOUDSTACK-10326: Prevent hosts fall into 
Maintenance when there are running VMs on it
URL: https://github.com/apache/cloudstack/pull/2493#issuecomment-396779816
 
 
   @blueorangutan test


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] blueorangutan commented on issue #2493: CLOUDSTACK-10326: Prevent hosts fall into Maintenance when there are running VMs on it

2018-06-12 Thread GitBox
blueorangutan commented on issue #2493: CLOUDSTACK-10326: Prevent hosts fall 
into Maintenance when there are running VMs on it
URL: https://github.com/apache/cloudstack/pull/2493#issuecomment-396777216
 
 
   Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2119


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] blueorangutan commented on issue #2493: CLOUDSTACK-10326: Prevent hosts fall into Maintenance when there are running VMs on it

2018-06-12 Thread GitBox
blueorangutan commented on issue #2493: CLOUDSTACK-10326: Prevent hosts fall 
into Maintenance when there are running VMs on it
URL: https://github.com/apache/cloudstack/pull/2493#issuecomment-396771363
 
 
   @nvazquez a Jenkins job has been kicked to build packages. I'll keep you 
posted as I make progress.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nvazquez commented on issue #2493: CLOUDSTACK-10326: Prevent hosts fall into Maintenance when there are running VMs on it

2018-06-12 Thread GitBox
nvazquez commented on issue #2493: CLOUDSTACK-10326: Prevent hosts fall into 
Maintenance when there are running VMs on it
URL: https://github.com/apache/cloudstack/pull/2493#issuecomment-396771296
 
 
   @blueorangutan package


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Slair1 commented on issue #2680: Using Source NAT option on Private Gateway does not work

2018-06-12 Thread GitBox
Slair1 commented on issue #2680: Using Source NAT option on Private Gateway 
does not work
URL: https://github.com/apache/cloudstack/issues/2680#issuecomment-396754824
 
 
   FYI, my test doesn't have PR #2579 - so i can't be 100% sure how my changes 
work without that PR.  Unfortunately my test environment won't be available for 
a while to do more testing.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Slair1 commented on issue #2680: Using Source NAT option on Private Gateway does not work

2018-06-12 Thread GitBox
Slair1 commented on issue #2680: Using Source NAT option on Private Gateway 
does not work
URL: https://github.com/apache/cloudstack/issues/2680#issuecomment-396754824
 
 
   FYI, my test doesn't have PR #2579 - so i can't be 100% sure how my changes 
work with that PR.  Unfortunately my test environment won't be available for a 
while to do more testing.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Slair1 commented on issue #2680: Using Source NAT option on Private Gateway does not work

2018-06-12 Thread GitBox
Slair1 commented on issue #2680: Using Source NAT option on Private Gateway 
does not work
URL: https://github.com/apache/cloudstack/issues/2680#issuecomment-396754824
 
 
   FYI, my test doesn't have PR #2579 - so i can't be 100% how my changes work 
without that PR.  Unfortunately my test environment won't be available for a 
while to do more testing.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Slair1 commented on issue #2680: Using Source NAT option on Private Gateway does not work

2018-06-12 Thread GitBox
Slair1 commented on issue #2680: Using Source NAT option on Private Gateway 
does not work
URL: https://github.com/apache/cloudstack/issues/2680#issuecomment-396743659
 
 
   @rhtyd /cc @ustcweizhou 
   
   It looks like that old SNAT in `CsAddress.py` (before this PR) was allowing 
the static NATs hair-pinning to work.  However, that seems to only be because 
the actual static NAT hairpin code in `configure.py` wasn't working correctly 
because it had `eth0` hard-coded in it instead of dynamic determining the guest 
network interface.  So, I left our `CsAddress.py` as it (see current PR #2681) 
and modified `configure.py` to fix the hairpin SNAT.  Please see the following 
and let me know your thoughts.  It may need some others to do some additional 
testing also.
   
   ## Before Changes to `configure.py`
    IP Address and Interfaces
   ```
   root@r-336-VM:~# ip add
   1: lo:  mtu 16436 qdisc noqueue state UNKNOWN
   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
   inet 127.0.0.1/8 scope host lo
   2: eth0:  mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
   link/ether 0e:00:a9:fe:01:dd brd ff:ff:ff:ff:ff:ff
   inet 169.254.1.221/16 brd 169.254.255.255 scope global eth0
   3: eth1:  mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
   link/ether 06:18:90:00:00:30 brd ff:ff:ff:ff:ff:ff
   inet 46.99.52.18/26 brd 46.99.52.63 scope global eth1
   inet 46.99.52.19/26 brd 46.99.52.63 scope global secondary eth1
   inet 46.99.52.20/26 brd 46.99.52.63 scope global secondary eth1
   4: eth2:  mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
   link/ether 06:1d:54:00:02:6b brd ff:ff:ff:ff:ff:ff
   inet 10.101.41.10/24 brd 10.101.41.255 scope global eth2
   5: eth3:  mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
   link/ether 02:00:6d:75:00:0a brd ff:ff:ff:ff:ff:ff
   inet 10.0.0.1/24 brd 10.0.0.255 scope global eth3
   ```
    OUTPUT DNAT (looks good)
   ```
   root@r-336-VM:~# iptables -L OUTPUT -t nat -vn
   Chain OUTPUT (policy ACCEPT 28 packets, 1871 bytes)
pkts bytes target prot opt in out source   
destination
   0 0 DNAT   all  --  *  *   0.0.0.0/0
46.99.52.20to:10.0.0.154
   0 0 DNAT   all  --  *  *   0.0.0.0/0
46.99.52.19to:10.0.0.209
   ```
    PREROUTING DNAT (1st and 3rd line are not needed)
   ```
   root@r-336-VM:~# iptables -L PREROUTING -t nat -vn
   Chain PREROUTING (policy ACCEPT 551 packets, 51744 bytes)
pkts bytes target prot opt in out source   
destination
   0 0 DNAT   all  --  eth0   *   0.0.0.0/0
46.99.52.20to:10.0.0.154
   6   240 DNAT   all  --  *  *   0.0.0.0/0
46.99.52.20to:10.0.0.154
   0 0 DNAT   all  --  eth0   *   0.0.0.0/0
46.99.52.19to:10.0.0.209
  11   492 DNAT   all  --  *  *   0.0.0.0/0
46.99.52.19to:10.0.0.209
   ```
    POSTROUTING SNAT (1st and 3rd line are incorrect.  Last line isn't 
needed)
   The 1st and 3rd line are close to getting hair-pinning with a static NAT 
working, but the interface is wrong.  If you look above, eth0 was our 
169.254.0.0/16 network...
   ```
   root@r-336-VM:~# iptables -L POSTROUTING -t nat -vn
   Chain POSTROUTING (policy ACCEPT 26 packets, 1100 bytes)
pkts bytes target prot opt in out source   
destination
   0 0 SNAT   all  --  *  eth010.0.0.0/24  
10.0.0.154   to:10.0.0.1
  34  2584 SNAT   all  --  *  eth110.0.0.154   
0.0.0.0/0to:46.99.52.20
   0 0 SNAT   all  --  *  eth010.0.0.0/24  
10.0.0.209   to:10.0.0.1
  28  1456 SNAT   all  --  *  eth110.0.0.209   
0.0.0.0/0to:46.99.52.19
 243 14660 SNAT   all  --  *  eth20.0.0.0/0
0.0.0.0/0to:10.101.41.10
 222 14854 SNAT   all  --  *  eth10.0.0.0/0
0.0.0.0/0to:46.99.52.18
   0 0 SNAT   all  --  *  eth10.0.0.0/0
0.0.0.0/0to:46.99.52.19
   ```
   ## After Changes to `configure.py`
    IP Address and Interfaces
   ```
   1: lo:  mtu 16436 qdisc noqueue state UNKNOWN
   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
   inet 127.0.0.1/8 scope host lo
   2: eth0:  mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
   link/ether 0e:00:a9:fe:01:c9 brd ff:ff:ff:ff:ff:ff
   inet 169.254.1.201/16 brd 169.254.255.255 scope global eth0
   3: eth1:  mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
   link/ether 06:c7:80:00:00:30 brd ff:ff:ff:ff:ff:ff
   inet 46.99.52.18/26 brd 46.99.52.63 scope global eth1
   inet 46.99.52.20/26 brd 46.99.52.63 scope global secondary eth1
   inet 46.99.52.19/26 brd 46.99.52.63 scope global secondary eth1
   4: 

[GitHub] Slair1 commented on issue #2680: Using Source NAT option on Private Gateway does not work

2018-06-12 Thread GitBox
Slair1 commented on issue #2680: Using Source NAT option on Private Gateway 
does not work
URL: https://github.com/apache/cloudstack/issues/2680#issuecomment-396743659
 
 
   @rhtyd /cc @ustcweizhou 
   
   It looks like that old SNAT in `CsAddress.py` (before this PR) was allowing 
the static NATs hair-pinning to work.  However, that seems to only be because 
the actual static NAT hairpin code in `configure.py` wasn't working correctly 
because it had `eth0` hard-coded in it instead of dynamic determining the guest 
network interface.  So, I left our `CsAddress.py` as it (see current PR) and 
modified `configure.py` to fix the hairpin SNAT.  Please see the following and 
let me know your thoughts.  It may need some others to do some additional 
testing also.
   
   ## Before Changes to `configure.py`
    IP Address and Interfaces
   ```
   root@r-336-VM:~# ip add
   1: lo:  mtu 16436 qdisc noqueue state UNKNOWN
   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
   inet 127.0.0.1/8 scope host lo
   2: eth0:  mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
   link/ether 0e:00:a9:fe:01:dd brd ff:ff:ff:ff:ff:ff
   inet 169.254.1.221/16 brd 169.254.255.255 scope global eth0
   3: eth1:  mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
   link/ether 06:18:90:00:00:30 brd ff:ff:ff:ff:ff:ff
   inet 46.99.52.18/26 brd 46.99.52.63 scope global eth1
   inet 46.99.52.19/26 brd 46.99.52.63 scope global secondary eth1
   inet 46.99.52.20/26 brd 46.99.52.63 scope global secondary eth1
   4: eth2:  mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
   link/ether 06:1d:54:00:02:6b brd ff:ff:ff:ff:ff:ff
   inet 10.101.41.10/24 brd 10.101.41.255 scope global eth2
   5: eth3:  mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
   link/ether 02:00:6d:75:00:0a brd ff:ff:ff:ff:ff:ff
   inet 10.0.0.1/24 brd 10.0.0.255 scope global eth3
   ```
    OUTPUT DNAT (looks good)
   ```
   root@r-336-VM:~# iptables -L OUTPUT -t nat -vn
   Chain OUTPUT (policy ACCEPT 28 packets, 1871 bytes)
pkts bytes target prot opt in out source   
destination
   0 0 DNAT   all  --  *  *   0.0.0.0/0
46.99.52.20to:10.0.0.154
   0 0 DNAT   all  --  *  *   0.0.0.0/0
46.99.52.19to:10.0.0.209
   ```
    PREROUTING DNAT (1st and 3rd line are not needed)
   ```
   root@r-336-VM:~# iptables -L PREROUTING -t nat -vn
   Chain PREROUTING (policy ACCEPT 551 packets, 51744 bytes)
pkts bytes target prot opt in out source   
destination
   0 0 DNAT   all  --  eth0   *   0.0.0.0/0
46.99.52.20to:10.0.0.154
   6   240 DNAT   all  --  *  *   0.0.0.0/0
46.99.52.20to:10.0.0.154
   0 0 DNAT   all  --  eth0   *   0.0.0.0/0
46.99.52.19to:10.0.0.209
  11   492 DNAT   all  --  *  *   0.0.0.0/0
46.99.52.19to:10.0.0.209
   ```
    POSTROUTING SNAT (1st and 3rd line are incorrect.  Last line isn't 
needed)
   The 1st and 3rd line are close to getting hair-pinning with a static NAT 
working, but the interface is wrong.  If you look above, eth0 was our 
169.254.0.0/16 network...
   ```
   root@r-336-VM:~# iptables -L POSTROUTING -t nat -vn
   Chain POSTROUTING (policy ACCEPT 26 packets, 1100 bytes)
pkts bytes target prot opt in out source   
destination
   0 0 SNAT   all  --  *  eth010.0.0.0/24  
10.0.0.154   to:10.0.0.1
  34  2584 SNAT   all  --  *  eth110.0.0.154   
0.0.0.0/0to:46.99.52.20
   0 0 SNAT   all  --  *  eth010.0.0.0/24  
10.0.0.209   to:10.0.0.1
  28  1456 SNAT   all  --  *  eth110.0.0.209   
0.0.0.0/0to:46.99.52.19
 243 14660 SNAT   all  --  *  eth20.0.0.0/0
0.0.0.0/0to:10.101.41.10
 222 14854 SNAT   all  --  *  eth10.0.0.0/0
0.0.0.0/0to:46.99.52.18
   0 0 SNAT   all  --  *  eth10.0.0.0/0
0.0.0.0/0to:46.99.52.19
   ```
   ## After Changes to `configure.py`
    IP Address and Interfaces
   ```
   1: lo:  mtu 16436 qdisc noqueue state UNKNOWN
   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
   inet 127.0.0.1/8 scope host lo
   2: eth0:  mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
   link/ether 0e:00:a9:fe:01:c9 brd ff:ff:ff:ff:ff:ff
   inet 169.254.1.201/16 brd 169.254.255.255 scope global eth0
   3: eth1:  mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
   link/ether 06:c7:80:00:00:30 brd ff:ff:ff:ff:ff:ff
   inet 46.99.52.18/26 brd 46.99.52.63 scope global eth1
   inet 46.99.52.20/26 brd 46.99.52.63 scope global secondary eth1
   inet 46.99.52.19/26 brd 46.99.52.63 scope global secondary eth1
   4: eth2:  

[GitHub] blueorangutan commented on issue #2706: packaging: use libuuid x86_64 package for cloudstack-common

2018-06-12 Thread GitBox
blueorangutan commented on issue #2706: packaging: use libuuid x86_64 package 
for cloudstack-common
URL: https://github.com/apache/cloudstack/pull/2706#issuecomment-396699593
 
 
   Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2118


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] blueorangutan commented on issue #2706: packaging: use libuuid x86_64 package for cloudstack-common

2018-06-12 Thread GitBox
blueorangutan commented on issue #2706: packaging: use libuuid x86_64 package 
for cloudstack-common
URL: https://github.com/apache/cloudstack/pull/2706#issuecomment-396692850
 
 
   @DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you 
posted as I make progress.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] DaanHoogland commented on issue #2706: packaging: use libuuid x86_64 package for cloudstack-common

2018-06-12 Thread GitBox
DaanHoogland commented on issue #2706: packaging: use libuuid x86_64 package 
for cloudstack-common
URL: https://github.com/apache/cloudstack/pull/2706#issuecomment-396692564
 
 
   @blueorangutan package


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rafaelweingartner commented on a change in pull request #2595: CLOUDSTACK-10199: Support requesting a specific IPv4 address

2018-06-12 Thread GitBox
rafaelweingartner commented on a change in pull request #2595: 
CLOUDSTACK-10199: Support requesting a specific IPv4 address
URL: https://github.com/apache/cloudstack/pull/2595#discussion_r194736632
 
 

 ##
 File path: 
engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
 ##
 @@ -869,6 +871,76 @@ public void saveExtraDhcpOptions(final String 
networkUuid, final Long nicId, fin
 return new Pair(vmNic, Integer.valueOf(deviceId));
 }
 
+/**
+ * If the requested IPv4 address from the NicProfile was configured then 
it configures the IPv4 address, Netmask and Gateway to deploy the VM with the 
requested IP.
+ */
+protected void configureNicProfileBasedOnRequestedIp(NicProfile 
requestedNicProfile, NicProfile nicProfile, Network network) {
+if (requestedNicProfile == null) {
+return;
+}
+String requestedIpv4Address = requestedNicProfile.getRequestedIPv4();
+if (requestedIpv4Address == null) {
+return;
+}
+if (!NetUtils.isValidIp4(requestedIpv4Address)) {
+throw new InvalidParameterValueException(String.format("The 
requested [IPv4 address='%s'] is not a valid IP address", 
requestedIpv4Address));
+}
+
+VlanVO vlanVo = _vlanDao.findByNetworkIdAndIpv4(network.getId(), 
requestedIpv4Address);
+if (vlanVo == null) {
+throw new InvalidParameterValueException(String.format("Trying to 
configure a Nic with the requested [IPv4='%s'] but cannot find a Vlan for the 
[network id='%s']",
+requestedIpv4Address, network.getId()));
+}
+
+String ipv4Gateway = vlanVo.getVlanGateway();
+String ipv4Netmask = vlanVo.getVlanNetmask();
+
+if (!NetUtils.isValidIp4(ipv4Gateway)) {
+throw new InvalidParameterValueException(String.format("The 
[IPv4Gateway='%s'] from [VlanId='%s'] is not valid", ipv4Gateway, 
vlanVo.getId()));
+}
+if (!NetUtils.isValidIp4Netmask(ipv4Netmask)) {
+throw new InvalidParameterValueException(String.format("The 
[IPv4Netmask='%s'] from [VlanId='%s'] is not valid", ipv4Netmask, 
vlanVo.getId()));
+}
+
+acquireLockAndCheckIfIpv4IsFree(network, requestedIpv4Address);
+
+nicProfile.setIPv4Address(requestedIpv4Address);
+nicProfile.setIPv4Gateway(ipv4Gateway);
+nicProfile.setIPv4Netmask(ipv4Netmask);
+
+if (nicProfile.getMacAddress() == null) {
+try {
+String macAddress = 
_networkModel.getNextAvailableMacAddressInNetwork(network.getId());
+nicProfile.setMacAddress(macAddress);
+} catch (InsufficientAddressCapacityException e) {
+throw new CloudRuntimeException(String.format("Cannot get next 
available mac address in [network id='%s']", network.getId()), e);
+}
+}
+}
+
+/**
+ *  Acquires lock of in table "user_ip_address" and checks if the 
requested IPv4 address is Free.
+ */
+protected void acquireLockAndCheckIfIpv4IsFree(Network network, String 
requestedIpv4Address) {
 
 Review comment:
   @fmaximus cannot users define a guest IP? I mean, as long as the guest IP 
defined by the user is within the bounds of the guest network, it should be 
possible, right?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] GabrielBrascher commented on a change in pull request #2595: CLOUDSTACK-10199: Support requesting a specific IPv4 address

2018-06-12 Thread GitBox
GabrielBrascher commented on a change in pull request #2595: CLOUDSTACK-10199: 
Support requesting a specific IPv4 address
URL: https://github.com/apache/cloudstack/pull/2595#discussion_r194734988
 
 

 ##
 File path: 
engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
 ##
 @@ -869,6 +871,76 @@ public void saveExtraDhcpOptions(final String 
networkUuid, final Long nicId, fin
 return new Pair(vmNic, Integer.valueOf(deviceId));
 }
 
+/**
+ * If the requested IPv4 address from the NicProfile was configured then 
it configures the IPv4 address, Netmask and Gateway to deploy the VM with the 
requested IP.
+ */
+protected void configureNicProfileBasedOnRequestedIp(NicProfile 
requestedNicProfile, NicProfile nicProfile, Network network) {
+if (requestedNicProfile == null) {
+return;
+}
+String requestedIpv4Address = requestedNicProfile.getRequestedIPv4();
+if (requestedIpv4Address == null) {
+return;
+}
+if (!NetUtils.isValidIp4(requestedIpv4Address)) {
+throw new InvalidParameterValueException(String.format("The 
requested [IPv4 address='%s'] is not a valid IP address", 
requestedIpv4Address));
+}
+
+VlanVO vlanVo = _vlanDao.findByNetworkIdAndIpv4(network.getId(), 
requestedIpv4Address);
+if (vlanVo == null) {
+throw new InvalidParameterValueException(String.format("Trying to 
configure a Nic with the requested [IPv4='%s'] but cannot find a Vlan for the 
[network id='%s']",
+requestedIpv4Address, network.getId()));
+}
+
+String ipv4Gateway = vlanVo.getVlanGateway();
+String ipv4Netmask = vlanVo.getVlanNetmask();
+
+if (!NetUtils.isValidIp4(ipv4Gateway)) {
+throw new InvalidParameterValueException(String.format("The 
[IPv4Gateway='%s'] from [VlanId='%s'] is not valid", ipv4Gateway, 
vlanVo.getId()));
+}
+if (!NetUtils.isValidIp4Netmask(ipv4Netmask)) {
+throw new InvalidParameterValueException(String.format("The 
[IPv4Netmask='%s'] from [VlanId='%s'] is not valid", ipv4Netmask, 
vlanVo.getId()));
+}
+
+acquireLockAndCheckIfIpv4IsFree(network, requestedIpv4Address);
+
+nicProfile.setIPv4Address(requestedIpv4Address);
+nicProfile.setIPv4Gateway(ipv4Gateway);
+nicProfile.setIPv4Netmask(ipv4Netmask);
+
+if (nicProfile.getMacAddress() == null) {
+try {
+String macAddress = 
_networkModel.getNextAvailableMacAddressInNetwork(network.getId());
+nicProfile.setMacAddress(macAddress);
+} catch (InsufficientAddressCapacityException e) {
+throw new CloudRuntimeException(String.format("Cannot get next 
available mac address in [network id='%s']", network.getId()), e);
+}
+}
+}
+
+/**
+ *  Acquires lock of in table "user_ip_address" and checks if the 
requested IPv4 address is Free.
+ */
+protected void acquireLockAndCheckIfIpv4IsFree(Network network, String 
requestedIpv4Address) {
 
 Review comment:
   Thanks, @fmaximus. I will check on that.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] blueorangutan commented on issue #2681: Source NAT option on Private Gateway

2018-06-12 Thread GitBox
blueorangutan commented on issue #2681: Source NAT option on Private Gateway
URL: https://github.com/apache/cloudstack/pull/2681#issuecomment-396534710
 
 
   Trillian test result (tid-2754)
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 30759 seconds
   Marvin logs: 
https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2681-t2754-kvm-centos7.zip
   Intermitten failure detected: 
/marvin/tests/smoke/test_deploy_virtio_scsi_vm.py
   Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
   Intermitten failure detected: /marvin/tests/smoke/test_public_ip_range.py
   Intermitten failure detected: /marvin/tests/smoke/test_reset_vm_on_reboot.py
   Intermitten failure detected: /marvin/tests/smoke/test_templates.py
   Intermitten failure detected: /marvin/tests/smoke/test_usage.py
   Intermitten failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
   Intermitten failure detected: /marvin/tests/smoke/test_volumes.py
   Intermitten failure detected: /marvin/tests/smoke/test_vpc_redundant.py
   Intermitten failure detected: /marvin/tests/smoke/test_vpc_vpn.py
   Smoke tests completed. 60 look OK, 7 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   ContextSuite context=TestDeployVirtioSCSIVM>:setup | `Error` | 0.00 | 
test_deploy_virtio_scsi_vm.py
   test_03_vpc_privategw_restart_vpc_cleanup | `Error` | 117.90 | 
test_privategw_acl.py
   test_04_extract_template | `Failure` | 128.23 | test_templates.py
   ContextSuite context=TestISOUsage>:setup | `Error` | 0.00 | test_usage.py
   test_06_download_detached_volume | `Failure` | 137.57 | test_volumes.py
   test_05_rvpc_multi_tiers | `Failure` | 332.05 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Error` | 352.77 | test_vpc_redundant.py
   test_01_redundant_vpc_site2site_vpn | `Failure` | 234.36 | test_vpc_vpn.py
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mdesaive opened a new issue #2707: Moving User with API key fails through MySQLIntegrityConstraintViolationException

2018-06-12 Thread GitBox
mdesaive opened a new issue #2707: Moving User with API key fails through 
MySQLIntegrityConstraintViolationException
URL: https://github.com/apache/cloudstack/issues/2707
 
 
   
   
   # ISSUE TYPE
   
* Bug Report
   
   
   # COMPONENT NAME
   
   ~~~
   
   ~~~
   
   # CLOUDSTACK VERSION
   
   
   ~~~
   Advanced Networking, Cloudstack 4.11.0.0 on Ubuntu 14.04 LTS,
   MySQL 5.5.59-0ubuntu0.14.04.1
   ~~~
   
   # CONFIGURATION
   
   
   
   # OS / ENVIRONMENT
   
   
   
   # SUMMARY
   
   
   The API call "moveUser" on a user with an API key fails with a 
MySQLIntegrityConstraintViolationException.
   
   Moving a user without API key works perfectly.
   
   Looks to me, as if there is a constraint on mySQL not allowing to have a new 
user with the same API key to be prepared. 
   
   
   # STEPS TO REPRODUCE
   
   
   
   ~~~
   Prepare user with an API key.
   Call "move user id= account="
   ~~~
   
   
   
   # EXPECTED RESULTS
   
   
   ~~~
   The user to be moved to the destination account.
   ~~~
   
   # ACTUAL RESULTS
   
   
   
   
   ~~~
   API call returns with:
   --
   (rz-admin) :D > move user id=56fab0c7-6724-46c0-9904-eff4020485ad 
account=AdminTeam-Intern-Individuell
   Error 530: Entity already exists:
   {
 "cserrorcode": ,
 "errorcode": 530,
 "errortext": "Entity already exists: ",
 "uuidList": []
   } 
   --
   Exception in /var/log/cloudstack/management/management-server.log:
   
   Caused by: 
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: 
Duplicate entry '' for key 'i_user__api_key'
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
   at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   
   ~~~
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] DaanHoogland commented on issue #2699: remove old config artifacts from update path

2018-06-12 Thread GitBox
DaanHoogland commented on issue #2699: remove old config artifacts from update 
path
URL: https://github.com/apache/cloudstack/pull/2699#issuecomment-396497574
 
 
   @PaulAngus Not sure if it was set in sand yet, but we kind of had the 
convention to merge+squash PRs. (maybe discuss on list) this one has a lot of 
little commits now.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[cloudstack] branch master updated (1d132d0 -> 3ff122d)

2018-06-12 Thread dahn
This is an automated email from the ASF dual-hosted git repository.

dahn pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


from 1d132d0  Merge branch '4.11'
 add e41b4ed  ui: fix create VPC dialog box failure when zone is SG enabled 
(#2704)
 add 68d87d8  CLOUDSTACK-10381: Fix password reset / reset ssh key with 
ConfigDrive
 add 3b89e02  Merge pull request #2705 from 
nuagenetworks/bugfix/CLOUDSTACK-10381
 add 935ca76  remove old config artifacts from update path
 add 5fcadbc  set unsensitive attributes as not 'Secure'
 add 384bce1  update without decrypt doesn't work
 add 40f8561  imports
 add 82a46d1  debug message
 add 2bf78e9  extra message
 add e09069c  isisnot=
 add 84b0cf0  comment on unencryption
 add 4afdee9  Merge pull request #2699 from shapeblue/ldapConfigs
 new 3ff122d  Merge release branch 4.11 to master

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../com/cloud/upgrade/dao/Upgrade41100to41110.java | 80 --
 .../com/cloud/upgrade/dao/Upgrade421to430.java | 74 
 .../apache/cloudstack/ldap/LdapConfiguration.java  |  6 +-
 .../network/element/ConfigDriveNetworkElement.java | 33 -
 ui/scripts/network.js  | 11 +--
 5 files changed, 116 insertions(+), 88 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
d...@apache.org.


[cloudstack] 01/01: Merge release branch 4.11 to master

2018-06-12 Thread dahn
This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 3ff122d824cd18ee1c88510073c647645bb081d5
Merge: 1d132d0 4afdee9
Author: Daan Hoogland 
AuthorDate: Tue Jun 12 07:41:09 2018 +

Merge release branch 4.11 to master

* 4.11:
  comment on unencryption
  ui: fix create VPC dialog box failure when zone is SG enabled (#2704)
  CLOUDSTACK-10381: Fix password reset / reset ssh key with ConfigDrive
  isisnot=
  extra message
  debug message
  imports
  update without decrypt doesn't work
  set unsensitive attributes as not 'Secure'
  remove old config artifacts from update path

 .../com/cloud/upgrade/dao/Upgrade41100to41110.java | 80 --
 .../com/cloud/upgrade/dao/Upgrade421to430.java | 74 
 .../apache/cloudstack/ldap/LdapConfiguration.java  |  6 +-
 .../network/element/ConfigDriveNetworkElement.java | 33 -
 ui/scripts/network.js  | 11 +--
 5 files changed, 116 insertions(+), 88 deletions(-)


-- 
To stop receiving notification emails like this one, please contact
d...@apache.org.