[GitHub] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-23 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158593073
 
 

 ##
 File path: server/src/com/cloud/network/IpAddressManagerImpl.java
 ##
 @@ -799,28 +798,55 @@ public IPAddressVO doInTransaction(TransactionStatus 
status) throws Insufficient
 throw new AccountLimitException("Maximum number of 
public IP addresses for account: " + owner.getAccountName() + " has been 
exceeded.");
 }
 }
-IPAddressVO addr = addrs.get(0);
-addr.setSourceNat(sourceNat);
-addr.setAllocatedTime(new Date());
-addr.setAllocatedInDomainId(owner.getDomainId());
-addr.setAllocatedToAccountId(owner.getId());
-addr.setSystem(isSystem);
-
-if (displayIp != null) {
-addr.setDisplay(displayIp);
+
+IPAddressVO finalAddr = null;
+for (final IPAddressVO possibleAddr: addrs) {
+if (possibleAddr.getState() != IpAddress.State.Free) {
+continue;
+}
+final IPAddressVO addr = possibleAddr;
+addr.setSourceNat(sourceNat);
+addr.setAllocatedTime(new Date());
+addr.setAllocatedInDomainId(owner.getDomainId());
+addr.setAllocatedToAccountId(owner.getId());
+addr.setSystem(isSystem);
+
+if (displayIp != null) {
+addr.setDisplay(displayIp);
+}
+
+if (vlanUse != VlanType.DirectAttached) {
+addr.setAssociatedWithNetworkId(guestNetworkId);
+addr.setVpcId(vpcId);
+}
+if (_ipAddressDao.lockRow(possibleAddr.getId(), true) != 
null) {
+final IPAddressVO userIp = 
_ipAddressDao.findById(addr.getId());
+if (userIp.getState() == IpAddress.State.Free) {
+addr.setState(IpAddress.State.Allocating);
+if (_ipAddressDao.update(addr.getId(), addr)) {
 
 Review comment:
   The current regression fix is a two step process where IPs are first marked 
allocating and then marked allocated if assign is true, it's because ips in 
both free and allocating state can be allocated. ~~Do you propose we simply 
mark free ips to allocated in the loop if assign is true?~~ @yvsubhash if you 
can come up with further improvements/enhancements, please send a new PR, 
thanks.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-23 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158593073
 
 

 ##
 File path: server/src/com/cloud/network/IpAddressManagerImpl.java
 ##
 @@ -799,28 +798,55 @@ public IPAddressVO doInTransaction(TransactionStatus 
status) throws Insufficient
 throw new AccountLimitException("Maximum number of 
public IP addresses for account: " + owner.getAccountName() + " has been 
exceeded.");
 }
 }
-IPAddressVO addr = addrs.get(0);
-addr.setSourceNat(sourceNat);
-addr.setAllocatedTime(new Date());
-addr.setAllocatedInDomainId(owner.getDomainId());
-addr.setAllocatedToAccountId(owner.getId());
-addr.setSystem(isSystem);
-
-if (displayIp != null) {
-addr.setDisplay(displayIp);
+
+IPAddressVO finalAddr = null;
+for (final IPAddressVO possibleAddr: addrs) {
+if (possibleAddr.getState() != IpAddress.State.Free) {
+continue;
+}
+final IPAddressVO addr = possibleAddr;
+addr.setSourceNat(sourceNat);
+addr.setAllocatedTime(new Date());
+addr.setAllocatedInDomainId(owner.getDomainId());
+addr.setAllocatedToAccountId(owner.getId());
+addr.setSystem(isSystem);
+
+if (displayIp != null) {
+addr.setDisplay(displayIp);
+}
+
+if (vlanUse != VlanType.DirectAttached) {
+addr.setAssociatedWithNetworkId(guestNetworkId);
+addr.setVpcId(vpcId);
+}
+if (_ipAddressDao.lockRow(possibleAddr.getId(), true) != 
null) {
+final IPAddressVO userIp = 
_ipAddressDao.findById(addr.getId());
+if (userIp.getState() == IpAddress.State.Free) {
+addr.setState(IpAddress.State.Allocating);
+if (_ipAddressDao.update(addr.getId(), addr)) {
 
 Review comment:
   The current regression fix is a two step process where IPs are first marked 
allocating and then marked allocated if assign is true, it's because ips in 
both free and allocating state can be allocated. ~~Do you propose we simply 
mark free ips to allocated in the loop if assign is true? ~~ @yvsubhash if you 
can come up with further improvements/enhancements, please send a new PR, 
thanks.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-23 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158593073
 
 

 ##
 File path: server/src/com/cloud/network/IpAddressManagerImpl.java
 ##
 @@ -799,28 +798,55 @@ public IPAddressVO doInTransaction(TransactionStatus 
status) throws Insufficient
 throw new AccountLimitException("Maximum number of 
public IP addresses for account: " + owner.getAccountName() + " has been 
exceeded.");
 }
 }
-IPAddressVO addr = addrs.get(0);
-addr.setSourceNat(sourceNat);
-addr.setAllocatedTime(new Date());
-addr.setAllocatedInDomainId(owner.getDomainId());
-addr.setAllocatedToAccountId(owner.getId());
-addr.setSystem(isSystem);
-
-if (displayIp != null) {
-addr.setDisplay(displayIp);
+
+IPAddressVO finalAddr = null;
+for (final IPAddressVO possibleAddr: addrs) {
+if (possibleAddr.getState() != IpAddress.State.Free) {
+continue;
+}
+final IPAddressVO addr = possibleAddr;
+addr.setSourceNat(sourceNat);
+addr.setAllocatedTime(new Date());
+addr.setAllocatedInDomainId(owner.getDomainId());
+addr.setAllocatedToAccountId(owner.getId());
+addr.setSystem(isSystem);
+
+if (displayIp != null) {
+addr.setDisplay(displayIp);
+}
+
+if (vlanUse != VlanType.DirectAttached) {
+addr.setAssociatedWithNetworkId(guestNetworkId);
+addr.setVpcId(vpcId);
+}
+if (_ipAddressDao.lockRow(possibleAddr.getId(), true) != 
null) {
+final IPAddressVO userIp = 
_ipAddressDao.findById(addr.getId());
+if (userIp.getState() == IpAddress.State.Free) {
+addr.setState(IpAddress.State.Allocating);
+if (_ipAddressDao.update(addr.getId(), addr)) {
 
 Review comment:
   The current regression fix is a two step process where IPs are first marked 
allocating and then marked allocated if assign is true, it's because ips in 
both free and allocating state can be allocated. Do you propose we simply mark 
free ips to allocated in the loop if assign is true? 


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158495419
 
 

 ##
 File path: tools/appliance/systemvmtemplate/scripts/definition.rb
 ##
 @@ -77,7 +77,7 @@
 # turning it into a systemvm
 'install_systemvm_packages.sh',
 'configure_conntrack.sh',
-'../../cloud_scripts_shar_archive.sh',
+#'../../cloud_scripts_shar_archive.sh',
 
 Review comment:
   This file has been removed 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


[GitHub] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158495394
 
 

 ##
 File path: tools/appliance/definitions/systemvmtemplate/preseed.cfg
 ##
 @@ -17,22 +17,35 @@
 
 ### Localization
 # Locale sets language and country.
-d-i debian-installer/locale string en_US
+d-i debian-installer/locale string en_US.UTF-8
 
 # Keyboard selection.
-d-i console-keymaps-at/keymap select us
+d-i keyboard-configuration/xkb-keymap select us
 
 ### Network configuration
 d-i netcfg/choose_interface select auto
 d-i netcfg/get_hostname string systemvm
-d-i netcfg/get_domain string cloudstack.org
+d-i netcfg/get_domain string apache.org
+d-i netcfg/wireless_wep string
+
+d-i hw-detect/load_firmware boolean true
 
 ### Mirror settings
 d-i mirror/country string manual
-d-i mirror/http/hostname string http.us.debian.org
+d-i mirror/http/hostname string http.debian.net
 d-i mirror/http/directory string /debian
 d-i mirror/http/proxy string
 
+### Apt setup
+d-i apt-setup/cdrom/set-first false
+#d-i apt-setup/non-free boolean true
 
 Review comment:
   Removed.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158495264
 
 

 ##
 File path: tools/appliance/definitions/systemvmtemplate/authorized_keys.sh
 ##
 @@ -25,5 +25,6 @@ set -x
 key='ssh-rsa 
B3NzaC1yc2EBIwAAAQEAvFu3MLSPphFRBR1yM7nBukXWS9gPdAXfqq9cfC8ZqQN9ybi531aj44CybZ4BVT4kLfzbAs7+7nJeSIpPHxjv9XFqbxjIxoFeGYkj7s0RrJgtsEmvAAubZ3mYboUAYUivMgnJFLnv4VqyAbpjix6CfECUiU4ygwo24F3F6bAmhl4Vo1R5TSUdDIX876YePJTFtuVkLl4lu/+xw1QRWrgaSFosGICT37IKY7RjE79Ozb0GjNHyJPPgVAGkUVO4LawroL9dYOBlzdHpmqqA9Kc44oQBpvcU7s1+ezRTt7fZNnP7TG9ninZtrvnP4qmwAc4iUJ7N1bwh0mCblnoTfZ28hw==
 anthony@mobl-ant'
 mkdir -p /root/.ssh
 chmod 644 /root/.ssh
+#touch /root/.ssh/authorized_keys
 
 Review comment:
   Already fixed/removed in recent commits.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158495151
 
 

 ##
 File path: test/integration/smoke/test_ssvm.py
 ##
 @@ -73,7 +73,7 @@ def checkRunningAgent():
 return list_host_response[0].state == 'Up', None
 return False, None
 
-res, _ = wait_until(3, self.services["sleep"], checkRunningAgent)
+res, _ = wait_until(3, 300, checkRunningAgent)
 
 Review comment:
   Used a very large value, the value defined (hard-coded) in services['sleep'] 
was only 90.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158495014
 
 

 ##
 File path: test/integration/smoke/test_list_ids_parameter.py
 ##
 @@ -105,20 +105,20 @@ def setUpClass(cls):
 mode=cls.services["mode"]
 )
 
-#Take 3 VM1 Snapshots
-#PLEASE UNCOMMENT ONCE VM SNAPSHOT DELAY BUG AFTER VM CREATION IS FIXED
-"""cls.vmsnapshot_1 = VmSnapshot.create(
-cls.apiclient,
-cls.virtual_machine_1.id
-)
-cls.vmsnapshot_2 = VmSnapshot.create(
-cls.apiclient,
-cls.virtual_machine_1.id
-)
-cls.vmsnapshot_3 = VmSnapshot.create(
-cls.apiclient,
-cls.virtual_machine_1.id
-)"""
+#Take 3 VM1 Snapshots
 
 Review comment:
   I'm not sure if it's right to remove, since if in future we fix test_03 we 
can uncomment it.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158494923
 
 

 ##
 File path: systemvm/patches/debian/opt/cloud/bin/cs/CsRedundant.py
 ##
 @@ -74,8 +74,8 @@ def set(self):
 def _redundant_off(self):
 CsHelper.service("conntrackd", "stop")
 CsHelper.service("keepalived", "stop")
-CsHelper.umount_tmpfs(self.CS_RAMDISK_DIR)
-CsHelper.rmdir(self.CS_RAMDISK_DIR)
+#CsHelper.umount_tmpfs(self.CS_RAMDISK_DIR)
 
 Review comment:
   Removed and readded in recent versions.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158495088
 
 

 ##
 File path: tools/appliance/builtin/template.json
 ##
 @@ -0,0 +1,53 @@
+{
 
 Review comment:
   packer fails if you add a license. I've added reference as a comment instead.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158494883
 
 

 ##
 File path: systemvm/patches/debian/config/opt/cloud/bin/setup/common.sh
 ##
 @@ -0,0 +1,862 @@
+#!/bin/bash
+# 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.
+
+PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+
+. /lib/lsb/init-functions
+
+log_it() {
+  echo "$(date) $@" >> /var/log/cloud.log
+  log_action_msg "$@"
+}
+
+init_interfaces_orderby_macs() {
+macs=( $(echo $1 | sed "s/|/ /g") )
+total_nics=${#macs[@]}
+interface_file=${2:-"/etc/network/interfaces"}
+rule_file=${3:-"/etc/udev/rules.d/70-persistent-net.rules"}
+
+echo -n "auto lo" > $interface_file
+for((i=0; i> $interface_file
+fi
+done
+cat >> $interface_file << EOF
+
 
 Review comment:
   Add newline after 41, I simply moved the changes. It's trying to add a new 
network/config block.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158494883
 
 

 ##
 File path: systemvm/patches/debian/config/opt/cloud/bin/setup/common.sh
 ##
 @@ -0,0 +1,862 @@
+#!/bin/bash
+# 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.
+
+PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+
+. /lib/lsb/init-functions
+
+log_it() {
+  echo "$(date) $@" >> /var/log/cloud.log
+  log_action_msg "$@"
+}
+
+init_interfaces_orderby_macs() {
+macs=( $(echo $1 | sed "s/|/ /g") )
+total_nics=${#macs[@]}
+interface_file=${2:-"/etc/network/interfaces"}
+rule_file=${3:-"/etc/udev/rules.d/70-persistent-net.rules"}
+
+echo -n "auto lo" > $interface_file
+for((i=0; i> $interface_file
+fi
+done
+cat >> $interface_file << EOF
+
 
 Review comment:
   Added newline after 41, I simply moved the changes. It's trying to add a new 
network/config block.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158494622
 
 

 ##
 File path: systemvm/patches/debian/config/opt/cloud/bin/patchsystemvm.sh
 ##
 @@ -149,11 +149,11 @@ enable_pcihotplug() {
 }
 
 enable_serial_console() {
-   sed -i -e "/^serial.*/d" /boot/grub/grub.conf
-   sed -i -e "/^terminal.*/d" /boot/grub/grub.conf
-   sed -i -e "/^default.*/a\serial --unit=0 --speed=115200 --parity=no 
--stop=1" /boot/grub/grub.conf
-   sed -i -e "/^serial.*/a\terminal --timeout=0 serial console" 
/boot/grub/grub.conf
-   sed -i -e "s/\(^kernel.* ro\) \(console.*\)/\1 console=tty0 
console=ttyS0,115200n8/" /boot/grub/grub.conf
+   #sed -i -e "/^serial.*/d" /boot/grub/grub.conf
 
 Review comment:
   Yes, removed in recent changes.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158494593
 
 

 ##
 File path: systemvm/patches/debian/config/opt/cloud/bin/ipsectunnel.sh
 ##
 @@ -139,36 +139,36 @@ ipsec_tunnel_add() {
 
   check_and_enable_iptables
 
-sudo echo "conn vpn-$rightpeer" > $vpnconffile &&
-sudo echo "  left=$leftpeer" >> $vpnconffile &&
-sudo echo "  leftsubnet=$leftnet" >> $vpnconffile &&
-sudo echo "  leftnexthop=$leftnexthop" >> $vpnconffile &&
-sudo echo "  right=$rightpeer" >> $vpnconffile &&
-sudo echo "  rightsubnets={$rightnets}" >> $vpnconffile &&
-sudo echo "  type=tunnel" >> $vpnconffile &&
-sudo echo "  authby=secret" >> $vpnconffile &&
-sudo echo "  keyexchange=ike" >> $vpnconffile &&
-sudo echo "  ike=$ikepolicy" >> $vpnconffile &&
-sudo echo "  ikelifetime=${ikelifetime}s" >> $vpnconffile &&
-sudo echo "  esp=$esppolicy" >> $vpnconffile &&
-sudo echo "  salifetime=${esplifetime}s" >> $vpnconffile &&
-sudo echo "  pfs=$pfs" >> $vpnconffile &&
-sudo echo "  keyingtries=2" >> $vpnconffile &&
-sudo echo "  auto=start" >> $vpnconffile &&
-sudo echo "$leftpeer $rightpeer: PSK \"$secret\"" > $vpnsecretsfile &&
-sudo chmod 0400 $vpnsecretsfile
+  sudo echo "conn vpn-$rightpeer" > $vpnconffile &&
 
 Review comment:
   I guess not, this is not used now (at least by xenserver,kvm and vmware). I 
edited this to sync with other changes.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158494303
 
 

 ##
 File path: systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py
 ##
 @@ -70,8 +70,8 @@ def configure_server(self):
 continue
 device = i['dev']
 ip = i['ip'].split('/')[0]
-sline = "dhcp-range=interface:%s,set:interface-%s-%s" % (device, 
device, idx)
-line = "dhcp-range=interface:%s,set:interface-%s-%s,%s,static" % 
(device, device, idx, ip)
+sline = "dhcp-range=set:interface-%s-%s" % (device, idx)
 
 Review comment:
   Per the new dnsmasq syntax, it is required to remove the old syntax that 
specific the interface.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158494240
 
 

 ##
 File path: systemvm/patches/debian/config/etc/ssh/sshd_config
 ##
 @@ -13,7 +13,6 @@
 Port 3922
 #AddressFamily any
 #ListenAddress 0.0.0.0
-#ListenAddress ::
 
 Review comment:
   This is just a comment, we SSH still via the ipv4 enable link-local/private 
ip.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158494191
 
 

 ##
 File path: systemvm/patches/debian/config/etc/rc.local
 ##
 @@ -1,4 +1,4 @@
-#/bin/bash
+#!/bin/bash
 
 Review comment:
   yup and we've removed rc.local :)


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158494158
 
 

 ##
 File path: systemvm/patches/debian/config/etc/init.d/cloud-early-config
 ##
 @@ -48,71 +41,45 @@ log_it() {
   log_action_msg "$@"
 }
 
-init_interfaces_orderby_macs() {
-macs=( $(echo $1 | sed "s/|/ /g") )
-total_nics=${#macs[@]}
-interface_file=${2:-"/etc/network/interfaces"}
-rule_file=${3:-"/etc/udev/rules.d/70-persistent-net.rules"}
-
-echo -n "auto lo" > $interface_file
-for((i=0; i> $interface_file
-fi
-done
-cat >> $interface_file << EOF
-
-iface lo inet loopback
-
-EOF
-
-echo "" > $rule_file
-for((i=0; i < ${#macs[@]}; i++))
-do
-echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", 
ATTR{address}==\"${macs[$i]}\", NAME=\"eth$i\"" >> $rule_file 
-done
-}
-
-init_interfaces() {
-  if [ "$NIC_MACS" == "" ]
-  then
-cat > /etc/network/interfaces << EOF
-auto lo $1 $2 $3
-iface lo inet loopback
-
-EOF
-  else
-init_interfaces_orderby_macs "$NIC_MACS"
-  fi
-}
-
 hypervisor() {
-  [ -d /proc/xen ] && mount -t xenfs none /proc/xen
-  [ -d /proc/xen ] && echo "xen-domU" && return 0
-
   local try=$([ -x /usr/sbin/virt-what ] && virt-what | tail -1)
   [ "$try" != "" ] && echo $try && return 0
 
-  vmware-checkvm &> /dev/null && echo "vmware" && return 0
-
   grep -q QEMU /proc/cpuinfo  && echo "kvm" && return 0
   grep -q QEMU /var/log/messages && echo "kvm" && return 0
 
+  [ -d /proc/xen ] && mount -t xenfs none /proc/xen
+  [ -d /proc/xen ] && echo "xen-domU" && return 0
+
+  vmware-checkvm &> /dev/null && echo "vmware" && return 0
+
   echo "unknown" && return 1
+}
 
+config_guest() {
+  if [ "$HYPERVISOR" == "kvm" ]
+  then
+# Configure hot-plug
+modprobe acpiphp || true
+modprobe pci_hotplug || true
+# Configure serial console FIXME: remove during build we enable it?
 
 Review comment:
   Not applicable for current state as they've been all fixed 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


[GitHub] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158493959
 
 

 ##
 File path: systemvm/conf/log4j-cloud.xml
 ##
 @@ -18,64 +18,82 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-
 http://jakarta.apache.org/log4j/; 
debug="false">
 



 
-   
-   
-  
+   
+  
+  
+  
+
+ 
 
 Review comment:
   Fixed.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158494007
 
 

 ##
 File path: systemvm/debian/opt/cloud/bin/cs/CsRedundant.py
 ##
 @@ -110,9 +107,10 @@ def _redundant_on(self):
 CsHelper.service("keepalived", "stop")
 return
 
-#CsHelper.mkdir(self.CS_RAMDISK_DIR, 0755, False)
-#CsHelper.mount_tmpfs(self.CS_RAMDISK_DIR)
-#CsHelper.mkdir(self.CS_ROUTER_DIR, 0755, False)
+# setup_router should execute this already:
 
 Review comment:
   Removed/re-added in recent commits.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158494007
 
 

 ##
 File path: systemvm/debian/opt/cloud/bin/cs/CsRedundant.py
 ##
 @@ -110,9 +107,10 @@ def _redundant_on(self):
 CsHelper.service("keepalived", "stop")
 return
 
-#CsHelper.mkdir(self.CS_RAMDISK_DIR, 0755, False)
-#CsHelper.mount_tmpfs(self.CS_RAMDISK_DIR)
-#CsHelper.mkdir(self.CS_ROUTER_DIR, 0755, False)
+# setup_router should execute this already:
 
 Review comment:
   Removed/re-added in recent versions.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158493553
 
 

 ##
 File path: systemvm/conf/log4j-cloud.xml
 ##
 @@ -18,64 +18,82 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-
 http://jakarta.apache.org/log4j/; 
debug="false">
 



 
-   
-   
-  
+   
 
 Review comment:
   This has been fixed after @rafaelweingartner 's code review in latest 
commits.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158493503
 
 

 ##
 File path: engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java
 ##
 @@ -52,8 +64,181 @@ public boolean supportsRollingUpgrade() {
 
 @Override
 public void performDataMigration(Connection conn) {
+updateSystemVmTemplates(conn);
 }
 
+@SuppressWarnings("serial")
+private void updateSystemVmTemplates(final Connection conn) {
 
 Review comment:
   Yes :)


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158493483
 
 

 ##
 File path: engine/schema/resources/META-INF/db/schema-41000to41100.sql
 ##
 @@ -489,3 +489,6 @@ INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, 
hypervisor_type, hypervi
 -- Add XenServer 7.2 hypervisor guest OS mappings (copy 7.1.0 & remove Windows 
Vista, Windows XP, Windows 2003, CentOS 4.x, RHEL 4.xS, LES 10 (all versions) 
as per XenServer 7.2 Release Notes)
 
 INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, 
hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) 
SELECT UUID(),'Xenserver', '7.2.0', guest_os_name, guest_os_id, 
utc_timestamp(), 0  FROM `cloud`.`guest_os_hypervisor` WHERE 
hypervisor_type='Xenserver' AND hypervisor_version='7.1.0' AND guest_os_id not 
in 
(1,2,3,4,56,101,56,58,93,94,50,51,87,88,89,90,91,92,26,27,28,29,40,41,42,43,44,45,96,97,107,108,109,110,151,152,153);
+
 
 Review comment:
   I'll see if I can fix 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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-22 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158493405
 
 

 ##
 File path: tools/appliance/systemvmtemplate/template.json
 ##
 @@ -0,0 +1,82 @@
+{
+  "_license": "Apache License 2.0",
 
 Review comment:
   No, just for information. Unfortunately, the packer jsons cannot have any 
license header but they allow custom tags/comments like this. They've been all 
removed from RAT checks.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-21 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158294932
 
 

 ##
 File path: engine/schema/src/com/cloud/user/UserAccountVO.java
 ##
 @@ -33,6 +33,7 @@
 
 import com.cloud.utils.db.Encrypt;
 import com.cloud.utils.db.GenericDao;
+import com.google.common.base.Strings;
 
 Review comment:
   We've been using `Strings.isNullOrEmpty`, and com.cloud.utils.StringUtils 
does not provide a utility to check if a string is empty or null.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-21 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158236647
 
 

 ##
 File path: systemvm/agent/conf/log4j-cloud.xml
 ##
 @@ -0,0 +1,131 @@
+
+
+
+http://jakarta.apache.org/log4j/; 
debug="false">
+
+   
+   
+   
+
+   
+  
+  
+  
+
+ 
+  
+ 
+
+
+
+   
+   
+   
+   
+
+
+ 
+
+
+
+ 
+   
+   
+   
+   
+
+ 
+ 
+ 
+
+
+   
+  
+  
+  
+
+
+  
+
+  
+ 
+  
+   
+
+   
+   
+   
+
+   
+  
+  
+
+  
+ 
+  
+   
+
+   
+   
+   
+
+   
+ 
+   
+
+   
+ 
+   
+
+   
+   
+  
+   
+
+   
+  
+   
+
+   
+ 
+   
+
+   
+ 
+   
+
+   
+  
+  
+   
+
+   
+   
+   
+
+   
+  
+  
+  
 
 Review comment:
   Fixed.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-21 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158234432
 
 

 ##
 File path: engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java
 ##
 @@ -52,8 +64,181 @@ public boolean supportsRollingUpgrade() {
 
 @Override
 public void performDataMigration(Connection conn) {
+updateSystemVmTemplates(conn);
 }
 
+@SuppressWarnings("serial")
+private void updateSystemVmTemplates(final Connection conn) {
+LOG.debug("Updating System Vm template IDs");
+// Get all hypervisors in use
+final Set hypervisorsListInUse = new 
HashSet();
+try (PreparedStatement pstmt = conn.prepareStatement("select 
distinct(hypervisor_type) from `cloud`.`cluster` where removed is null"); 
ResultSet rs = pstmt.executeQuery()) {
+while (rs.next()) {
+switch (Hypervisor.HypervisorType.getType(rs.getString(1))) {
+case XenServer:
+
hypervisorsListInUse.add(Hypervisor.HypervisorType.XenServer);
+break;
+case KVM:
+
hypervisorsListInUse.add(Hypervisor.HypervisorType.KVM);
+break;
+case VMware:
+
hypervisorsListInUse.add(Hypervisor.HypervisorType.VMware);
+break;
+case Hyperv:
+
hypervisorsListInUse.add(Hypervisor.HypervisorType.Hyperv);
+break;
+case LXC:
+
hypervisorsListInUse.add(Hypervisor.HypervisorType.LXC);
+break;
+case Ovm3:
+
hypervisorsListInUse.add(Hypervisor.HypervisorType.Ovm3);
+break;
+default:
+break;
+}
+}
+} catch (final SQLException e) {
+LOG.error("updateSystemVmTemplates: Exception caught while getting 
hypervisor types from clusters: " + e.getMessage());
+throw new CloudRuntimeException("updateSystemVmTemplates:Exception 
while getting hypervisor types from clusters", e);
+}
+
+final Map NewTemplateNameList = new 
HashMap() {
+{
+put(Hypervisor.HypervisorType.KVM, "systemvm-kvm-4.11");
+put(Hypervisor.HypervisorType.VMware, "systemvm-vmware-4.11");
+put(Hypervisor.HypervisorType.XenServer, 
"systemvm-xenserver-4.11");
+put(Hypervisor.HypervisorType.Hyperv, "systemvm-hyperv-4.11");
+put(Hypervisor.HypervisorType.LXC, "systemvm-lxc-4.11");
+put(Hypervisor.HypervisorType.Ovm3, "systemvm-ovm3-4.11");
+}
+};
+
+final Map 
routerTemplateConfigurationNames = new HashMap() {
+{
+put(Hypervisor.HypervisorType.KVM, "router.template.kvm");
+put(Hypervisor.HypervisorType.VMware, 
"router.template.vmware");
+put(Hypervisor.HypervisorType.XenServer, 
"router.template.xenserver");
+put(Hypervisor.HypervisorType.Hyperv, 
"router.template.hyperv");
+put(Hypervisor.HypervisorType.LXC, "router.template.lxc");
+put(Hypervisor.HypervisorType.Ovm3, "router.template.ovm3");
+}
+};
+
+final Map newTemplateUrl = new 
HashMap() {
+{
+// FIXME: upload templates
+put(Hypervisor.HypervisorType.KVM, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-kvm.qcow2.bz2;);
+put(Hypervisor.HypervisorType.VMware, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-vmware.ova;);
+put(Hypervisor.HypervisorType.XenServer, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-xen.vhd.bz2;);
+put(Hypervisor.HypervisorType.Hyperv, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-hyperv.vhd.zip;);
+put(Hypervisor.HypervisorType.LXC, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-kvm.qcow2.bz2;);
+put(Hypervisor.HypervisorType.Ovm3, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-ovm.raw.bz2;);
+}
+};
+
+final Map newTemplateChecksum = new 
HashMap() {
+{
+// FIXME: update checksums?
+put(Hypervisor.HypervisorType.KVM, 
"bc2eac46f16a2ece6c19d4b89db41de3");
+  

[GitHub] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-21 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158234432
 
 

 ##
 File path: engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java
 ##
 @@ -52,8 +64,181 @@ public boolean supportsRollingUpgrade() {
 
 @Override
 public void performDataMigration(Connection conn) {
+updateSystemVmTemplates(conn);
 }
 
+@SuppressWarnings("serial")
+private void updateSystemVmTemplates(final Connection conn) {
+LOG.debug("Updating System Vm template IDs");
+// Get all hypervisors in use
+final Set hypervisorsListInUse = new 
HashSet();
+try (PreparedStatement pstmt = conn.prepareStatement("select 
distinct(hypervisor_type) from `cloud`.`cluster` where removed is null"); 
ResultSet rs = pstmt.executeQuery()) {
+while (rs.next()) {
+switch (Hypervisor.HypervisorType.getType(rs.getString(1))) {
+case XenServer:
+
hypervisorsListInUse.add(Hypervisor.HypervisorType.XenServer);
+break;
+case KVM:
+
hypervisorsListInUse.add(Hypervisor.HypervisorType.KVM);
+break;
+case VMware:
+
hypervisorsListInUse.add(Hypervisor.HypervisorType.VMware);
+break;
+case Hyperv:
+
hypervisorsListInUse.add(Hypervisor.HypervisorType.Hyperv);
+break;
+case LXC:
+
hypervisorsListInUse.add(Hypervisor.HypervisorType.LXC);
+break;
+case Ovm3:
+
hypervisorsListInUse.add(Hypervisor.HypervisorType.Ovm3);
+break;
+default:
+break;
+}
+}
+} catch (final SQLException e) {
+LOG.error("updateSystemVmTemplates: Exception caught while getting 
hypervisor types from clusters: " + e.getMessage());
+throw new CloudRuntimeException("updateSystemVmTemplates:Exception 
while getting hypervisor types from clusters", e);
+}
+
+final Map NewTemplateNameList = new 
HashMap() {
+{
+put(Hypervisor.HypervisorType.KVM, "systemvm-kvm-4.11");
+put(Hypervisor.HypervisorType.VMware, "systemvm-vmware-4.11");
+put(Hypervisor.HypervisorType.XenServer, 
"systemvm-xenserver-4.11");
+put(Hypervisor.HypervisorType.Hyperv, "systemvm-hyperv-4.11");
+put(Hypervisor.HypervisorType.LXC, "systemvm-lxc-4.11");
+put(Hypervisor.HypervisorType.Ovm3, "systemvm-ovm3-4.11");
+}
+};
+
+final Map 
routerTemplateConfigurationNames = new HashMap() {
+{
+put(Hypervisor.HypervisorType.KVM, "router.template.kvm");
+put(Hypervisor.HypervisorType.VMware, 
"router.template.vmware");
+put(Hypervisor.HypervisorType.XenServer, 
"router.template.xenserver");
+put(Hypervisor.HypervisorType.Hyperv, 
"router.template.hyperv");
+put(Hypervisor.HypervisorType.LXC, "router.template.lxc");
+put(Hypervisor.HypervisorType.Ovm3, "router.template.ovm3");
+}
+};
+
+final Map newTemplateUrl = new 
HashMap() {
+{
+// FIXME: upload templates
+put(Hypervisor.HypervisorType.KVM, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-kvm.qcow2.bz2;);
+put(Hypervisor.HypervisorType.VMware, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-vmware.ova;);
+put(Hypervisor.HypervisorType.XenServer, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-xen.vhd.bz2;);
+put(Hypervisor.HypervisorType.Hyperv, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-hyperv.vhd.zip;);
+put(Hypervisor.HypervisorType.LXC, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-kvm.qcow2.bz2;);
+put(Hypervisor.HypervisorType.Ovm3, 
"https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-ovm.raw.bz2;);
+}
+};
+
+final Map newTemplateChecksum = new 
HashMap() {
+{
+// FIXME: update checksums?
+put(Hypervisor.HypervisorType.KVM, 
"bc2eac46f16a2ece6c19d4b89db41de3");
+  

[GitHub] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-21 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158233166
 
 

 ##
 File path: tools/appliance/systemvmtemplate/scripts/definition.rb
 ##
 @@ -29,7 +29,7 @@
 :os_type_id => 'Debian_64',
 :iso_file => 'debian-9.3.0-amd64-netinst.iso',
 :iso_src => 
'https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-9.3.0-amd64-netinst.iso',
-:iso_sha512 => 
'8775231d6f56a3d8f116eb64fe048f5cbd2ea0f8c092a1cb7608bcb4106f9c85cb69ce68f53bd381019ab40f1c0316843036daf3fd9107c81c58a240334cc747'
+:iso_md5 => 
'8775231d6f56a3d8f116eb64fe048f5cbd2ea0f8c092a1cb7608bcb4106f9c85cb69ce68f53bd381019ab40f1c0316843036daf3fd9107c81c58a240334cc747'
 
 Review comment:
   Thanks for point out, this file is no longer used. I've moved the 
systemvmtemplate build/export system to be packer based now where configuration 
is picked from a `template.json` file now. I've removed it 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


[GitHub] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-21 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158232805
 
 

 ##
 File path: python/lib/cloudutils/utilities.py
 ##
 @@ -216,8 +216,8 @@ def isKVMEnabled(self):
 class serviceOpsRedhat7(serviceOps):
 def isServiceRunning(self, servicename):
 try:
-o = bash("systemctl status " + servicename)
-if "running" in o.getStdout() or "start" in o.getStdout() or 
"Running" in o.getStdout():
+o = bash("systemctl is-active " + servicename)
+if "inactive" not in o.getStdout():
 
 Review comment:
   Simplified, fixed. Thanks.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-21 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r158232644
 
 

 ##
 File path: systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
 ##
 @@ -80,7 +80,7 @@ def configure_server(self):
 # DNS search order
 if gn.get_dns() and device:
 sline = "dhcp-option=tag:interface-%s-%s,6" % (device, idx)
-dns_list = [x for x in gn.get_dns() if x is not None]
+dns_list = [x for x in gn.get_dns() if not (not x)]
 
 Review comment:
   Fixed, I was trying to fix something that required `x` not be empty or None, 
I check again a simple `if x` works :)


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-19 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r157717581
 
 

 ##
 File path: 
plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
 ##
 @@ -2165,28 +2165,24 @@ private String appendFileType(String path, String 
fileType) {
 return path + fileType;
 }
 
-private void resizeRootDisk(VirtualMachineMO vmMo, DiskTO rootDiskTO, 
VmwareHypervisorHost hyperHost, VmwareContext context) throws Exception
-{
-Pair vdisk = getVirtualDiskInfo(vmMo, 
appendFileType(rootDiskTO.getPath(), ".vmdk"));
+private void resizeRootDiskOnVMStart(VirtualMachineMO vmMo, DiskTO 
rootDiskTO, VmwareHypervisorHost hyperHost, VmwareContext context) throws 
Exception {
+final Pair vdisk = getVirtualDiskInfo(vmMo, 
appendFileType(rootDiskTO.getPath(), ".vmdk"));
 assert(vdisk != null);
 
-Long reqSize=((VolumeObjectTO)rootDiskTO.getData()).getSize()/1024;
-VirtualDisk disk = vdisk.first();
-if (reqSize > disk.getCapacityInKB())
-{
-VirtualMachineDiskInfo diskInfo = 
getMatchingExistingDisk(vmMo.getDiskInfoBuilder(), rootDiskTO, hyperHost, 
context);
+final Long reqSize = ((VolumeObjectTO)rootDiskTO.getData()).getSize() 
/ 1024;
+final VirtualDisk disk = vdisk.first();
+if (reqSize > disk.getCapacityInKB()) {
+final VirtualMachineDiskInfo diskInfo = 
getMatchingExistingDisk(vmMo.getDiskInfoBuilder(), rootDiskTO, hyperHost, 
context);
 assert (diskInfo != null);
-String[] diskChain = diskInfo.getDiskChain();
+final String[] diskChain = diskInfo.getDiskChain();
 
-if (diskChain != null && diskChain.length>1)
-{
-s_logger.error("Unsupported Disk chain length "+ 
diskChain.length);
-throw new Exception("Unsupported Disk chain length "+ 
diskChain.length);
+if (diskChain != null && diskChain.length > 1) {
+s_logger.warn("Disk chain length for the VM is greater than 
one, skipping resizing of root disk.");
+return;
 }
-if (diskInfo.getDiskDeviceBusName() == null || 
!diskInfo.getDiskDeviceBusName().toLowerCase().startsWith("scsi"))
-{
-s_logger.error("Unsupported root disk device bus "+ 
diskInfo.getDiskDeviceBusName() );
-throw new Exception("Unsupported root disk device bus "+ 
diskInfo.getDiskDeviceBusName());
+if (diskInfo.getDiskDeviceBusName() == null || 
!diskInfo.getDiskDeviceBusName().toLowerCase().startsWith("scsi")) {
 
 Review comment:
   I'll explore, however, this seems adequate too.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-19 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r157717384
 
 

 ##
 File path: 
plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
 ##
 @@ -2165,28 +2165,24 @@ private String appendFileType(String path, String 
fileType) {
 return path + fileType;
 }
 
-private void resizeRootDisk(VirtualMachineMO vmMo, DiskTO rootDiskTO, 
VmwareHypervisorHost hyperHost, VmwareContext context) throws Exception
-{
-Pair vdisk = getVirtualDiskInfo(vmMo, 
appendFileType(rootDiskTO.getPath(), ".vmdk"));
+private void resizeRootDiskOnVMStart(VirtualMachineMO vmMo, DiskTO 
rootDiskTO, VmwareHypervisorHost hyperHost, VmwareContext context) throws 
Exception {
+final Pair vdisk = getVirtualDiskInfo(vmMo, 
appendFileType(rootDiskTO.getPath(), ".vmdk"));
 assert(vdisk != null);
 
-Long reqSize=((VolumeObjectTO)rootDiskTO.getData()).getSize()/1024;
-VirtualDisk disk = vdisk.first();
-if (reqSize > disk.getCapacityInKB())
-{
-VirtualMachineDiskInfo diskInfo = 
getMatchingExistingDisk(vmMo.getDiskInfoBuilder(), rootDiskTO, hyperHost, 
context);
+final Long reqSize = ((VolumeObjectTO)rootDiskTO.getData()).getSize() 
/ 1024;
 
 Review comment:
   Thanks, you're right it returns `Long` and can cause NPE I'll add suitable 
fix after a test run completes (maybe later today/tomorrow).


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-19 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r157717384
 
 

 ##
 File path: 
plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
 ##
 @@ -2165,28 +2165,24 @@ private String appendFileType(String path, String 
fileType) {
 return path + fileType;
 }
 
-private void resizeRootDisk(VirtualMachineMO vmMo, DiskTO rootDiskTO, 
VmwareHypervisorHost hyperHost, VmwareContext context) throws Exception
-{
-Pair vdisk = getVirtualDiskInfo(vmMo, 
appendFileType(rootDiskTO.getPath(), ".vmdk"));
+private void resizeRootDiskOnVMStart(VirtualMachineMO vmMo, DiskTO 
rootDiskTO, VmwareHypervisorHost hyperHost, VmwareContext context) throws 
Exception {
+final Pair vdisk = getVirtualDiskInfo(vmMo, 
appendFileType(rootDiskTO.getPath(), ".vmdk"));
 assert(vdisk != null);
 
-Long reqSize=((VolumeObjectTO)rootDiskTO.getData()).getSize()/1024;
-VirtualDisk disk = vdisk.first();
-if (reqSize > disk.getCapacityInKB())
-{
-VirtualMachineDiskInfo diskInfo = 
getMatchingExistingDisk(vmMo.getDiskInfoBuilder(), rootDiskTO, hyperHost, 
context);
+final Long reqSize = ((VolumeObjectTO)rootDiskTO.getData()).getSize() 
/ 1024;
 
 Review comment:
   Thanks, you're right I'll add suitable fix after a test run completes (maybe 
later today/tomorrow).


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-08 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r155747551
 
 

 ##
 File path: systemvm/debian/etc/systemd/system/cloud-password-server@.service
 ##
 @@ -0,0 +1,11 @@
+[Unit]
+Description=Cloud password server on %I
+After=network.target local-fs.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+Type=simple
+WorkingDirectory=/opt/cloud/bin
+ExecStart=/opt/cloud/bin/passwd_server_ip.py %I
 
 Review comment:
   Thanks @resmo fixed 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


[GitHub] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-12-08 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r155745859
 
 

 ##
 File path: systemvm/debian/etc/systemd/system/cloud-password-server@.service
 ##
 @@ -0,0 +1,11 @@
+[Unit]
+Description=Cloud password server on %I
+After=network.target local-fs.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+Type=simple
+WorkingDirectory=/opt/cloud/bin
+ExecStart=/opt/cloud/bin/passwd_server_ip.py %I
 
 Review comment:
   @resmo sure, I can add that. As per changing the owner of the process, 
please open a ticket. I would like to limit the scope, however, I admit I've 
already done too many new things in this PR :)


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-11-29 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r153797429
 
 

 ##
 File path: 
tools/appliance/definitions/systemvmtemplate/install_systemvm_packages.sh
 ##
 @@ -53,19 +53,21 @@ function install_packages() {
   fi
 
   ${apt_get} install grub-legacy \
-rsyslog logrotate cron insserv net-tools ifupdown vim tmux netbase 
iptables \
+rsyslog logrotate cron net-tools ifupdown vim tmux netbase iptables \
 openssh-server e2fsprogs tcpdump socat wget \
 python bzip2 sed gawk diffutils grep gzip less tar telnet ftp rsync 
traceroute psmisc lsof procps \
 inetutils-ping iputils-arping httping  curl \
-dnsutils zip unzip ethtool uuid file iproute acpid virt-what sudo \
+dnsutils zip unzip ethtool uuid file iproute acpid sudo \
 sysstat python-netaddr \
 apache2 ssl-cert \
 dnsmasq dnsmasq-utils \
 nfs-common \
 samba-common cifs-utils \
 xl2tpd bcrelay ppp ipsec-tools tdb-tools \
 xenstore-utils libxenstore3.0 \
-conntrackd ipvsadm libnetfilter-conntrack3 libnl-3-200 libnl-genl-3-200 \
+ipvsadm conntrackd libnetfilter-conntrack3 \
+keepalived irqbalance \
+libnl-3-200 libnl-genl-3-200 \
 
 Review comment:
   Sure, I'll check and remove them from the list if they can be removed.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-11-28 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r153578554
 
 

 ##
 File path: tools/appliance/definitions/systemvmtemplate/configure_networking.sh
 ##
 @@ -21,13 +21,6 @@ set -x
 
 HOSTNAME=systemvm
 
-# Adding a 2 sec delay to the interface up, to make the dhclient happy
-function set_interface_sleep() {
-  grep "pre-up sleep 2" /etc/network/interfaces && return
-
-  echo "pre-up sleep 2" >> /etc/network/interfaces
-}
-
 function configure_resolv_conf() {
   grep 8.8.8.8 /etc/resolv.conf && grep 8.8.4.4 /etc/resolv.conf && return
 
 Review comment:
   I'll check and remove.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-11-28 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r153578494
 
 

 ##
 File path: 
tools/appliance/definitions/systemvmtemplate/install_systemvm_packages.sh
 ##
 @@ -52,9 +52,9 @@ function install_packages() {
 ${apt_get} install links:i386 libuuid1:i386 libc6:i386
   fi
 
-  ${apt_get} install \
-rsyslog logrotate cron chkconfig insserv net-tools ifupdown vim-tiny 
netbase iptables \
-openssh-server e2fsprogs dhcp3-client tcpdump socat wget \
+  ${apt_get} install grub-legacy \
+rsyslog logrotate cron insserv net-tools ifupdown vim tmux netbase 
iptables \
 
 Review comment:
   Can be removed, will 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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-11-23 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r152745371
 
 

 ##
 File path: 
tools/appliance/definitions/systemvmtemplate/install_systemvm_packages.sh
 ##
 @@ -67,42 +67,30 @@ function install_packages() {
 xenstore-utils libxenstore3.0 \
 conntrackd ipvsadm libnetfilter-conntrack3 libnl-3-200 libnl-genl-3-200 \
 ipcalc \
+openjdk-8-jre-headless \
 ipset \
 iptables-persistent \
 libtcnative-1 libssl-dev libapr1-dev \
 python-flask \
 haproxy \
 radvd \
-sharutils
+sharutils \
+keepalived irqbalance open-vm-tools qemu-guest-agent \
+strongswan libcharon-extra-plugins libstrongswan-extra-plugins
 
-  ${apt_get} -t wheezy-backports install keepalived irqbalance open-vm-tools 
qemu-guest-agent
-  ${apt_get} -t wheezy-backports install strongswan libcharon-extra-plugins 
libstrongswan-extra-plugins
+  apt-get autoclean
+  apt-get clean
 
   apt-get update
-  apt-get -y --force-yes upgrade
+  apt-get -y upgrade
 
   if [ "${arch}" == "amd64" ]; then
 # Hyperv  kvp daemon - 64bit only
 # Download the hv kvp daemon
 wget http://people.apache.org/~rajeshbattala/hv-kvp-daemon_3.1_amd64.deb
 
 Review comment:
   Fixed to using distro provided 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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-11-23 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r152745166
 
 

 ##
 File path: tools/appliance/definitions/systemvmtemplate/definition.rb
 ##
 @@ -25,25 +25,19 @@
 # removed from the debian mirrors
 #
 architectures = {
-:i386 => {
-:os_type_id => 'Debian',
-:iso_file => 'debian-7.11.0-i386-netinst.iso',
-:iso_src => 
'http://cdimage.debian.org/cdimage/archive/7.11.0/i386/iso-cd/debian-7.11.0-i386-netinst.iso',
-:iso_md5 => '75055a694508f5b891038ec12d703c9e',
-},
 :amd64 => {
 :os_type_id => 'Debian_64',
-:iso_file => 'debian-7.11.0-amd64-netinst.iso',
-:iso_src => 
'http://cdimage.debian.org/cdimage/archive/7.11.0/amd64/iso-cd/debian-7.11.0-amd64-netinst.iso',
-:iso_md5 => '096c1c18b44c269808bd815d58c53c8f'
+:iso_file => 'debian-9.2.1-amd64-netinst.iso',
+:iso_src => 
'https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-9.2.1-amd64-netinst.iso',
+:iso_md5 => '5c583fd40360fd039b3ac98387b77dbb'
 
 Review comment:
   Fixed to using sha512


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-11-21 Thread GitBox
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r152253028
 
 

 ##
 File path: systemvm/patches/debian/config/opt/cloud/bin/configure.py
 ##
 @@ -172,8 +172,13 @@ def add_rule(self):
 
 logging.debug("egress   rule  ==> %s", self.rule)
 for cidr in self.rule['dcidr']:
-ipsetAddCmd = 'ipset add '+ destIpsetName + ' '+cidr
-CsHelper.execute(ipsetAddCmd)
+# Bug reference: 
https://bugzilla.redhat.com/show_bug.cgi?id=1297092
+if cidr == '0.0.0.0/0':
+CsHelper.execute('ipset add '+ destIpsetName + ' 
0.0.0.0/1')
+CsHelper.execute('ipset add '+ destIpsetName + ' 
128.0.0.0/1')
+else:
+ipsetAddCmd = 'ipset add '+ destIpsetName + ' ' + cidr
+CsHelper.execute(ipsetAddCmd)
 dflag = True
 
 Review comment:
   @NuxRo FYI - I've fixed the egress 0.0.0.0/0 issue in this branch.


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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-08-10 Thread git
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r132454805
 
 

 ##
 File path: 
utils/src/main/java/org/apache/cloudstack/utils/imagestore/ImageStoreUtil.java
 ##
 @@ -81,7 +81,7 @@ public static String checkTemplateFormat(String path, String 
uripath) {
 return "";
 }
 
-if (output.contains("ISO 9660") && isCorrectExtension(uripath, "iso")) 
{
+if ((output.startsWith("ISO 9660") || output.startsWith("DOS/MBR")) && 
isCorrectExtension(uripath, "iso")) {
 
 Review comment:
   We might need to revisit this, this should not happen. 
 

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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-08-10 Thread git
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r132454476
 
 

 ##
 File path: 
tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh
 ##
 @@ -107,8 +107,8 @@ EOF
 
   systemctl daemon-reload
   systemctl enable cloud-early-config
-  systemctl disable cloud-passwd-srvr
-  systemctl disable cloud
+  systemctl enable cloud-passwd-srvr
+  systemctl enable cloud
 
 Review comment:
   @wido We may not want to enable the services by default, but only through 
cloud-early-config's patching?
 

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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-08-10 Thread git
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r132436288
 
 

 ##
 File path: 
tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh
 ##
 @@ -39,12 +39,76 @@ function install_cloud_scripts() {
 /etc/init.d/{cloud,cloud-early-config,cloud-passwd-srvr,postinit} \
 /etc/profile.d/cloud.sh
 
-  chkconfig --add cloud-early-config
-  chkconfig cloud-early-config on
-  chkconfig --add cloud-passwd-srvr
-  chkconfig cloud-passwd-srvr off
-  chkconfig --add cloud
-  chkconfig cloud off
+  cat > /lib/systemd/system/cloud-early-config.service << EOF
 
 Review comment:
   @wido thanks, please feel free to do so.
 

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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-08-10 Thread git
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r132432437
 
 

 ##
 File path: tools/appliance/definitions/systemvmtemplate/configure_login.sh
 ##
 @@ -23,11 +23,12 @@ function add_admin_group() {
   groupadd -f -r admin
 }
 
-function configure_cloud_user() {
+function configure_user() {
   usermod -a -G admin cloud
   mkdir -p /home/cloud/.ssh
   chmod 700 /home/cloud/.ssh
   echo "cloud:`openssl rand -base64 32`" | chpasswd
+  echo "root:password" | chpasswd
 
 Review comment:
   Yes, this is ensure all systemvmtemplates have this default credentials 
(this is what the current systemvmtemplates use as well). In production env, 
you can set `system.vm.random.password` to true which then uses 
`system.vm.password` to get the password randomly set when mgmt server is 
initialized.
 

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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-08-10 Thread git
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r132431725
 
 

 ##
 File path: tools/appliance/definitions/systemvmtemplate/configure_networking.sh
 ##
 @@ -52,8 +45,24 @@ function configure_hostname() {
   hostname $HOSTNAME
 }
 
+function configure_interfaces() {
+  cat > /etc/network/interfaces << EOF
+source /etc/network/interfaces.d/*
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+auto eth0
+iface eth0 inet dhcp
+pre-up sleep 2
 
 Review comment:
   Historic reasons, I've no idea. I simply moved the code from here: 
https://github.com/apache/cloudstack/blob/master/tools/appliance/definitions/systemvmtemplate/configure_networking.sh#L28
 

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] rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9

2017-08-10 Thread git
rhtyd commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate 
systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r132431563
 
 

 ##
 File path: 
tools/appliance/definitions/systemvmtemplate/configure_systemvm_services.sh
 ##
 @@ -39,12 +39,76 @@ function install_cloud_scripts() {
 /etc/init.d/{cloud,cloud-early-config,cloud-passwd-srvr,postinit} \
 /etc/profile.d/cloud.sh
 
-  chkconfig --add cloud-early-config
-  chkconfig cloud-early-config on
-  chkconfig --add cloud-passwd-srvr
-  chkconfig cloud-passwd-srvr off
-  chkconfig --add cloud
-  chkconfig cloud off
+  cat > /lib/systemd/system/cloud-early-config.service << EOF
 
 Review comment:
   We can do that, but isn't the files in 
/etc/systemd/system/multi-user.target.wants symlinked to /lib/systemd? I'm open 
to changes as long as the stuff works.
 

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