[GitHub] DaanHoogland closed pull request #2299: WIP: CLOUDSTACK-10118 Domain level settings
DaanHoogland closed pull request #2299: WIP: CLOUDSTACK-10118 Domain level settings URL: https://github.com/apache/cloudstack/pull/2299 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java index 8f71f48470e..80ebaf43f64 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.List; +import org.apache.cloudstack.api.response.DomainResponse; import org.apache.log4j.Logger; import org.apache.cloudstack.api.APICommand; @@ -77,6 +78,12 @@ description = "the ID of the Account to update the parameter value for corresponding account") private Long accountId; +@Parameter(name = ApiConstants.DOMAIN_ID, + type = CommandType.UUID, + entityType = DomainResponse.class, + description = "the ID of the Domain to update the parameter value for corresponding domain") +private Long domainId; + @Parameter(name = ApiConstants.IMAGE_STORE_UUID, type = CommandType.UUID, entityType = ImageStoreResponse.class, @@ -111,6 +118,10 @@ public Long getAccountId() { return accountId; } +public Long getDomainId() { +return domainId; +} + public Long getImageStoreId() { return imageStoreId; } @@ -158,6 +169,9 @@ public void execute() { if (getAccountId() != null) { cfgResponse.setScope("account"); } +if (getDomainId() != null) { +cfgResponse.setScope("domain"); +} if (getImageStoreId() != null){ cfgResponse.setScope("imagestore"); } diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java index fa5e26e418f..936f0cd69f1 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java @@ -18,6 +18,7 @@ import com.google.common.base.Strings; import org.apache.cloudstack.acl.RoleService; +import org.apache.cloudstack.api.response.DomainResponse; import org.apache.log4j.Logger; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiArgValidator; @@ -76,6 +77,12 @@ description = "the ID of the Account to update the parameter value for corresponding account") private Long accountId; +@Parameter(name = ApiConstants.DOMAIN_ID, + type = CommandType.UUID, + entityType = DomainResponse.class, + description = "the ID of the Domain to update the parameter value for corresponding domain") +private Long domainId; + @Parameter(name = ApiConstants.IMAGE_STORE_UUID, type = CommandType.UUID, entityType = ImageStoreResponse.class, @@ -115,6 +122,10 @@ public Long getAccountId() { return accountId; } +public Long getDomainId() { +return domainId; +} + public Long getImageStoreId() { return imageStoreId; } @@ -157,6 +168,9 @@ public void execute() { if (getAccountId() != null) { response.setScope("account"); } +if (getDomainId() != null) { +response.setScope("domain"); +} response.setValue(value); this.setResponseObject(response); } else { diff --git a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml index 8a0d7cdde5c..84c27583925 100644 --- a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml +++ b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml @@ -147,6 +147,7 @@ + diff --git a/engine/schema/src/com/cloud/domain/DomainDetailVO.java b/engine/schema/src/com/cloud/domain/DomainDetailVO.java new file mode 100644 index 000..61eb6cfd28e --- /dev/null +++ b/engine/schema/src/com/cloud/domain/DomainDetailVO.java @@ -0,0 +1,76 @@ +// 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
[GitHub] DaanHoogland commented on issue #2299: WIP: CLOUDSTACK-10118 Domain level settings
DaanHoogland commented on issue #2299: WIP: CLOUDSTACK-10118 Domain level settings URL: https://github.com/apache/cloudstack/pull/2299#issuecomment-352998391 closing in favour of #2369 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 closed pull request #2048: CLOUDSTACK-9880: Expansion of Management IP Range.
DaanHoogland closed pull request #2048: CLOUDSTACK-9880: Expansion of Management IP Range. URL: https://github.com/apache/cloudstack/pull/2048 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/api/src/com/cloud/configuration/ConfigurationService.java b/api/src/com/cloud/configuration/ConfigurationService.java index b13122208ee..5af44ed18f4 100644 --- a/api/src/com/cloud/configuration/ConfigurationService.java +++ b/api/src/com/cloud/configuration/ConfigurationService.java @@ -19,7 +19,9 @@ import java.util.List; import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd; +import org.apache.cloudstack.api.command.admin.network.CreateManagementNetworkIpRangeCmd; import org.apache.cloudstack.api.command.admin.network.CreateNetworkOfferingCmd; +import org.apache.cloudstack.api.command.admin.network.DeleteManagementNetworkIpRangeCmd; import org.apache.cloudstack.api.command.admin.network.DeleteNetworkOfferingCmd; import org.apache.cloudstack.api.command.admin.network.UpdateNetworkOfferingCmd; import org.apache.cloudstack.api.command.admin.offering.CreateDiskOfferingCmd; @@ -160,6 +162,19 @@ */ Pod createPod(long zoneId, String name, String startIp, String endIp, String gateway, String netmask, String allocationState); +/** + * Creates a mutual exclusive IP range in the pod with same gateway, netmask. + * @param cmd - The command specifying pod ID, start IP, end IP, gateway, netmask. + * @return The new range if successful, null otherwise. + */ +Pod createPodIpRange(CreateManagementNetworkIpRangeCmd cmd); + +/** + * Deletes a mutually exclusive IP range in the pod. + * @param cmd - The command specifying pod ID, start IP, end IP. + */ +void deletePodIpRange(DeleteManagementNetworkIpRangeCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException; + /** * Edits a pod in the database. Will not allow you to edit pods that are being used anywhere in the system. * diff --git a/api/src/com/cloud/dc/StorageNetworkIpRange.java b/api/src/com/cloud/dc/StorageNetworkIpRange.java index 2b50ca1594e..03d4f44de48 100644 --- a/api/src/com/cloud/dc/StorageNetworkIpRange.java +++ b/api/src/com/cloud/dc/StorageNetworkIpRange.java @@ -21,20 +21,19 @@ import org.apache.cloudstack.api.InternalIdentity; public interface StorageNetworkIpRange extends InfrastructureEntity, InternalIdentity, Identity { - Integer getVlan(); -String getPodUuid(); +String getGateway(); + +String getNetmask(); String getStartIp(); String getEndIp(); -String getNetworkUuid(); - String getZoneUuid(); -String getNetmask(); +String getPodUuid(); -String getGateway(); +String getNetworkUuid(); } diff --git a/api/src/com/cloud/event/EventTypes.java b/api/src/com/cloud/event/EventTypes.java index ec3f3ac6d10..d5d11e87702 100644 --- a/api/src/com/cloud/event/EventTypes.java +++ b/api/src/com/cloud/event/EventTypes.java @@ -296,6 +296,9 @@ public static final String EVENT_VLAN_IP_RANGE_DEDICATE = "VLAN.IP.RANGE.DEDICATE"; public static final String EVENT_VLAN_IP_RANGE_RELEASE = "VLAN.IP.RANGE.RELEASE"; +public static final String EVENT_MANAGEMENT_IP_RANGE_CREATE = "MANAGEMENT.IP.RANGE.CREATE"; +public static final String EVENT_MANAGEMENT_IP_RANGE_DELETE = "MANAGEMENT.IP.RANGE.DELETE"; + public static final String EVENT_STORAGE_IP_RANGE_CREATE = "STORAGE.IP.RANGE.CREATE"; public static final String EVENT_STORAGE_IP_RANGE_DELETE = "STORAGE.IP.RANGE.DELETE"; public static final String EVENT_STORAGE_IP_RANGE_UPDATE = "STORAGE.IP.RANGE.UPDATE"; @@ -761,6 +764,9 @@ entityEventDetails.put(EVENT_VLAN_IP_RANGE_DEDICATE, Vlan.class); entityEventDetails.put(EVENT_VLAN_IP_RANGE_RELEASE, Vlan.class); +entityEventDetails.put(EVENT_MANAGEMENT_IP_RANGE_CREATE, Pod.class); +entityEventDetails.put(EVENT_MANAGEMENT_IP_RANGE_DELETE, Pod.class); + entityEventDetails.put(EVENT_STORAGE_IP_RANGE_CREATE, StorageNetworkIpRange.class); entityEventDetails.put(EVENT_STORAGE_IP_RANGE_DELETE, StorageNetworkIpRange.class); entityEventDetails.put(EVENT_STORAGE_IP_RANGE_UPDATE, StorageNetworkIpRange.class); diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/CreateManagementNetworkIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/CreateManagementNetworkIpRangeCmd.java new file mode 100644 index 000..e5bfc07c699 --- /dev/null +++ b/api/src/org/apache/cloudstack/api/command/admin/network/CreateManagementNetworkIpRangeCmd.java @@ -0,0 +1,145 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more
[GitHub] DaanHoogland commented on issue #2208: CLOUDSTACK-9542 make listNics and ListUserVms return uniform NIC data
DaanHoogland commented on issue #2208: CLOUDSTACK-9542 make listNics and ListUserVms return uniform NIC data URL: https://github.com/apache/cloudstack/pull/2208#issuecomment-35326 Yes @rhtyd I will rebase one last time. 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 #2035: CLOUDSTACK-9867:VM snapshot on primary storage usage metrics
blueorangutan commented on issue #2035: CLOUDSTACK-9867:VM snapshot on primary storage usage metrics URL: https://github.com/apache/cloudstack/pull/2035#issuecomment-352999798 @borisstoyanov 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] borisstoyanov commented on issue #2035: CLOUDSTACK-9867:VM snapshot on primary storage usage metrics
borisstoyanov commented on issue #2035: CLOUDSTACK-9867:VM snapshot on primary storage usage metrics URL: https://github.com/apache/cloudstack/pull/2035#issuecomment-352999756 @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] blueorangutan commented on issue #2117: CLOUDSTACK-8735:Browser Based Volume and Template Upload Test Automat?
blueorangutan commented on issue #2117: CLOUDSTACK-8735:Browser Based Volume and Template Upload Test Automat? URL: https://github.com/apache/cloudstack/pull/2117#issuecomment-35329 Packaging result: ?centos6 ?centos7 ?debian. JID-1432 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 issue #2366: CLOUDSTACK-10168 - VR duplicate entries in /etc/hosts when reusing VM name
rhtyd commented on issue #2366: CLOUDSTACK-10168 - VR duplicate entries in /etc/hosts when reusing VM name URL: https://github.com/apache/cloudstack/pull/2366#issuecomment-353000641 @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 #2366: CLOUDSTACK-10168 - VR duplicate entries in /etc/hosts when reusing VM name
blueorangutan commented on issue #2366: CLOUDSTACK-10168 - VR duplicate entries in /etc/hosts when reusing VM name URL: https://github.com/apache/cloudstack/pull/2366#issuecomment-353000660 @rhtyd 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] rhtyd commented on issue #2367: Fix ACL_INBOUND/OUTBOUND rules for PrivateGateway
rhtyd commented on issue #2367: Fix ACL_INBOUND/OUTBOUND rules for PrivateGateway URL: https://github.com/apache/cloudstack/pull/2367#issuecomment-353001860 This may cause regressions in other cases with the stated assumption, additional review is requested. I'll run some tests. @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] krissterckx commented on issue #2259: CLOUDSTACK-10024: Network migration support
krissterckx commented on issue #2259: CLOUDSTACK-10024: Network migration support URL: https://github.com/apache/cloudstack/pull/2259#issuecomment-353003052 @borisstoyanov this PR adds MigrateNetworkCmd.class and MigrateVPCCmd.class as new commands, which just causes git not to know in which order to add them. The problem is, we can keep on rebasing - each time some other commits goes in, we possibly need to rebase again :-) We can/will do that but i also would like to see review and Trillian results. Do you prefer us to rebase again first ? 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] borisstoyanov commented on issue #2344: CLOUDSTACK-10163: Component tests sanity
borisstoyanov commented on issue #2344: CLOUDSTACK-10163: Component tests sanity URL: https://github.com/apache/cloudstack/pull/2344#issuecomment-353003839 @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] blueorangutan commented on issue #2344: CLOUDSTACK-10163: Component tests sanity
blueorangutan commented on issue #2344: CLOUDSTACK-10163: Component tests sanity URL: https://github.com/apache/cloudstack/pull/2344#issuecomment-353004045 @borisstoyanov 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] blueorangutan commented on issue #2035: CLOUDSTACK-9867:VM snapshot on primary storage usage metrics
blueorangutan commented on issue #2035: CLOUDSTACK-9867:VM snapshot on primary storage usage metrics URL: https://github.com/apache/cloudstack/pull/2035#issuecomment-353006797 Packaging result: ?centos6 ?centos7 ?debian. JID-1433 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 #2367: Fix ACL_INBOUND/OUTBOUND rules for PrivateGateway
blueorangutan commented on issue #2367: Fix ACL_INBOUND/OUTBOUND rules for PrivateGateway URL: https://github.com/apache/cloudstack/pull/2367#issuecomment-353008201 Packaging result: ?centos6 ?centos7 ?debian. JID-1434 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 #1762: CLOUDSTACK-9595 Transactions are not getting retried in case of datab?
rhtyd commented on a change in pull request #1762: CLOUDSTACK-9595 Transactions are not getting retried in case of datab? URL: https://github.com/apache/cloudstack/pull/1762#discussion_r157970919 ## File path: server/src/com/cloud/network/IpAddressManagerImpl.java ## @@ -901,40 +916,28 @@ public PublicIp assignDedicateIpAddress(Account owner, final Long guestNtwkId, f PublicIp ip = null; try { -ip = Transaction.execute(new TransactionCallbackWithException() { Review comment: @yvsubhash I've found a regression with changes to this method. It causes SNAT IPs to not get allocated and we see something like this: ``` 2017-12-20 14:32:40,402 ERROR [c.c.n.IpAddressManagerImpl] (API-Job-Executor-16:ctx-d4229b63 job-418 ctx-da9f0f88) (logid:8f31a2f6) Unable to get source nat ip address for account 2 ``` This causes VPC/VPN tests to fail. 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 #2344: CLOUDSTACK-10163: Component tests sanity
blueorangutan commented on issue #2344: CLOUDSTACK-10163: Component tests sanity URL: https://github.com/apache/cloudstack/pull/2344#issuecomment-353009956 Packaging result: ?centos6 ?centos7 ?debian. JID-1435 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 #2344: CLOUDSTACK-10163: Component tests sanity
blueorangutan commented on issue #2344: CLOUDSTACK-10163: Component tests sanity URL: https://github.com/apache/cloudstack/pull/2344#issuecomment-353011065 @borisstoyanov 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] borisstoyanov commented on issue #2344: CLOUDSTACK-10163: Component tests sanity
borisstoyanov commented on issue #2344: CLOUDSTACK-10163: Component tests sanity URL: https://github.com/apache/cloudstack/pull/2344#issuecomment-353010895 @blueorangutan test centos7 kvm-centos7 component/test_*.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] borisstoyanov commented on issue #2048: CLOUDSTACK-9880: Expansion of Management IP Range.
borisstoyanov commented on issue #2048: CLOUDSTACK-9880: Expansion of Management IP Range. URL: https://github.com/apache/cloudstack/pull/2048#issuecomment-352997966 I think this looks good now, the failures are not related 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 opened a new pull request #2369: CLOUDSTACK-10117 Domain level ldap configuration
DaanHoogland opened a new pull request #2369: CLOUDSTACK-10117 Domain level ldap configuration URL: https://github.com/apache/cloudstack/pull/2369 This contains fixes and implementation of CLOUDSTACK-10117 and CLOUDSTACK-10118, enabling the operator to configure an ldap server per domain. Work will follow that enables mapping of accounts to ldap-domains but as is this change is functional if no further mapping is needed. 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: CLOUDSTACK-9880: Expansion of Management IP Range. (#2048)
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 The following commit(s) were added to refs/heads/master by this push: new 8acb090 CLOUDSTACK-9880: Expansion of Management IP Range. (#2048) 8acb090 is described below commit 8acb0908c409d4bf49244f861f38cd4b64de2398 Author: Nitin Kumar MaharanaAuthorDate: Wed Dec 20 14:06:53 2017 +0530 CLOUDSTACK-9880: Expansion of Management IP Range. (#2048) At present, The management IP range can only be expanded under the same subnet. According to existing range, either the last IP can be forward extended or the first IP can be backward extended. But we cannot add an entirely different range from the same subnet. So the expansion of range is subnet bound, which is fixed. But when the range gets exhausted and a user wants to deploy more system VMs, then the operation would fail. The purpose of this feature is to expand the range of manag [...] Please refer the FS here: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Expansion+of+Management+IP+Range --- .../cloud/configuration/ConfigurationService.java | 15 + api/src/com/cloud/dc/StorageNetworkIpRange.java| 11 +- api/src/com/cloud/event/EventTypes.java| 6 + .../network/CreateManagementNetworkIpRangeCmd.java | 145 .../network/DeleteManagementNetworkIpRangeCmd.java | 129 +++ .../cloudstack/api/response/PodResponse.java | 12 +- .../com/cloud/dc/dao/DataCenterIpAddressDao.java | 15 +- .../cloud/dc/dao/DataCenterIpAddressDaoImpl.java | 26 ++ server/src/com/cloud/api/ApiResponseHelper.java| 18 +- .../configuration/ConfigurationManagerImpl.java| 395 +++-- .../cloud/network/StorageNetworkManagerImpl.java | 21 +- .../src/com/cloud/server/ManagementServerImpl.java | 10 +- .../cloud/vpc/MockConfigurationManagerImpl.java| 20 ++ ui/l10n/en.js | 2 + ui/scripts/system.js | 204 +++ 15 files changed, 836 insertions(+), 193 deletions(-) diff --git a/api/src/com/cloud/configuration/ConfigurationService.java b/api/src/com/cloud/configuration/ConfigurationService.java index b131222..5af44ed 100644 --- a/api/src/com/cloud/configuration/ConfigurationService.java +++ b/api/src/com/cloud/configuration/ConfigurationService.java @@ -19,7 +19,9 @@ package com.cloud.configuration; import java.util.List; import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd; +import org.apache.cloudstack.api.command.admin.network.CreateManagementNetworkIpRangeCmd; import org.apache.cloudstack.api.command.admin.network.CreateNetworkOfferingCmd; +import org.apache.cloudstack.api.command.admin.network.DeleteManagementNetworkIpRangeCmd; import org.apache.cloudstack.api.command.admin.network.DeleteNetworkOfferingCmd; import org.apache.cloudstack.api.command.admin.network.UpdateNetworkOfferingCmd; import org.apache.cloudstack.api.command.admin.offering.CreateDiskOfferingCmd; @@ -161,6 +163,19 @@ public interface ConfigurationService { Pod createPod(long zoneId, String name, String startIp, String endIp, String gateway, String netmask, String allocationState); /** + * Creates a mutual exclusive IP range in the pod with same gateway, netmask. + * @param cmd - The command specifying pod ID, start IP, end IP, gateway, netmask. + * @return The new range if successful, null otherwise. + */ +Pod createPodIpRange(CreateManagementNetworkIpRangeCmd cmd); + +/** + * Deletes a mutually exclusive IP range in the pod. + * @param cmd - The command specifying pod ID, start IP, end IP. + */ +void deletePodIpRange(DeleteManagementNetworkIpRangeCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException; + +/** * Edits a pod in the database. Will not allow you to edit pods that are being used anywhere in the system. * * @param UpdatePodCmd diff --git a/api/src/com/cloud/dc/StorageNetworkIpRange.java b/api/src/com/cloud/dc/StorageNetworkIpRange.java index 2b50ca1..03d4f44 100644 --- a/api/src/com/cloud/dc/StorageNetworkIpRange.java +++ b/api/src/com/cloud/dc/StorageNetworkIpRange.java @@ -21,20 +21,19 @@ import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; public interface StorageNetworkIpRange extends InfrastructureEntity, InternalIdentity, Identity { - Integer getVlan(); -String getPodUuid(); +String getGateway(); + +String getNetmask(); String getStartIp(); String getEndIp(); -String getNetworkUuid(); - String getZoneUuid(); -String getNetmask(); +String getPodUuid(); -String getGateway(); +String getNetworkUuid(); } diff --git a/api/src/com/cloud/event/EventTypes.java
[GitHub] DaanHoogland closed pull request #2363: 4.8.0.1 rc20160525 t1247
DaanHoogland closed pull request #2363: 4.8.0.1 rc20160525 t1247 URL: https://github.com/apache/cloudstack/pull/2363 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 #2363: 4.8.0.1 rc20160525 t1247
DaanHoogland commented on issue #2363: 4.8.0.1 rc20160525 t1247 URL: https://github.com/apache/cloudstack/pull/2363#issuecomment-352999702 not a vaild 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] borisstoyanov commented on issue #2368: CLOUDSTACK-10126: Separate Subnet for SSVM and CPVM
borisstoyanov commented on issue #2368: CLOUDSTACK-10126: Separate Subnet for SSVM and CPVM URL: https://github.com/apache/cloudstack/pull/2368#issuecomment-352999454 @nvazquez it appears this one has conflicts, can you please resolve them and I'll run tests on 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 #2366: CLOUDSTACK-10168 - VR duplicate entries in /etc/hosts when reusing VM name
rhtyd commented on a change in pull request #2366: CLOUDSTACK-10168 - VR duplicate entries in /etc/hosts when reusing VM name URL: https://github.com/apache/cloudstack/pull/2366#discussion_r157964380 ## File path: systemvm/patches/debian/config/opt/cloud/bin/cs_dhcp.py ## @@ -18,17 +18,22 @@ from pprint import pprint from netaddr import * - def merge(dbag, data): - # A duplicate ip address wil clobber the old value # This seems desirable -if "add" in data and data['add'] is False and \ -"ipv4_adress" in data: -if data['ipv4_adress'] in dbag: -del(dbag[data['ipv4_adress']]) -return dbag +if "add" in data and data['add'] is False and "ipv4_address" in data: +if data['ipv4_address'] in dbag: +del(dbag[data['ipv4_address']]) else: -dbag[data['ipv4_adress']] = data -return dbag +remove_key = None +for key, entry in dbag.iteritems(): +if key <> 'id' and entry['host_name'] == data['host_name']: Review comment: `<>` is deprecated and removed in Python 3.x, please use `!=` 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] blueorangutan commented on issue #2367: Fix ACL_INBOUND/OUTBOUND rules for PrivateGateway
blueorangutan commented on issue #2367: Fix ACL_INBOUND/OUTBOUND rules for PrivateGateway URL: https://github.com/apache/cloudstack/pull/2367#issuecomment-353001946 @rhtyd 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] krissterckx commented on issue #2097: [4.11] CLOUDSTACK-9813: Extending Config Drive support
krissterckx commented on issue #2097: [4.11] CLOUDSTACK-9813: Extending Config Drive support URL: https://github.com/apache/cloudstack/pull/2097#issuecomment-353004576 Hi @rhtyd i see you removed 4.11 label from the PR. See discussion thread with @wido. At Nuage we see lots of interest for adding configdrive support in CloudStack. 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] borisstoyanov commented on issue #2259: CLOUDSTACK-10024: Network migration support
borisstoyanov commented on issue #2259: CLOUDSTACK-10024: Network migration support URL: https://github.com/apache/cloudstack/pull/2259#issuecomment-353005252 @krissterckx sure I can kick the marvin tests, have you managed to add the default network provider 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] rhtyd commented on a change in pull request #1762: CLOUDSTACK-9595 Transactions are not getting retried in case of datab?
rhtyd commented on a change in pull request #1762: CLOUDSTACK-9595 Transactions are not getting retried in case of datab? URL: https://github.com/apache/cloudstack/pull/1762#discussion_r157976364 ## File path: server/src/com/cloud/network/IpAddressManagerImpl.java ## @@ -901,40 +916,28 @@ public PublicIp assignDedicateIpAddress(Account owner, final Long guestNtwkId, f PublicIp ip = null; try { -ip = Transaction.execute(new TransactionCallbackWithException() { -@Override -public PublicIp doInTransaction(TransactionStatus status) throws InsufficientAddressCapacityException { -Account owner = _accountDao.acquireInLockTable(ownerId); - -if (owner == null) { -// this ownerId comes from owner or type Account. See the class "AccountVO" and the annotations in that class -// to get the table name and field name that is queried to fill this ownerid. -ConcurrentOperationException ex = new ConcurrentOperationException("Unable to lock account"); -throw ex; -} -if (s_logger.isDebugEnabled()) { -s_logger.debug("lock account " + ownerId + " is acquired"); -} -boolean displayIp = true; -if (guestNtwkId != null) { -Network ntwk = _networksDao.findById(guestNtwkId); -displayIp = ntwk.getDisplayNetwork(); -} else if (vpcId != null) { -VpcVO vpc = _vpcDao.findById(vpcId); -displayIp = vpc.isDisplay(); -} +Account ownerAccount = _accountDao.acquireInLockTable(ownerId); -PublicIp ip = fetchNewPublicIp(dcId, null, null, owner, VlanType.VirtualNetwork, guestNtwkId, isSourceNat, false, null, false, vpcId, displayIp); Review comment: @yvsubhash The old code used to mark the new public IP as allocated, but new code does not do that here. I found a fix is to pass the assign to true. I'll fix it in my PR #2211. 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 #2370: CLOUDSTACK-9595: Fix regression introduced in #1762
blueorangutan commented on issue #2370: CLOUDSTACK-9595: Fix regression introduced in #1762 URL: https://github.com/apache/cloudstack/pull/2370#issuecomment-353021534 @rhtyd 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] blueorangutan commented on issue #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9
blueorangutan commented on issue #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9 URL: https://github.com/apache/cloudstack/pull/2211#issuecomment-352856628 Packaging result: ?centos6 ?centos7 ?debian. JID-1429 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] borisstoyanov commented on issue #2350: Cloudstack 10170 - fixes resource tags security bugs and adds account tags support
borisstoyanov commented on issue #2350: Cloudstack 10170 - fixes resource tags security bugs and adds account tags support URL: https://github.com/apache/cloudstack/pull/2350#issuecomment-353023157 @bwsw can you look at the failures, the fail rate is quite big on this PR, we don't observe that much failures with master. 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] 06/22: CLOUDSTACK-10129: UX improvements and event timeline
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 37169eb44adcd112a86a8c498d6c5e0a8f1a5117 Author: Rohit YadavAuthorDate: Tue Nov 28 19:25:09 2017 +0530 CLOUDSTACK-10129: UX improvements and event timeline - Fixes timezone issue where dates show up as nvalid in UI - Introduces new event timeline listing/filtering of events - Several UI improvements to add columns in list views - Bulk operations support in instance list view to shutdown and destroy multiple-selected VMs (limitation: after operation, redundant entries may show up in the list view, refreshing VM list view fixes that) - Align table thead/tbody to avoid splitting of tables Signed-off-by: Rohit Yadav --- .../org/apache/cloudstack/api/ApiConstants.java| 2 + .../api/command/user/event/ListEventsCmd.java | 7 + .../cloudstack/api/response/EventResponse.java | 2 +- .../schema/src/com/cloud/user/UserAccountVO.java | 4 + engine/schema/src/com/cloud/user/UserVO.java | 4 + .../src/com/cloud/api/query/QueryManagerImpl.java | 10 +- ui/css/cloudstack3.css | 3 +- ui/l10n/en.js | 3 + ui/scripts/events.js | 20 +- ui/scripts/instances.js| 275 - ui/scripts/metrics.js | 13 +- ui/scripts/network.js | 51 +++- ui/scripts/sharedFunctions.js | 2 +- ui/scripts/storage.js | 30 ++- ui/scripts/system.js | 112 +++-- ui/scripts/templates.js| 27 ++ ui/scripts/ui/widgets/dataTable.js | 13 +- 17 files changed, 412 insertions(+), 166 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index a5bd95f..89deeef 100644 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -205,6 +205,7 @@ public class ApiConstants { public static final String OUTOFBANDMANAGEMENT_POWERSTATE = "outofbandmanagementpowerstate"; public static final String OUTOFBANDMANAGEMENT_ENABLED = "outofbandmanagementenabled"; public static final String PARAMS = "params"; +public static final String PARENT_ID = "parentid"; public static final String PARENT_DOMAIN_ID = "parentdomainid"; public static final String PASSWORD = "password"; public static final String SHOULD_UPDATE_PASSWORD = "update_passwd_on_host"; @@ -274,6 +275,7 @@ public class ApiConstants { public static final String SNAPSHOT_QUIESCEVM = "quiescevm"; public static final String SOURCE_ZONE_ID = "sourcezoneid"; public static final String START_DATE = "startdate"; +public static final String START_ID = "startid"; public static final String START_IP = "startip"; public static final String START_IPV6 = "startipv6"; public static final String START_PORT = "startport"; diff --git a/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java b/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java index a4934fa..b98c308 100644 --- a/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java @@ -65,6 +65,9 @@ public class ListEventsCmd extends BaseListProjectAndAccountResourcesCmd { @Parameter(name = ApiConstants.TYPE, type = CommandType.STRING, description = "the event type (see event types)") private String type; +@Parameter(name = ApiConstants.START_ID, type = CommandType.UUID, entityType = EventResponse.class, description = "the parent/start ID of the event, when provided this will list all the events with the start/parent ID including the parent event") +private Long startId; + / /// Accessors /// / @@ -97,6 +100,10 @@ public class ListEventsCmd extends BaseListProjectAndAccountResourcesCmd { return type; } +public Long getStartId() { +return startId; +} + / /// API Implementation/// / diff --git a/api/src/org/apache/cloudstack/api/response/EventResponse.java b/api/src/org/apache/cloudstack/api/response/EventResponse.java index 5ce66ed..da15434 100644 --- a/api/src/org/apache/cloudstack/api/response/EventResponse.java +++
[cloudstack] 01/22: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit ed39ad14a6ca6d2a44ad13f8570d7032b41620a6 Author: Rohit YadavAuthorDate: Sun Jul 23 18:01:35 2017 +0200 CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9 SystemVM changes to work on Debian 9 - Migrate away from chkconfig to systemctl - Remove xenstore-utils override deb pkg - Fix runlevel in sysv scripts for systemd Signed-off-by: Rohit Yadav --- systemvm/patches/debian/buildsystemvm.sh | 577 - systemvm/patches/debian/config/etc/init.d/cloud| 10 +- .../debian/config/etc/init.d/cloud-early-config| 23 +- .../debian/config/etc/init.d/cloud-passwd-srvr | 10 +- systemvm/patches/debian/config/etc/init.d/postinit | 6 +- systemvm/patches/debian/config/etc/rc.local| 2 +- systemvm/patches/debian/config/etc/ssh/sshd_config | 1 - .../debian/config/opt/cloud/bin/patchsystemvm.sh | 128 ++--- tools/appliance/build.sh | 2 +- .../definitions/systemvmtemplate/apt_upgrade.sh| 9 +- .../systemvmtemplate/authorized_keys.sh| 1 + .../definitions/systemvmtemplate/build_time.sh | 26 - .../definitions/systemvmtemplate/cleanup.sh| 1 - .../definitions/systemvmtemplate/configure_grub.sh | 6 +- .../systemvmtemplate/configure_login.sh| 15 +- .../systemvmtemplate/configure_networking.sh | 25 +- .../configure_systemvm_services.sh | 94 +++- .../definitions/systemvmtemplate/definition.rb | 36 +- .../systemvmtemplate/install_systemvm_packages.sh | 32 +- .../definitions/systemvmtemplate/preseed.cfg | 69 ++- .../definitions/systemvmtemplate/zerodisk.sh | 9 +- 21 files changed, 267 insertions(+), 815 deletions(-) diff --git a/systemvm/patches/debian/buildsystemvm.sh b/systemvm/patches/debian/buildsystemvm.sh deleted file mode 100755 index a34b1dd..000 --- a/systemvm/patches/debian/buildsystemvm.sh +++ /dev/null @@ -1,577 +0,0 @@ -#!/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. - -echo "" -echo " Note there is a new systemvm build script based on " -echo " Veewee(Vagrant) under tools/appliance." -echo "" - -set -e -set -x - -IMAGENAME=systemvm -LOCATION=/var/lib/images/systemvm -PASSWORD=password -#APT_PROXY=192.168.1.115:3142/ -APT_PROXY= -HOSTNAME=systemvm -SIZE=2000 -DEBIAN_MIRROR=ftp.us.debian.org/debian -MINIMIZE=true -CLOUDSTACK_RELEASE=4.0 -offset=4096 -baseimage() { - mkdir -p $LOCATION - #dd if=/dev/zero of=$IMAGELOC bs=1M count=$SIZE - dd if=/dev/zero of=$IMAGELOC bs=1M seek=$((SIZE - 1)) count=1 - loopdev=$(losetup -f) - losetup $loopdev $IMAGELOC - parted $loopdev -s 'mklabel msdos' - parted $loopdev -s 'mkpart primary ext3 4096B -1' - sleep 2 - losetup -d $loopdev - loopdev=$(losetup --show -o $offset -f $IMAGELOC ) - mkfs.ext3 -L ROOT $loopdev - mkdir -p $MOUNTPOINT - tune2fs -c 100 -i 0 $loopdev - sleep 2 - losetup -d $loopdev - - mount -o loop,offset=$offset $IMAGELOC $MOUNTPOINT - - #debootstrap --variant=minbase --keyring=/usr/share/keyrings/debian-archive-keyring.gpg wheezy $MOUNTPOINT http://${APT_PROXY}${DEBIAN_MIRROR} - debootstrap --variant=minbase --arch=i386 wheezy $MOUNTPOINT http://${APT_PROXY}${DEBIAN_MIRROR} -} - - -fixapt() { - if [ "$APT_PROXY" != "" ]; then - cat >> etc/apt/apt.conf.d/01proxy << EOF -Acquire::http::Proxy "http://${APT_PROXY};; -EOF - fi - - cat > etc/apt/sources.list << EOF -deb http://http.debian.net/debian/ wheezy main contrib non-free -deb-src http://http.debian.net/debian/ wheezy main contrib non-free - -deb http://security.debian.org/ wheezy/updates main -deb-src http://security.debian.org/ wheezy/updates main - -deb http://http.debian.net/debian/ wheezy-backports main -deb-src http://http.debian.net/debian/ wheezy-backports main -EOF - - cat >> etc/apt/apt.conf << EOF -APT::Default-Release "stable";
[cloudstack] 13/22: CLOUDSTACK-10193: Fix smoke tests failures with new systemvmtemplate
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 7ceb1594102984d341ecf696e6d9cc12893eef68 Author: Rohit YadavAuthorDate: Sat Dec 9 16:37:31 2017 +0530 CLOUDSTACK-10193: Fix smoke tests failures with new systemvmtemplate - Several systemvmtemplate optimizations - Uses new macchinina template for running smoke tests - Switch to latest Debian 9.3.0 release for systemvmtemplate - Introduce a new `get_test_template` that uses tiny test template such as macchinina as defined test_data.py - rVR related fixes and improvements Signed-off-by: Rohit Yadav --- .travis.yml| 11 +-- .../framework/jobs/impl/AsyncJobManagerImpl.java | 4 + .../com/cloud/resource/ResourceManagerImpl.java| 2 +- server/src/com/cloud/server/StatsCollector.java| 12 ++- .../secondary/SecondaryStorageVmManager.java | 6 +- .../SecondaryStorageManagerImpl.java | 2 +- systemvm/debian/etc/issue | 2 +- systemvm/debian/etc/rc.local | 28 --- .../etc/systemd/system/cloud-postinit.service | 2 +- systemvm/debian/opt/cloud/bin/cs/CsApp.py | 2 +- systemvm/debian/opt/cloud/bin/cs/CsRedundant.py| 11 ++- systemvm/debian/opt/cloud/bin/passwd_server| 26 -- systemvm/debian/opt/cloud/bin/passwd_server_ip | 29 --- systemvm/debian/opt/cloud/bin/setup/common.sh | 61 +- .../debian/opt/cloud/bin/setup/consoleproxy.sh | 2 +- systemvm/debian/opt/cloud/bin/setup/dhcpsrvr.sh| 2 +- systemvm/debian/opt/cloud/bin/setup/elbvm.sh | 2 +- systemvm/debian/opt/cloud/bin/setup/ilbvm.sh | 2 +- .../debian/opt/cloud/bin/setup/patchsystemvm.sh| 4 + systemvm/debian/opt/cloud/bin/setup/postinit.sh| 46 +-- systemvm/debian/opt/cloud/bin/setup/router.sh | 5 -- systemvm/debian/opt/cloud/bin/setup/secstorage.sh | 2 +- systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh | 5 -- systemvm/debian/opt/cloud/bin/update_config.py | 7 -- systemvm/debian/opt/cloud/bin/vpc_passwd_server| 32 .../opt/cloud/templates/keepalived.conf.templ | 11 ++- test/integration/smoke/test_accounts.py| 22 +++--- test/integration/smoke/test_affinity_groups.py | 10 +-- .../smoke/test_affinity_groups_projects.py | 11 +-- test/integration/smoke/test_deploy_vm_iso.py | 7 +- .../smoke/test_deploy_vm_with_userdata.py | 11 +-- ...st_deploy_vms_with_varied_deploymentplanners.py | 9 ++- test/integration/smoke/test_host_maintenance.py| 6 +- test/integration/smoke/test_hostha_kvm.py | 4 +- test/integration/smoke/test_internal_lb.py | 53 ++--- test/integration/smoke/test_list_ids_parameter.py | 10 +-- test/integration/smoke/test_loadbalance.py | 10 +-- test/integration/smoke/test_metrics_api.py | 4 +- test/integration/smoke/test_multipleips_per_nic.py | 7 +- .../smoke/test_nested_virtualization.py| 15 ++-- test/integration/smoke/test_network.py | 36 - test/integration/smoke/test_network_acl.py | 9 ++- test/integration/smoke/test_nic_adapter_type.py| 6 +- test/integration/smoke/test_password_server.py | 7 +- test/integration/smoke/test_portforwardingrules.py | 6 +- test/integration/smoke/test_privategw_acl.py | 7 +- test/integration/smoke/test_projects.py| 7 +- test/integration/smoke/test_reset_vm_on_reboot.py | 7 +- test/integration/smoke/test_router_dhcphosts.py| 12 +-- test/integration/smoke/test_router_dns.py | 11 ++- test/integration/smoke/test_router_dnsservice.py | 11 +-- test/integration/smoke/test_routers.py | 12 ++- .../smoke/test_routers_iptables_default_policy.py | 15 ++-- test/integration/smoke/test_routers_network_ops.py | 71 ++--- test/integration/smoke/test_service_offerings.py | 11 ++- test/integration/smoke/test_snapshots.py | 65 +-- test/integration/smoke/test_templates.py | 22 +++--- test/integration/smoke/test_usage.py | 22 +- test/integration/smoke/test_vpc_redundant.py | 55 ++--- test/integration/smoke/test_vpc_router_nics.py | 30 --- test/integration/smoke/test_vpc_vpn.py | 92 +++--- tools/appliance/build.sh | 4 +- .../definitions/systemvmtemplate/apt_upgrade.sh| 9 ++- .../definitions/systemvmtemplate/cleanup.sh| 5 +- .../definitions/systemvmtemplate/configure_grub.sh | 4 +- .../definitions/systemvmtemplate/definition.rb | 8 +- .../definitions/systemvmtemplate/finalize.sh | 3 +-
[cloudstack] 22/22: CLOUDSTACK-9595: Fix regression introduced in #1762
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit b51f4c61f5379991f5efb040656dbd4d61ee9c91 Author: Rohit YadavAuthorDate: Wed Dec 20 15:20:34 2017 +0530 CLOUDSTACK-9595: Fix regression introduced in #1762 The `assignDedicateIpAddress` previously had marked the newly fetched IP as allocated but now it does not do that. This fails for VPCs where SNATs IP are retained as allocating and not allocated after creation. Signed-off-by: Rohit Yadav --- .../src/com/cloud/network/IpAddressManagerImpl.java | 20 +--- test/integration/smoke/test_vpc_vpn.py | 1 + 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/server/src/com/cloud/network/IpAddressManagerImpl.java b/server/src/com/cloud/network/IpAddressManagerImpl.java index 7961d07..6af6b03 100644 --- a/server/src/com/cloud/network/IpAddressManagerImpl.java +++ b/server/src/com/cloud/network/IpAddressManagerImpl.java @@ -291,8 +291,8 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage SearchBuilder AssignIpAddressSearch; SearchBuilder AssignIpAddressFromPodVlanSearch; -private final Object _allocatedLock = new Object(); -private final Object _allocatingLock = new Object(); +private static final Object allocatedLock = new Object(); +private static final Object allocatingLock = new Object(); static Boolean rulesContinueOnErrFlag = true; @@ -835,7 +835,7 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage @DB @Override public void markPublicIpAsAllocated(final IPAddressVO addr) { -synchronized (_allocatedLock) { +synchronized (allocatedLock) { Transaction.execute(new TransactionCallbackNoReturn() { @Override public void doInTransactionWithoutResult(TransactionStatus status) { @@ -858,6 +858,8 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage _resourceLimitMgr.incrementResourceCount(owner.getId(), ResourceType.public_ip); } } +} else { +s_logger.error("Failed to mark public IP as allocated with id=" + addr.getId() + " address=" + addr.getAddress()); } } } @@ -868,14 +870,18 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage @DB private void markPublicIpAsAllocating(final IPAddressVO addr) { -synchronized (_allocatingLock) { +synchronized (allocatingLock) { Transaction.execute(new TransactionCallbackNoReturn() { @Override public void doInTransactionWithoutResult(TransactionStatus status) { if (_ipAddressDao.lockRow(addr.getId(), true) != null) { addr.setState(IpAddress.State.Allocating); -_ipAddressDao.update(addr.getId(), addr); +if (!_ipAddressDao.update(addr.getId(), addr)) { +s_logger.error("Failed to update public IP as allocating with id=" + addr.getId() + " and address=" + addr.getAddress()); +} +} else { +s_logger.error("Failed to lock row to mark public IP as allocating with id=" + addr.getId() + " and address=" + addr.getAddress()); } } }); @@ -936,8 +942,8 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage displayIp = vpc.isDisplay(); } -return fetchNewPublicIp(dcId, null, null, owner, VlanType.VirtualNetwork, guestNtwkId, isSourceNat, false, null, false, vpcId, displayIp); - +ip = fetchNewPublicIp(dcId, null, null, owner, VlanType.VirtualNetwork, guestNtwkId, isSourceNat, true, null, false, vpcId, displayIp); +return ip; } finally { if (owner != null) { if (s_logger.isDebugEnabled()) { diff --git a/test/integration/smoke/test_vpc_vpn.py b/test/integration/smoke/test_vpc_vpn.py index 8e1a73d..8c873d2 100644 --- a/test/integration/smoke/test_vpc_vpn.py +++ b/test/integration/smoke/test_vpc_vpn.py @@ -344,6 +344,7 @@ class TestVpcRemoteAccessVpn(cloudstackTestCase): finally: self.logger.debug("Acquired public ip address: OK") +vpn = None try: vpn = Vpn.create(self.apiclient, publicipid=ip.id, -- To stop receiving notification emails like this
[cloudstack] 14/22: CLOUDSTACK-10187: Don't delete vifs for VPCs with source nat
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 30439daf8e17286a8a0255a26af14ec1cd07bcff Author: Rohit YadavAuthorDate: Wed Dec 13 01:28:18 2017 +0530 CLOUDSTACK-10187: Don't delete vifs for VPCs with source nat On XenServer, both redundant router's vifs were getting deleted when any PF rule is removed from any of the acquired public IPs. This fix ensures that lastIp is set to `false` when processed by hypervisor resources to avoid removing of VIFs when VPCs have any source nat IP. Signed-off-by: Rohit Yadav --- .../com/cloud/network/router/CommandSetupHelper.java | 19 ++- test/integration/smoke/test_vpc_redundant.py | 4 ++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/server/src/com/cloud/network/router/CommandSetupHelper.java b/server/src/com/cloud/network/router/CommandSetupHelper.java index cadaf4f..c8d85fe 100644 --- a/server/src/com/cloud/network/router/CommandSetupHelper.java +++ b/server/src/com/cloud/network/router/CommandSetupHelper.java @@ -475,7 +475,7 @@ public class CommandSetupHelper { public void createAssociateIPCommands(final VirtualRouter router, final List ips, final Commands cmds, final long vmId) { final String ipAssocCommand = "IPAssocCommand"; -createRedundantAssociateIPCommands(router, ips, cmds, ipAssocCommand, vmId); +createRedundantAssociateIPCommands(router, ips, cmds, ipAssocCommand, false); } public void createNetworkACLsCommands(final List rules, final VirtualRouter router, final Commands cmds, final long guestNetworkId, @@ -645,7 +645,7 @@ public class CommandSetupHelper { final String ipAssocCommand = "IPAssocVpcCommand"; if (router.getIsRedundantRouter()) { -createRedundantAssociateIPCommands(router, ips, cmds, ipAssocCommand, 0); +createRedundantAssociateIPCommands(router, ips, cmds, ipAssocCommand, true); return; } @@ -742,7 +742,7 @@ public class CommandSetupHelper { } } -public void createRedundantAssociateIPCommands(final VirtualRouter router, final List ips, final Commands cmds, final String ipAssocCommand, final long vmId) { +public void createRedundantAssociateIPCommands(final VirtualRouter router, final List ips, final Commands cmds, final String ipAssocCommand, final boolean isVPC) { // Ensure that in multiple vlans case we first send all ip addresses of // vlan1, then all ip addresses of vlan2, etc.. @@ -840,7 +840,16 @@ public class CommandSetupHelper { } // for network if the ips does not have any rules, then only last ip -List userIps = _ipAddressDao.listByAssociatedNetwork(associatedWithNetworkId, null); +final List userIps = _ipAddressDao.listByAssociatedNetwork(associatedWithNetworkId, null); +boolean hasSourceNat = false; +if (isVPC && userIps.size() > 0 && userIps.get(0) != null) { +// All ips should belong to a VPC +final Long vpcId = userIps.get(0).getVpcId(); +final List sourceNatIps = _ipAddressDao.listByAssociatedVpc(vpcId, true); +if (sourceNatIps != null && sourceNatIps.size() > 0) { +hasSourceNat = true; +} +} int ipsWithrules = 0; int ipsStaticNat = 0; @@ -864,7 +873,7 @@ public class CommandSetupHelper { cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE, dcVo.getNetworkType().toString()); // if there is 1 static nat then it will be checked for remove at the resource -if (ipsWithrules == 0 && ipsStaticNat == 0) { +if (ipsWithrules == 0 && ipsStaticNat == 0 && !hasSourceNat) { // there is only one ip address for the network. cmd.setAccessDetail(NetworkElementCommand.NETWORK_PUB_LAST_IP, "true"); } else { diff --git a/test/integration/smoke/test_vpc_redundant.py b/test/integration/smoke/test_vpc_redundant.py index b87ce43..e7b29b1 100644 --- a/test/integration/smoke/test_vpc_redundant.py +++ b/test/integration/smoke/test_vpc_redundant.py @@ -610,7 +610,7 @@ class TestVPCRedundancy(cloudstackTestCase): gc_wait = Configurations.list(self.apiclient, name="network.gc.wait") gc_interval = Configurations.list(self.apiclient, name="network.gc.interval") - + self.logger.debug("network.gc.wait is ==> %s" % gc_wait) self.logger.debug("network.gc.interval is ==> %s" % gc_interval) @@ -628,7 +628,7 @@ class TestVPCRedundancy(cloudstackTestCase): @attr(tags=["advanced", "intervlan"], required_hardware="true") def
[cloudstack] 10/22: CLOUDSTACK-10013: Make the generated VR/json files unique (ports #1470)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 2cf50788bc7f700c545f30ec88c38007fa394ef3 Author: Remi BergsmaAuthorDate: Sat Dec 2 23:19:14 2017 +0530 CLOUDSTACK-10013: Make the generated VR/json files unique (ports #1470) This ports PR #1470 by @remibergsma. Make the generated json files unique to prevent concurrency issues: The json files now have UUIDs to prevent them from getting overwritten before they've been executed. Prevents config to be pushed to the wrong router. 2016-02-25 18:32:23,797 DEBUG [c.c.a.t.Request] (AgentManager-Handler-1:null) (logid:) Seq 2-4684025087442026584: Processing: { Ans: , MgmtId: 90520732674657, via: 2, Ver: v1, Flags: 10, [{"com.cloud.agent.api.routing.GroupA nswer":{"results":["null - success: null","null - success: [INFO] update_config.py :: Processing incoming file => vm_dhcp_entry.json.4ea45061-2efb-4467-8eaa-db3d77fb0a7b\n[INFO] Processing JSON file vm_dhcp_entry.json.4ea4506 1-2efb-4467-8eaa-db3d77fb0a7b\n"],"result":true,"wait":0}}] } On the router: 2016-02-25 18:32:23,416 merge.py __moveFile:298 Processed file written to /var/cache/cloud/processed/vm_dhcp_entry.json.4ea45061-2efb-4467-8eaa-db3d77fb0a7b.gz Signed-off-by: Rohit Yadav --- .../facade/AbstractConfigItemFacade.java | 21 +- .../kvm/resource/LibvirtComputingResource.java | 5 + systemvm/patches/debian/etc/rc.local | 9 - systemvm/patches/debian/opt/cloud/bin/configure.py | 220 + systemvm/patches/debian/opt/cloud/bin/merge.py | 37 ++-- .../patches/debian/opt/cloud/bin/update_config.py | 22 ++- 6 files changed, 159 insertions(+), 155 deletions(-) diff --git a/core/src/com/cloud/agent/resource/virtualnetwork/facade/AbstractConfigItemFacade.java b/core/src/com/cloud/agent/resource/virtualnetwork/facade/AbstractConfigItemFacade.java index f017384..a083012 100644 --- a/core/src/com/cloud/agent/resource/virtualnetwork/facade/AbstractConfigItemFacade.java +++ b/core/src/com/cloud/agent/resource/virtualnetwork/facade/AbstractConfigItemFacade.java @@ -22,6 +22,8 @@ package com.cloud.agent.resource.virtualnetwork.facade; import java.util.Hashtable; import java.util.LinkedList; import java.util.List; +import java.util.UUID; +import org.apache.log4j.Logger; import com.cloud.agent.api.BumpUpPriorityCommand; import com.cloud.agent.api.SetupGuestNetworkCommand; @@ -58,6 +60,8 @@ import com.google.gson.GsonBuilder; public abstract class AbstractConfigItemFacade { +private static final Logger s_logger = Logger.getLogger(AbstractConfigItemFacade.class); + private final static Gson gson; private static Hashtable flyweight = new Hashtable (); @@ -104,13 +108,26 @@ public abstract class AbstractConfigItemFacade { return instance; } +private static String appendUuidToJsonFiles(final String filename) { +String remoteFileName = new String(filename); +if (remoteFileName.endsWith("json")) { +remoteFileName += "." + UUID.randomUUID().toString(); +} +return remoteFileName; +} + protected List generateConfigItems(final ConfigBase configuration) { final List cfg = new LinkedList<>(); -final ConfigItem configFile = new FileConfigItem(VRScripts.CONFIG_PERSIST_LOCATION, destinationFile, gson.toJson(configuration)); +final String remoteFilename = appendUuidToJsonFiles(destinationFile); +if (s_logger.isDebugEnabled()) { +s_logger.debug("Transformed filename: " + destinationFile + " to: " + remoteFilename); +} + +final ConfigItem configFile = new FileConfigItem(VRScripts.CONFIG_PERSIST_LOCATION, remoteFilename, gson.toJson(configuration)); cfg.add(configFile); -final ConfigItem updateCommand = new ScriptConfigItem(VRScripts.UPDATE_CONFIG, destinationFile); +final ConfigItem updateCommand = new ScriptConfigItem(VRScripts.UPDATE_CONFIG, remoteFilename); cfg.add(updateCommand); return cfg; diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 51b9737..ebd36bd 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -330,6 +330,9 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv if (details == null) { details = parser.getLines(); } + +
[cloudstack] 04/22: CLOUDSTACK-7853: Fix ping timeout edge case and refactor code
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 7034b520ce5c4dd840dd2aa5c9a992c2d85bb654 Author: Rohit YadavAuthorDate: Sat Dec 2 15:50:34 2017 +0530 CLOUDSTACK-7853: Fix ping timeout edge case and refactor code Refresh InaccurateClock every 10seconds, refactor code to get ping timeout and ping interval. Signed-off-by: Rohit Yadav --- .../src/com/cloud/agent/manager/AgentManagerImpl.java| 16 .../main/java/com/cloud/utils/time/InaccurateClock.java | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java index 325f3ec..7815c76 100644 --- a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java +++ b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java @@ -213,7 +213,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl _nodeId = ManagementServerNode.getManagementServerId(); s_logger.info("Configuring AgentManagerImpl. management server node id(msid): " + _nodeId); -final long lastPing = (System.currentTimeMillis() >> 10) - (long) (PingTimeout.value() * PingInterval.value()); +final long lastPing = (System.currentTimeMillis() >> 10) - getTimeout(); _hostDao.markHostsAsDisconnected(_nodeId, lastPing); registerForHostEvents(new BehindOnPingListener(), true, true, false); @@ -241,8 +241,12 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl return true; } +protected int getPingInterval() { +return PingInterval.value(); +} + protected long getTimeout() { -return (long) (PingTimeout.value() * PingInterval.value()); +return (long) (Math.ceil(PingTimeout.value() * PingInterval.value())); } @Override @@ -358,10 +362,6 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl return null; } -protected int getPingInterval() { -return PingInterval.value(); -} - @Override public Answer send(final Long hostId, final Command cmd) throws AgentUnavailableException, OperationTimedoutException { final Commands cmds = new Commands(Command.OnError.Stop); @@ -623,7 +623,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl } } -_monitorExecutor.scheduleWithFixedDelay(new MonitorTask(), PingInterval.value(), PingInterval.value(), TimeUnit.SECONDS); +_monitorExecutor.scheduleWithFixedDelay(new MonitorTask(), getPingInterval(), getPingInterval(), TimeUnit.SECONDS); return true; } @@ -1515,7 +1515,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl attache = createAttacheForDirectConnect(host, resource); final StartupAnswer[] answers = new StartupAnswer[cmds.length]; for (int i = 0; i < answers.length; i++) { -answers[i] = new StartupAnswer(cmds[i], attache.getId(), PingInterval.value()); +answers[i] = new StartupAnswer(cmds[i], attache.getId(), getPingInterval()); } attache.process(answers); diff --git a/utils/src/main/java/com/cloud/utils/time/InaccurateClock.java b/utils/src/main/java/com/cloud/utils/time/InaccurateClock.java index 2a22853..e03231d 100644 --- a/utils/src/main/java/com/cloud/utils/time/InaccurateClock.java +++ b/utils/src/main/java/com/cloud/utils/time/InaccurateClock.java @@ -63,7 +63,7 @@ public class InaccurateClock extends StandardMBean implements InaccurateClockMBe public synchronized String restart() { turnOff(); s_executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("InaccurateClock")); -s_executor.scheduleAtFixedRate(new SetTimeTask(), 0, 60, TimeUnit.SECONDS); +s_executor.scheduleAtFixedRate(new SetTimeTask(), 0, 10, TimeUnit.SECONDS); return "Restarted"; } -- To stop receiving notification emails like this one, please contact "commits@cloudstack.apache.org" .
[cloudstack] 20/22: CLOUDSTACK-10013: Add systemvm 4.11 migration in 4.10->4.11 upgrade path
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit cf43c766391c0e2271af4f3ad53141056655e367 Author: Rohit YadavAuthorDate: Tue Dec 19 11:06:59 2017 +0530 CLOUDSTACK-10013: Add systemvm 4.11 migration in 4.10->4.11 upgrade path This moves the systevmtemplate migration logic from previous upgrade path to 4.10.0.0->4.11.0.0 upgrade path. Signed-off-by: Rohit Yadav --- .../com/cloud/upgrade/dao/Upgrade41000to41100.java | 189 - .../com/cloud/upgrade/dao/Upgrade4930to41000.java | 184 +--- 2 files changed, 191 insertions(+), 182 deletions(-) diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java index c59ead9..fbe9d78 100644 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java @@ -17,13 +17,25 @@ package com.cloud.upgrade.dao; -import com.cloud.utils.exception.CloudRuntimeException; - import java.io.InputStream; import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.apache.log4j.Logger; + +import com.cloud.hypervisor.Hypervisor; +import com.cloud.utils.exception.CloudRuntimeException; public class Upgrade41000to41100 implements DbUpgrade { +final static Logger LOG = Logger.getLogger(Upgrade41000to41100.class); + @Override public String[] getUpgradableVersionRange() { return new String[] {"4.10.0.0", "4.11.0.0"}; @@ -52,8 +64,181 @@ public class Upgrade41000to41100 implements DbUpgrade { @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,
[GitHub] blueorangutan commented on issue #2370: CLOUDSTACK-9595: Fix regression introduced in #1762
blueorangutan commented on issue #2370: CLOUDSTACK-9595: Fix regression introduced in #1762 URL: https://github.com/apache/cloudstack/pull/2370#issuecomment-353027308 Packaging result: ?centos6 ?centos7 ?debian. JID-1436 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 opened a new pull request #2370: CLOUDSTACK-9595: Fix regression introduced in #1762
rhtyd opened a new pull request #2370: CLOUDSTACK-9595: Fix regression introduced in #1762 URL: https://github.com/apache/cloudstack/pull/2370 The `assignDedicateIpAddress` previously had marked the newly fetched IP as allocated but now it does not do that. This fails for VPCs where SNATs IP are retained as allocating and not allocated after creation. @yvsubhash @rafaelweingartner and please review. @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 #2370: CLOUDSTACK-9595: Fix regression introduced in #1762
rafaelweingartner commented on a change in pull request #2370: CLOUDSTACK-9595: Fix regression introduced in #1762 URL: https://github.com/apache/cloudstack/pull/2370#discussion_r157983028 ## File path: server/src/com/cloud/network/IpAddressManagerImpl.java ## @@ -936,8 +942,8 @@ public PublicIp assignDedicateIpAddress(Account owner, final Long guestNtwkId, f displayIp = vpc.isDisplay(); } -return fetchNewPublicIp(dcId, null, null, owner, VlanType.VirtualNetwork, guestNtwkId, isSourceNat, false, null, false, vpcId, displayIp); - +ip = fetchNewPublicIp(dcId, null, null, owner, VlanType.VirtualNetwork, guestNtwkId, isSourceNat, true, null, false, vpcId, displayIp); Review comment: You can return directly the call to `fetchNewPublicIp`. I have not checked. What is that boolean flag you changed there? 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] 19/22: CLOUDSTACK-10194: Use packer for building systemvmtemplates
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 61bc2ceed9e50612789197c66d28122de92512eb Author: Rohit YadavAuthorDate: Sun Dec 17 12:55:26 2017 +0530 CLOUDSTACK-10194: Use packer for building systemvmtemplates - This migrates the current systemvmtemplate build system from veewee/virtualbox to packer and qemu based. - This also introduces and updates a CentOS7 built-in template. - Remove old appliance build scripts and files. - Adds iftop package (CLOUDSTACK-9785) Signed-off-by: Rohit Yadav --- pom.xml| 8 +- tools/appliance/.ruby-version | 1 - tools/appliance/.rvmrc | 24 -- tools/appliance/README.md | 105 +- tools/appliance/build.sh | 360 +++-- tools/appliance/builtin/http/kickstart.cfg | 91 ++ .../scripts/base.sh} | 28 +- .../{Gemfile => builtin/scripts/cleanup.sh}| 20 +- tools/appliance/builtin/template.json | 53 +++ tools/appliance/convert/Convert.class | Bin 984 -> 0 bytes tools/appliance/convert/Convert.java | 36 --- tools/appliance/convert_ovf_vbox_to_esx.xslt | 42 --- tools/appliance/definitions/builtin/base.sh| 14 - tools/appliance/definitions/builtin/cleanup.sh | 21 -- tools/appliance/definitions/builtin/definition.rb | 33 -- .../definitions/builtin/install-xs-tools.sh| 10 - tools/appliance/definitions/builtin/ks.cfg | 35 -- tools/appliance/definitions/builtin/postinstall.sh | 54 tools/appliance/definitions/builtin/zerodisk.sh| 3 - tools/appliance/definitions/debianbase/cleanup.sh | 49 --- .../definitions/debianbase/configure_login.sh | 78 - .../appliance/definitions/debianbase/definition.rb | 80 - tools/appliance/definitions/debianbase/preseed.cfg | 129 tools/appliance/definitions/debianbase/zerodisk.sh | 43 --- tools/appliance/definitions/devcloud/base.sh | 12 - tools/appliance/definitions/devcloud/cleanup.sh| 21 -- tools/appliance/definitions/devcloud/definition.rb | 45 --- .../appliance/definitions/devcloud/postinstall.sh | 60 tools/appliance/definitions/devcloud/preseed.cfg | 357 tools/appliance/definitions/devcloud/zerodisk.sh | 11 - tools/appliance/shar_cloud_scripts.sh | 2 +- .../http}/preseed.cfg | 13 +- .../scripts}/apt_upgrade.sh| 5 +- .../scripts}/authorized_keys.sh| 0 .../scripts}/cleanup.sh| 0 .../scripts}/configure_acpid.sh| 0 .../scripts}/configure_conntrack.sh| 0 .../scripts}/configure_grub.sh | 4 + .../scripts}/configure_locale.sh | 0 .../scripts}/configure_login.sh| 0 .../scripts}/configure_networking.sh | 0 .../scripts}/configure_persistent_config.sh| 1 - .../scripts}/configure_systemvm_services.sh| 0 .../scripts}/definition.rb | 4 +- .../scripts}/finalize.sh | 8 +- .../scripts}/install_systemvm_packages.sh | 16 +- tools/appliance/systemvmtemplate/template.json | 82 + tools/appliance/test.sh| 180 --- tools/appliance/vbox_disk_clean.rb | 49 --- tools/appliance/vbox_vm_clean.rb | 77 - tools/vagrant/devcloud/Vagrantfile | 206 tools/vagrant/devcloud/templates/tmpl/1/1/README | 1 - tools/vagrant/devcloud/templates/tmpl/1/5/README | 2 - tools/vagrant/systemvm/.gitignore | 52 --- tools/vagrant/systemvm/.ruby-version | 1 - tools/vagrant/systemvm/.rvmrc | 24 -- tools/vagrant/systemvm/Gemfile | 20 -- tools/vagrant/systemvm/README.md | 30 -- tools/vagrant/systemvm/VBoxManage | 41 --- tools/vagrant/systemvm/Vagrantfile | 123 --- tools/vagrant/systemvm/test.sh | 213 tools/vagrant/systemvm/vagrant.pub | 1 - 62 files changed, 340 insertions(+), 2638 deletions(-) diff --git a/pom.xml b/pom.xml index 39a611d..00a3542 100644 --- a/pom.xml +++ b/pom.xml @@ -880,14 +880,8 @@ services/secondary-storage/conf/agent.properties services/secondary-storage/conf/environment.properties test/systemvm/README.md -
[cloudstack] 21/22: CLOUDSTACK-10001: Fix incorrect total host memory in responses
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 777caae4254e675e1e17d7e0e8d2c1a63b3c531d Author: Rohit YadavAuthorDate: Tue Dec 19 11:45:24 2017 +0530 CLOUDSTACK-10001: Fix incorrect total host memory in responses This fixes incorrect total host memory in listHosts and related host responses, regression introduced in #2120. Signed-off-by: Rohit Yadav --- server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java index 4d411f2..4cb8a76 100644 --- a/server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java +++ b/server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java @@ -159,8 +159,8 @@ public class HostJoinDaoImpl extends GenericDaoBase implements Long mem = host.getMemReservedCapacity() + host.getMemUsedCapacity(); Long cpu = host.getCpuReservedCapacity() + host.getCpuUsedCapacity(); -hostResponse.setMemoryTotal(mem); -Float totalMemorywithOverprovisioning=new Float((host.getTotalMemory()*ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId(; +hostResponse.setMemoryTotal(host.getTotalMemory()); +Float totalMemorywithOverprovisioning = host.getTotalMemory() * ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId()); hostResponse.setMemWithOverprovisioning(totalMemorywithOverprovisioning.toString()); hostResponse.setMemoryAllocated(mem); @@ -180,7 +180,7 @@ public class HostJoinDaoImpl extends GenericDaoBase implements hostResponse.setHypervisorVersion(host.getHypervisorVersion()); -Float cpuWithOverprovisioning = new Float(host.getCpus() * host.getSpeed() * ApiDBUtils.getCpuOverprovisioningFactor(host.getClusterId())); +Float cpuWithOverprovisioning = host.getCpus() * host.getSpeed() * ApiDBUtils.getCpuOverprovisioningFactor(host.getClusterId()); String cpuAlloc = decimalFormat.format(((float)cpu / cpuWithOverprovisioning * 100f)) + "%"; hostResponse.setCpuAllocated(cpuAlloc); hostResponse.setCpuWithOverprovisioning(cpuWithOverprovisioning.toString()); @@ -308,10 +308,10 @@ public class HostJoinDaoImpl extends GenericDaoBase implements Long mem = host.getMemReservedCapacity() + host.getMemUsedCapacity(); Long cpu = host.getCpuReservedCapacity() + host.getCpuReservedCapacity(); -hostResponse.setMemoryTotal(mem); -Float memWithOverprovisioning =new Float((host.getTotalMemory()*ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId(; +hostResponse.setMemoryTotal(host.getTotalMemory()); +Float memWithOverprovisioning = host.getTotalMemory() * ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId()); hostResponse.setMemWithOverprovisioning(memWithOverprovisioning.toString()); - hostResponse.setMemoryAllocated(decimalFormat.format((float)mem/ memWithOverprovisioning*100f).toString()+"%"); +hostResponse.setMemoryAllocated(decimalFormat.format((float) mem / memWithOverprovisioning * 100.0f) +"%"); String hostTags = host.getTag(); hostResponse.setHostTags(host.getTag()); -- To stop receiving notification emails like this one, please contact "commits@cloudstack.apache.org" .
[cloudstack] 16/22: CLOUDSTACK-9953: Resize root disk for VMware when full clone is enabled
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 4f9a5dbe3f7616564a9ace90ca031974a4764164 Author: Rohit YadavAuthorDate: Sat Dec 16 14:19:28 2017 +0530 CLOUDSTACK-9953: Resize root disk for VMware when full clone is enabled Resize for VMware root disk should only be performed during VM start when vmware.create.full.clone is true i.e. the disk chain length is one. Signed-off-by: Rohit Yadav --- .../hypervisor/vmware/resource/VmwareResource.java | 34 ++ 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java index 40ffdf4..7f8c2a5 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -2093,9 +2093,9 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa hyperHost.setRestartPriorityForVM(vmMo, DasVmPriority.HIGH.value()); } -//For resizing root disk. +// For resizing root disk. if (rootDiskTO != null && !hasSnapshot) { -resizeRootDisk(vmMo, rootDiskTO, hyperHost, context); +resizeRootDiskOnVMStart(vmMo, rootDiskTO, hyperHost, context); } // @@ -2165,28 +2165,24 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa 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")) { +s_logger.warn("Resizing of root disk is only support for scsi device/bus, the provide disk's device bus name is " + diskInfo.getDiskDeviceBusName()); +return; } disk.setCapacityInKB(reqSize); -- To stop receiving notification emails like this one, please contact "commits@cloudstack.apache.org" .
[cloudstack] 17/22: CLOUDSTACK-10013: Fix VMware related issues and fix misc tests
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 8b4621479968edc2b1192d5170a54009085f2ab9 Author: Rohit YadavAuthorDate: Wed Dec 13 01:42:05 2017 +0530 CLOUDSTACK-10013: Fix VMware related issues and fix misc tests This fixes test failures around VMware with the new systemvmtemplate. In addition: - Does not skip rVR related test cases for VMware - Removes rc.local - Processes unprocessed cmd_line.json - Fixed NPEs around VMware tests/code - On VMware, use udevadm to reconfigure nic/mac address than rebooting - Fix proper acpi shutdown script for faster systemvm shutdowns - Give at least 256MB of swap for VRs to avoid OOM on VMware - Fixes smoke tests for environment related failures Signed-off-by: Rohit Yadav --- .../com/cloud/vm/VirtualMachineManagerImpl.java| 2 +- python/lib/cloudutils/utilities.py | 4 +- server/src/com/cloud/server/StatsCollector.java| 20 +++- systemvm/agent/conf/log4j-cloud.xml| 12 ++--- systemvm/debian/etc/issue | 3 -- systemvm/debian/etc/rc.local | 19 systemvm/debian/opt/cloud/bin/cs/CsDhcp.py | 2 +- systemvm/debian/opt/cloud/bin/setup/common.sh | 8 ++-- systemvm/debian/opt/cloud/bin/setup/router.sh | 6 +-- systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh | 7 +-- systemvm/debian/opt/cloud/bin/update_config.py | 6 +++ .../opt/cloud/templates/keepalived.conf.templ | 2 +- .../smoke/test_deploy_virtio_scsi_vm.py| 3 +- .../smoke/test_deploy_vm_root_resize.py| 56 +- test/integration/smoke/test_internal_lb.py | 10 test/integration/smoke/test_iso.py | 0 test/integration/smoke/test_list_ids_parameter.py | 0 .../smoke/test_nested_virtualization.py| 0 test/integration/smoke/test_privategw_acl.py | 8 test/integration/smoke/test_routers_network_ops.py | 10 test/integration/smoke/test_ssvm.py| 4 +- test/integration/smoke/test_vm_life_cycle.py | 0 test/integration/smoke/test_volumes.py | 2 + test/integration/smoke/test_vpc_redundant.py | 10 test/integration/smoke/test_vpc_vpn.py | 10 .../systemvmtemplate/configure_acpid.sh| 13 ++--- .../definitions/systemvmtemplate/configure_grub.sh | 4 +- .../configure_systemvm_services.sh | 10 .../systemvmtemplate/install_systemvm_packages.sh | 4 +- .../definitions/systemvmtemplate/preseed.cfg | 6 +-- ui/scripts/network.js | 2 +- 31 files changed, 92 insertions(+), 151 deletions(-) diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index 74927b9..50e53e3 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -4743,8 +4743,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac final VMInstanceVO vm = _entityMgr.findById(VMInstanceVO.class, work.getVmId()); if (vm == null) { s_logger.info("Unable to find vm " + work.getVmId()); +throw new CloudRuntimeException("Unable to find VM id=" + work.getVmId()); } -assert vm != null; orchestrateStop(vm.getUuid(), work.isCleanup()); return new Pair (JobInfo.Status.SUCCEEDED, null); diff --git a/python/lib/cloudutils/utilities.py b/python/lib/cloudutils/utilities.py index 05a2a58..b9d4763 100755 --- a/python/lib/cloudutils/utilities.py +++ b/python/lib/cloudutils/utilities.py @@ -216,8 +216,8 @@ class serviceOpsUbuntu(serviceOps): 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(): return True else: return False diff --git a/server/src/com/cloud/server/StatsCollector.java b/server/src/com/cloud/server/StatsCollector.java index d32ed98..b66fa5f 100644 --- a/server/src/com/cloud/server/StatsCollector.java +++ b/server/src/com/cloud/server/StatsCollector.java @@ -64,6 +64,7 @@ import com.cloud.cluster.ManagementServerHostVO; import com.cloud.cluster.dao.ManagementServerHostDao; import com.cloud.dc.Vlan.VlanType; import com.cloud.dc.VlanVO; +import
[cloudstack] 02/22: CLOUDSTACK-10013: Make Debian9 systemvmtemplates work with systemd
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 1da69e5fecb00055ee178a50312eb250ee4fc945 Author: Wido den HollanderAuthorDate: Thu Aug 10 13:51:11 2017 +0200 CLOUDSTACK-10013: Make Debian9 systemvmtemplates work with systemd - Load the nf_conntrack_ipv6 module for IPv6 connection tracking on SSVM - Move systemd services to /etc and enable services after they have been installed - Disable most services by default and enable in cloud-early-config - Start services after enabling them using systemd - In addition remove /etc/init.d/cloud as this is no longer needed and done by systemd - Accept DOS/MBR as file format for ISO images as well Under Debian 7 the 'file' command would return: debian-9.1.0-amd64-netinst.iso: ISO 9660 CD-ROM filesystem data UDF filesystem data Under Debian 9 however it will return debian-9.1.0-amd64-netinst.iso: DOS/MBR boot sector This would make the HTTPTemplateDownloader in the Secondary Storage VM refuse the ISO as a valid template because it's not a correct format. Changes this behavior so that it accepts both. This allows us to use Debian 9 as a System VM template. Not sure though if enabling them is enough for systemd to still start them on first boot Signed-off-by: Wido den Hollander --- .gitignore | 2 + systemvm/patches/debian/config/etc/init.d/cloud| 155 - .../debian/config/etc/init.d/cloud-early-config| 55 ++-- .../systemvmtemplate/configure_conntrack.sh| 1 + .../configure_systemvm_services.sh | 22 +-- .../utils/imagestore/ImageStoreUtil.java | 2 +- 6 files changed, 30 insertions(+), 207 deletions(-) diff --git a/.gitignore b/.gitignore index 29b4ffc..1a73724 100644 --- a/.gitignore +++ b/.gitignore @@ -97,3 +97,5 @@ systemvm/.pydevproject test/.pydevprojec plugins/hypervisors/kvm/.pydevproject scripts/.pydevproject +*.qcow2 +*.raw diff --git a/systemvm/patches/debian/config/etc/init.d/cloud b/systemvm/patches/debian/config/etc/init.d/cloud deleted file mode 100755 index 9b3a63b..000 --- a/systemvm/patches/debian/config/etc/init.d/cloud +++ /dev/null @@ -1,155 +0,0 @@ -#!/bin/bash -### BEGIN INIT INFO -# Provides: cloud -# Required-Start:$local_fs cloud-early-config -# Required-Stop: $local_fs -# Default-Start: 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start up the CloudStack cloud service -### END INIT INFO -# 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. - -#set -x - -ENABLED=0 -[ -e /etc/default/cloud ] && . /etc/default/cloud - -CMDLINE=$(cat /var/cache/cloud/cmdline) - -if [ ! -z $CLOUD_DEBUG ];then - LOG_FILE=/var/log/cloud/cloud.out -else - LOG_FILE=/dev/null -fi - -TYPE="router" -for i in $CMDLINE - do -# search for foo=bar pattern and cut out foo -FIRSTPATTERN=$(echo $i | cut -d= -f1) -case $FIRSTPATTERN in - type) - TYPE=$(echo $i | cut -d= -f2) - ;; -esac -done - -# Source function library. -if [ -f /etc/init.d/functions ] -then - . /etc/init.d/functions -fi - -if [ -f ./lib/lsb/init-functions ] -then - . /lib/lsb/init-functions -fi - -_success() { - if [ -f /etc/init.d/functions ] - then -success - else -echo "Success" - fi -} - -_failure() { - if [ -f /etc/init.d/functions ] - then -failure - else -echo "Failed" - fi -} -RETVAL=$? -CLOUDSTACK_HOME="/usr/local/cloud" -if [ -f $CLOUDSTACK_HOME/systemvm/utils.sh ]; -then - . $CLOUDSTACK_HOME/systemvm/utils.sh -else - _failure -fi - -# mkdir -p /var/log/vmops - -start() { - local pid=$(get_pids) - if [ "$pid" != "" ]; then - echo "CloudStack cloud sevice is already running, PID = $pid" - return 0 - fi - - echo -n "Starting CloudStack cloud service (type=$TYPE) " - if [ -f $CLOUDSTACK_HOME/systemvm/run.sh ]; - then - if [ "$pid" == "" ] - then - (cd $CLOUDSTACK_HOME/systemvm; nohup ./run.sh >
[cloudstack] branch debian9-systemvmtemplate updated (69a57a3 -> b51f4c6)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a change to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git. omit 69a57a3 CLOUDSTACK-10001: Fix incorrect total host memory in responses omit 3112500 CLOUDSTACK-10013: Add systemvm 4.11 migration in 4.10->4.11 upgrade path omit 28e0270 CLOUDSTACK-10194: Use packer for building systemvmtemplates omit a9175ef CLOUDSTACK-10193: Use other64Linux for systemvms on VMware omit 463bb0a CLOUDSTACK-10013: Fix VMware related issues and fix misc tests omit d644774 CLOUDSTACK-9953: Resize root disk for VMware when full clone is enabled omit cd58d1b CLOUDSTACK-9501: route is not available by default on CentOS7 (#1637) omit 02d479b CLOUDSTACK-10187: Don't delete vifs for VPCs with source nat omit 475da63 CLOUDSTACK-10193: Fix smoke tests failures with new systemvmtemplate omit bfc871e CLOUDSTACK-10181: Skip rVR test cases for VMware until supported omit cea9553 CLOUDSTACK-10013: SystemVM codebase refactorings and improvements omit 427df50 CLOUDSTACK-10013: Make the generated VR/json files unique (ports #1470) omit 0e4de4b CLOUDSTACK-10010: Port marvin test from #2190 by @swill omit 0b02525 CLOUDSTACK-10013: Fix ipsec VPN configuration omit 22f7d09 CLOUDSTACK-10013: SystemVM.iso refactoring and cleanups omit 406e714 CLOUDSTACK-10129: UX improvements and event timeline omit 6bd772f CLOUDSTACK-9348: Improve Nio SSH handshake buffers omit 0560584 CLOUDSTACK-7853: Fix ping timeout edge case and refactor code omit 5ea7d19 CLOUDSTACK-10013: Debian9 SystemVM appliance improvements omit b9ffbee CLOUDSTACK-10013: Make Debian9 systemvmtemplates work with systemd omit a9df3bd CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9 add 8acb090 CLOUDSTACK-9880: Expansion of Management IP Range. (#2048) new ed39ad1 CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9 new 1da69e5 CLOUDSTACK-10013: Make Debian9 systemvmtemplates work with systemd new 32b78ac CLOUDSTACK-10013: Debian9 SystemVM appliance improvements new 7034b52 CLOUDSTACK-7853: Fix ping timeout edge case and refactor code new 635acff CLOUDSTACK-9348: Improve Nio SSH handshake buffers new 37169eb CLOUDSTACK-10129: UX improvements and event timeline new f6d15de CLOUDSTACK-10013: SystemVM.iso refactoring and cleanups new bafab64 CLOUDSTACK-10013: Fix ipsec VPN configuration new ad342eb CLOUDSTACK-10010: Port marvin test from #2190 by @swill new 2cf5078 CLOUDSTACK-10013: Make the generated VR/json files unique (ports #1470) new 548ce71 CLOUDSTACK-10013: SystemVM codebase refactorings and improvements new c16b66d CLOUDSTACK-10181: Skip rVR test cases for VMware until supported new 7ceb159 CLOUDSTACK-10193: Fix smoke tests failures with new systemvmtemplate new 30439da CLOUDSTACK-10187: Don't delete vifs for VPCs with source nat new 97c1b03 CLOUDSTACK-9501: route is not available by default on CentOS7 (#1637) new 4f9a5db CLOUDSTACK-9953: Resize root disk for VMware when full clone is enabled new 8b46214 CLOUDSTACK-10013: Fix VMware related issues and fix misc tests new bfbdb9d CLOUDSTACK-10193: Use other64Linux for systemvms on VMware new 61bc2ce CLOUDSTACK-10194: Use packer for building systemvmtemplates new cf43c76 CLOUDSTACK-10013: Add systemvm 4.11 migration in 4.10->4.11 upgrade path new 777caae CLOUDSTACK-10001: Fix incorrect total host memory in responses new b51f4c6 CLOUDSTACK-9595: Fix regression introduced in #1762 This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (69a57a3) \ N -- N -- N refs/heads/debian9-systemvmtemplate (b51f4c6) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 22 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: .../cloud/configuration/ConfigurationService.java | 15 + api/src/com/cloud/dc/StorageNetworkIpRange.java| 11 +- api/src/com/cloud/event/EventTypes.java| 6 + ...java => CreateManagementNetworkIpRangeCmd.java} | 107 +++--- ...java => DeleteManagementNetworkIpRangeCmd.java} | 96 +++--
[cloudstack] 18/22: CLOUDSTACK-10193: Use other64Linux for systemvms on VMware
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit bfbdb9dc50d443aab9f4a628ae0bda351fab4c9b Author: Rohit YadavAuthorDate: Sun Dec 17 12:26:35 2017 +0530 CLOUDSTACK-10193: Use other64Linux for systemvms on VMware In default/fresh installations, the guest os type for systemvms with id=15 or Debian 5 (32-bit) can cause memory allocation issues to guest. Using Other Linux 64-bit as guest OS systemvms get all the allocated RAM. This avoids OOM related kernel panics for certain VRs such as rVRs, lbvm etc. Signed-off-by: Rohit Yadav --- engine/schema/resources/META-INF/db/schema-41000to41100.sql | 4 1 file changed, 4 insertions(+) diff --git a/engine/schema/resources/META-INF/db/schema-41000to41100.sql b/engine/schema/resources/META-INF/db/schema-41000to41100.sql index 2a2fe2d..76bcb3f 100644 --- a/engine/schema/resources/META-INF/db/schema-41000to41100.sql +++ b/engine/schema/resources/META-INF/db/schema-41000to41100.sql @@ -495,3 +495,7 @@ UPDATE `cloud`.`monitoring_services` SET pidfile="/var/run/apache2/apache2.pid" -- Boost secondary storage systemvm UPDATE `cloud`.`service_offering` SET ram_size=1024, cpu=2 WHERE vm_type="secondarystoragevm" and cpu=1 and ram_size=512; + +-- Use 'Other Linux 64-bit' as guest os for the default systemvmtemplate for VMware +-- This fixes a memory allocation issue to systemvms on VMware/ESXi +UPDATE `cloud`.`vm_template` SET guest_os_id=99 WHERE id=8; -- To stop receiving notification emails like this one, please contact "commits@cloudstack.apache.org" .
[cloudstack] 12/22: CLOUDSTACK-10181: Skip rVR test cases for VMware until supported
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit c16b66df651e9f911328acf752516110f87949ec Author: Rohit YadavAuthorDate: Sat Dec 9 00:43:25 2017 +0530 CLOUDSTACK-10181: Skip rVR test cases for VMware until supported With this change, rVR related test cases will be skipped for VMware where this feature is not properly supported. Signed-off-by: Rohit Yadav --- test/integration/smoke/test_internal_lb.py | 11 +++ test/integration/smoke/test_privategw_acl.py | 11 +++ test/integration/smoke/test_routers_network_ops.py | 13 - test/integration/smoke/test_vpc_redundant.py | 11 +++ test/integration/smoke/test_vpc_vpn.py | 10 ++ 5 files changed, 55 insertions(+), 1 deletion(-) diff --git a/test/integration/smoke/test_internal_lb.py b/test/integration/smoke/test_internal_lb.py index 5b4c663..379bbb0 100644 --- a/test/integration/smoke/test_internal_lb.py +++ b/test/integration/smoke/test_internal_lb.py @@ -50,6 +50,8 @@ from marvin.lib.common import (get_zone, get_template, list_network_offerings) +from marvin.lib.decoratorGenerators import skipTestIf + from nose.plugins.attrib import attr import logging @@ -280,6 +282,7 @@ class TestInternalLb(cloudstackTestCase): cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests()) cls.domain = get_domain(cls.apiclient) + cls.logger.debug("Creating compute offering: %s" %cls.services["compute_offering"]["name"]) cls.compute_offering = ServiceOffering.create( cls.apiclient, @@ -302,6 +305,12 @@ class TestInternalLb(cloudstackTestCase): %s" % (cls.account.name, cls.account.id)) +# Skip rVR related test cases for VMware, for details see +# https://issues.apache.org/jira/browse/CLOUDSTACK-10181 +cls.rvrNotSupported = False +if cls.hypervisor.lower() in ['vmware']: +cls.rvrNotSupported = True + cls._cleanup = [cls.account, cls.compute_offering] return @@ -598,6 +607,7 @@ class TestInternalLb(cloudstackTestCase): self.cleanup.insert(0, vpc_offering) self.execute_internallb_roundrobin_tests(vpc_offering) +@skipTestIf("rvrNotSupported") @attr(tags=["smoke", "advanced"], required_hardware="true") def test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80(self): """ @@ -766,6 +776,7 @@ class TestInternalLb(cloudstackTestCase): self.execute_internallb_haproxy_tests(vpc_offering) +@skipTestIf("rvrNotSupported") @attr(tags=["smoke", "advanced"], required_hardware="true") def test_04_rvpc_internallb_haproxy_stats_on_all_interfaces(self): """ Test to verify access to loadbalancer haproxy admin stats page diff --git a/test/integration/smoke/test_privategw_acl.py b/test/integration/smoke/test_privategw_acl.py index b86b96e..d48eb42 100644 --- a/test/integration/smoke/test_privategw_acl.py +++ b/test/integration/smoke/test_privategw_acl.py @@ -25,6 +25,7 @@ from marvin.lib.base import * from marvin.lib.common import * from nose.plugins.attrib import attr from marvin.codes import PASS +from marvin.lib.decoratorGenerators import skipTestIf import time import logging @@ -182,6 +183,14 @@ class TestPrivateGwACL(cloudstackTestCase): cls.services["service_offering"]) cls._cleanup = [cls.service_offering] +cls.hypervisor = cls.testClient.getHypervisorInfo() + +# Skip rVR related test cases for VMware, for details see +# https://issues.apache.org/jira/browse/CLOUDSTACK-10181 +cls.rvrNotSupported = False +if cls.hypervisor.lower() in ['vmware']: +cls.rvrNotSupported = True + cls.logger = logging.getLogger('TestPrivateGwACL') cls.stream_handler = logging.StreamHandler() cls.logger.setLevel(logging.DEBUG) @@ -289,6 +298,7 @@ class TestPrivateGwACL(cloudstackTestCase): self.performVPCTests(vpc_off, restart_with_cleanup = True) +@skipTestIf("rvrNotSupported") @attr(tags=["advanced"], required_hardware="true") def test_04_rvpc_privategw_static_routes(self): self.logger.debug("Creating a Redundant VPC offering..") @@ -301,6 +311,7 @@ class TestPrivateGwACL(cloudstackTestCase): self.performVPCTests(vpc_off) +@skipTestIf("rvrNotSupported") @attr(tags=["advanced"], required_hardware="true") def _test_05_rvpc_privategw_check_interface(self): self.logger.debug("Creating a Redundant VPC offering..") diff --git a/test/integration/smoke/test_routers_network_ops.py
[cloudstack] 05/22: CLOUDSTACK-9348: Improve Nio SSH handshake buffers
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 635acffa002b08564bfbf8a7969a2d4b37fbec18 Author: Rohit YadavAuthorDate: Thu Nov 30 16:51:48 2017 +0530 CLOUDSTACK-9348: Improve Nio SSH handshake buffers Use a holder class to pass buffers, fixes potential leak. Signed-off-by: Rohit Yadav --- .../agent/manager/ClusteredAgentManagerImpl.java | 2 +- utils/src/main/java/com/cloud/utils/nio/Link.java | 72 +- .../main/java/com/cloud/utils/nio/NioClient.java | 2 +- .../java/com/cloud/utils/nio/NioConnection.java| 2 +- 4 files changed, 58 insertions(+), 20 deletions(-) diff --git a/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java b/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java index 2ebfeb5..0b9899e 100644 --- a/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java +++ b/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java @@ -519,7 +519,7 @@ public class ClusteredAgentManagerImpl extends AgentManagerImpl implements Clust sslEngine.setUseClientMode(true); sslEngine.setEnabledProtocols(SSLUtils.getSupportedProtocols(sslEngine.getEnabledProtocols())); sslEngine.beginHandshake(); -if (!Link.doHandshake(ch1, sslEngine, true)) { +if (!Link.doHandshake(ch1, sslEngine)) { ch1.close(); throw new IOException(String.format("SSL: Handshake failed with peer management server '%s' on %s:%d ", peerName, ip, port)); } diff --git a/utils/src/main/java/com/cloud/utils/nio/Link.java b/utils/src/main/java/com/cloud/utils/nio/Link.java index 8f1b811..35211c8 100644 --- a/utils/src/main/java/com/cloud/utils/nio/Link.java +++ b/utils/src/main/java/com/cloud/utils/nio/Link.java @@ -32,6 +32,8 @@ import java.security.GeneralSecurityException; import java.security.KeyStore; import java.security.SecureRandom; import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; @@ -462,7 +464,7 @@ public class Link { return buffer; } -public static ByteBuffer handleBufferUnderflow(final SSLEngine engine, ByteBuffer buffer) { +public static ByteBuffer handleBufferUnderflow(final SSLEngine engine, final ByteBuffer buffer) { if (engine == null || buffer == null) { return buffer; } @@ -475,14 +477,14 @@ public class Link { return replaceBuffer; } -private static boolean doHandshakeUnwrap(final SocketChannel socketChannel, final SSLEngine sslEngine, +private static HandshakeHolder doHandshakeUnwrap(final SocketChannel socketChannel, final SSLEngine sslEngine, ByteBuffer peerAppData, ByteBuffer peerNetData, final int appBufferSize) throws IOException { if (socketChannel == null || sslEngine == null || peerAppData == null || peerNetData == null || appBufferSize < 0) { -return false; +return new HandshakeHolder(peerAppData, peerNetData, false); } if (socketChannel.read(peerNetData) < 0) { if (sslEngine.isInboundDone() && sslEngine.isOutboundDone()) { -return false; +return new HandshakeHolder(peerAppData, peerNetData, false); } try { sslEngine.closeInbound(); @@ -492,7 +494,7 @@ public class Link { sslEngine.closeOutbound(); // After closeOutbound the engine will be set to WRAP state, // in order to try to send a close message to the client. -return true; +return new HandshakeHolder(peerAppData, peerNetData, true); } peerNetData.flip(); SSLEngineResult result = null; @@ -503,7 +505,10 @@ public class Link { s_logger.error(String.format("SSL error caught during unwrap data: %s, for local address=%s, remote address=%s. The client may have invalid ca-certificates.", sslException.getMessage(), socketChannel.getLocalAddress(), socketChannel.getRemoteAddress())); sslEngine.closeOutbound(); -return false; +return new HandshakeHolder(peerAppData, peerNetData, true); +} +if (result == null) { +return new HandshakeHolder(peerAppData, peerNetData, false); } switch (result.getStatus()) { case OK: @@ -519,23 +524,23 @@ public class Link {
[cloudstack] 09/22: CLOUDSTACK-10010: Port marvin test from #2190 by @swill
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit ad342ebd9f007518bd63e7758ce4de073f335aeb Author: Will StevensAuthorDate: Sat Dec 2 21:11:40 2017 +0530 CLOUDSTACK-10010: Port marvin test from #2190 by @swill This ports the S2S config test by @swill from #2190 with additional changes to make robust and environment agnostic. Signed-off-by: Rohit Yadav --- test/integration/smoke/test_vpc_vpn.py | 468 - 1 file changed, 463 insertions(+), 5 deletions(-) diff --git a/test/integration/smoke/test_vpc_vpn.py b/test/integration/smoke/test_vpc_vpn.py index 83c244b..b3dfab2 100644 --- a/test/integration/smoke/test_vpc_vpn.py +++ b/test/integration/smoke/test_vpc_vpn.py @@ -1138,8 +1138,19 @@ class TestRVPCSite2SiteVpn(cloudstackTestCase): self.apiclient, customer2_response.id, vpn1_response['id']) self.debug("VPN connection created for VPC %s" % vpc1.id) -self.assertEqual( -vpnconn2_response['state'], "Connected", "Failed to connect between VPCs!") +def checkVpnConnected(): +connections = Vpn.listVpnConnection( +self.apiclient, +listall='true', +vpcid=vpc2.id) +if isinstance(connections, list): +return connections[0].state == 'Connected', None +return False, None + +# Wait up to 60 seconds for passive connection to show up as Connected +res, _ = wait_until(2, 30, checkVpnConnected) +if not res: +self.fail("Failed to connect between VPCs, see VPN state as Connected") # acquire an extra ip address to use to ssh into vm2 try: @@ -1174,9 +1185,8 @@ class TestRVPCSite2SiteVpn(cloudstackTestCase): if ssh_client: # run ping test -packet_loss = ssh_client.execute( -"/bin/ping -c 3 -t 10 " + vm1.nic[0].ipaddress + " |grep packet|cut -d ' ' -f 7| cut -f1 -d'%'")[0] -self.assert_(int(packet_loss) == 0, "Ping did not succeed") +packet_loss = ssh_client.execute("/bin/ping -c 3 -t 10 " + vm1.nic[0].ipaddress + " | grep packet | sed 's/.*received, //g' | sed 's/[% ]*packet.*//g'")[0] +self.assert_(int(packet_loss) < 50, "Ping did not succeed") else: self.fail("Failed to setup ssh connection to %s" % vm2.public_ip) @@ -1189,3 +1199,451 @@ class TestRVPCSite2SiteVpn(cloudstackTestCase): cleanup_resources(cls.apiclient, cls.cleanup) except Exception, e: raise Exception("Cleanup failed with %s" % e) + + +class TestVPCSite2SiteVPNMultipleOptions(cloudstackTestCase): + +@classmethod +def setUpClass(cls): +cls.logger = logging.getLogger('TestVPCSite2SiteVPNMultipleOptions') +cls.stream_handler = logging.StreamHandler() +cls.logger.setLevel(logging.DEBUG) +cls.logger.addHandler(cls.stream_handler) + +testClient = super(TestVPCSite2SiteVPNMultipleOptions, cls).getClsTestClient() +cls.apiclient = testClient.getApiClient() +cls.services = Services().services + +cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests()) +cls.domain = get_domain(cls.apiclient) + +cls.compute_offering = ServiceOffering.create( +cls.apiclient, +cls.services["compute_offering"] +) + +cls.account = Account.create( +cls.apiclient, services=cls.services["account"]) + +cls.hypervisor = testClient.getHypervisorInfo() + +cls.logger.debug("Downloading Template: %s from: %s" % (cls.services["template"][ + cls.hypervisor.lower()], cls.services["template"][cls.hypervisor.lower()]["url"])) +cls.template = Template.register(cls.apiclient, cls.services["template"][cls.hypervisor.lower( +)], cls.zone.id, hypervisor=cls.hypervisor.lower(), account=cls.account.name, domainid=cls.domain.id) +cls.template.download(cls.apiclient) + +if cls.template == FAILED: +assert False, "get_template() failed to return template" + +cls.logger.debug("Successfully created account: %s, id: \ + %s" % (cls.account.name, + cls.account.id)) + +cls.cleanup = [cls.account, cls.compute_offering] +return + +def _get_ssh_client(self, virtual_machine, services, retries): +""" Setup ssh client connection and return connection +vm requires attributes public_ip, public_port, username, password """ + +try: +ssh_client = SshClient( +virtual_machine.public_ip, +services["virtual_machine"]["ssh_port"], +
[cloudstack] 15/22: CLOUDSTACK-9501: route is not available by default on CentOS7 (#1637)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit 97c1b03cb2952303335d3bbc68da85b4865216b0 Author: lmrvAuthorDate: Thu Dec 14 00:54:05 2017 +0530 CLOUDSTACK-9501: route is not available by default on CentOS7 (#1637) This adds the `net-tools` dependency on CentOS cloudstack-agent rpms. This will provide ifconfig, route and other tools that may be used by CloudStack scripts and utilities. Signed-off-by: Rohit Yadav --- packaging/centos7/cloud.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/centos7/cloud.spec b/packaging/centos7/cloud.spec index 219b8b6..f16858a 100644 --- a/packaging/centos7/cloud.spec +++ b/packaging/centos7/cloud.spec @@ -104,6 +104,7 @@ Requires: bridge-utils Requires: ebtables Requires: iptables Requires: ethtool +Requires: net-tools Requires: iproute Requires: ipset Requires: perl -- To stop receiving notification emails like this one, please contact "commits@cloudstack.apache.org" .
[cloudstack] 08/22: CLOUDSTACK-10013: Fix ipsec VPN configuration
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch debian9-systemvmtemplate in repository https://gitbox.apache.org/repos/asf/cloudstack.git commit bafab6442d070145c8aa034a59422102abc7f6e5 Author: Rohit YadavAuthorDate: Fri Dec 1 20:58:18 2017 +0530 CLOUDSTACK-10013: Fix ipsec VPN configuration - Fixes strongswan/ipsec, l2tpd and pppd configs - Uses auto=route in ipsec configs - Fixes road-warrior setup - Fixes site-to-site VPN with automatic connection configuration - Fixes vpc_vpn tests Signed-off-by: Rohit Yadav --- systemvm/patches/debian/opt/cloud/bin/configure.py | 38 +- .../patches/debian/opt/cloud/bin/ipsectunnel.sh| 10 +- .../debian/opt/cloud/bin/monitor_service.sh| 2 -- systemvm/patches/vpn/etc/ipsec.d/l2tp.conf | 12 +++ systemvm/patches/vpn/etc/ppp/options.xl2tpd| 2 -- systemvm/patches/vpn/opt/cloud/bin/vpn_l2tp.sh | 18 +- test/integration/smoke/test_vpc_vpn.py | 26 +++ 7 files changed, 55 insertions(+), 53 deletions(-) diff --git a/systemvm/patches/debian/opt/cloud/bin/configure.py b/systemvm/patches/debian/opt/cloud/bin/configure.py index 68d1c26..b8a3e02 100755 --- a/systemvm/patches/debian/opt/cloud/bin/configure.py +++ b/systemvm/patches/debian/opt/cloud/bin/configure.py @@ -546,10 +546,6 @@ class CsSite2SiteVpn(CsDataBag): ikepolicy=obj['ike_policy'].replace(';','-') esppolicy=obj['esp_policy'].replace(';','-') -pfs='no' -if 'modp' in esppolicy: -pfs='yes' - if rightpeer in self.confips: self.confips.remove(rightpeer) file = CsFile(vpnconffile) @@ -557,7 +553,6 @@ class CsSite2SiteVpn(CsDataBag): file.search("conn ", "conn vpn-%s" % rightpeer) file.addeq(" left=%s" % leftpeer) file.addeq(" leftsubnet=%s" % obj['local_guest_cidr']) -file.addeq(" leftnexthop=%s" % obj['local_public_gateway']) file.addeq(" right=%s" % rightpeer) file.addeq(" rightsubnet=%s" % peerlist) file.addeq(" type=tunnel") @@ -567,9 +562,8 @@ class CsSite2SiteVpn(CsDataBag): file.addeq(" ikelifetime=%s" % self.convert_sec_to_h(obj['ike_lifetime'])) file.addeq(" esp=%s" % esppolicy) file.addeq(" lifetime=%s" % self.convert_sec_to_h(obj['esp_lifetime'])) -file.addeq(" pfs=%s" % pfs) file.addeq(" keyingtries=2") -file.addeq(" auto=start") +file.addeq(" auto=route") if 'encap' not in obj: obj['encap']=False file.addeq(" forceencaps=%s" % CsHelper.bool_to_yn(obj['encap'])) @@ -585,10 +579,20 @@ class CsSite2SiteVpn(CsDataBag): logging.info("Configured vpn %s %s", leftpeer, rightpeer) CsHelper.execute("ipsec rereadsecrets") -# This will load the new config and start the connection when needed since auto=start in the config +# This will load the new config CsHelper.execute("ipsec reload") os.chmod(vpnsecretsfile, 0400) +for i in xrange(3): +result = CsHelper.execute('ipsec status vpn-%s | grep "%s"' % (rightpeer, peerlist.split(",", 1)[0])) +if len(result) > 0: +break +time.sleep(1) + +# With 'auto=route', connections are established on an attempt to +# communicate over the S2S VPN. This uses ping to initialize the connection. +CsHelper.execute("timeout 5 ping -c 3 %s" % (peerlist.split("/", 1)[0].replace(".0", ".1"))) + def convert_sec_to_h(self, val): hrs = int(val) / 3600 return "%sh" % hrs @@ -658,6 +662,7 @@ class CsRemoteAccessVpn(CsDataBag): self.confips = [] logging.debug(self.dbag) + for public_ip in self.dbag: if public_ip == "id": continue @@ -665,12 +670,13 @@ class CsRemoteAccessVpn(CsDataBag): #Enable remote access vpn if vpnconfig['create']: +shutdownIpsec = False logging.debug("Enabling remote access vpn on "+ public_ip) dev = CsHelper.get_device(public_ip) if dev == "": -logging.error("Request for ipsec to %s not possible because ip is not configured", public_ip) -continue +logging.error("Request for ipsec to %s not possible because ip is not configured", public_ip) +continue CsHelper.start_if_stopped("ipsec") self.configure_l2tpIpsec(public_ip, self.dbag[public_ip]) @@ -682,7 +688,6 @@ class CsRemoteAccessVpn(CsDataBag): CsHelper.execute("ipsec rereadsecrets") else: logging.debug("Disabling remote access vpn .") -
[GitHub] rafaelweingartner commented on a change in pull request #2370: CLOUDSTACK-9595: Fix regression introduced in #1762
rafaelweingartner commented on a change in pull request #2370: CLOUDSTACK-9595: Fix regression introduced in #1762 URL: https://github.com/apache/cloudstack/pull/2370#discussion_r157985513 ## File path: server/src/com/cloud/network/IpAddressManagerImpl.java ## @@ -936,8 +942,8 @@ public PublicIp assignDedicateIpAddress(Account owner, final Long guestNtwkId, f displayIp = vpc.isDisplay(); } -return fetchNewPublicIp(dcId, null, null, owner, VlanType.VirtualNetwork, guestNtwkId, isSourceNat, false, null, false, vpcId, displayIp); - +ip = fetchNewPublicIp(dcId, null, null, owner, VlanType.VirtualNetwork, guestNtwkId, isSourceNat, true, null, false, vpcId, displayIp); Review comment: ok, no I saw it. 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] rafaelweingartner commented on a change in pull request #2370: CLOUDSTACK-9595: Fix regression introduced in #1762
rafaelweingartner commented on a change in pull request #2370: CLOUDSTACK-9595: Fix regression introduced in #1762 URL: https://github.com/apache/cloudstack/pull/2370#discussion_r157985513 ## File path: server/src/com/cloud/network/IpAddressManagerImpl.java ## @@ -936,8 +942,8 @@ public PublicIp assignDedicateIpAddress(Account owner, final Long guestNtwkId, f displayIp = vpc.isDisplay(); } -return fetchNewPublicIp(dcId, null, null, owner, VlanType.VirtualNetwork, guestNtwkId, isSourceNat, false, null, false, vpcId, displayIp); - +ip = fetchNewPublicIp(dcId, null, null, owner, VlanType.VirtualNetwork, guestNtwkId, isSourceNat, true, null, false, vpcId, displayIp); Review comment: ok, now I saw it. 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 issue #1762: CLOUDSTACK-9595 Transactions are not getting retried in case of datab?
rhtyd commented on issue #1762: CLOUDSTACK-9595 Transactions are not getting retried in case of datab? URL: https://github.com/apache/cloudstack/pull/1762#issuecomment-353012327 @yvsubhash given this has introduced a regressions in snat IP allocation I'm consider this for a revert unless you can help with a quick fix to unblock other PRs being merged. The failure found was: ``` test_01_vpc_remote_access_vpn (integration.smoke.test_vpc_vpn.TestVpcRemoteAccessVpn): DEBUG: Sending GET Cmd : createRemoteAccessVpn=== urllib3.connectionpool: DEBUG: Starting new HTTP connection (1): localhost urllib3.connectionpool: DEBUG: http://localhost:8080 "GET /client/api?account=test-TestRVPCSite2SiteVpn-CRVT35=838a592d-e4dc-11e7-9c0d-a434d91cd37e=true=2df812b1-57a6-470a-a4db-472afed287df=json=nG25osQQTwT630F9niTxS9j5qX4cVRv8PKQ80jXskQ2BmMPvTulGySL0H2sh4OjNX0SOZWcEVyMN2vkUw5lorQ=createRemoteAccessVpn=S6MoFQwy4UKI6CbYTBffqENjVHg%3D=10.3.2.1-10.3.2.10 HTTP/1.1" 431 155 test_01_vpc_remote_access_vpn (integration.smoke.test_vpc_vpn.TestVpcRemoteAccessVpn): ERROR: Exception:['Traceback (most recent call last):\n', ' File "/usr/local/lib/python2.7/dist-packages/marvin/cloudstackConnection.py", line 308, in __parseAndGetResponse\nresponse_cls)\n', ' File "/usr/local/lib/python2.7/dist-packages/marvin/jsonHelper.py", line 150, in getResultObj\nraise cloudstackException.CloudstackAPIException(respname, errMsg)\n', 'CloudstackAPIException: Execute cmd: createremoteaccessvpn failed, due to: errorCode: 431, errorText:The Ip address is not ready to be used yet: 172.20.20.16\n'] ``` The issue can be reproduced by creating a VPN and deploying a VM on a tier. You'll still see the SNAT ip marked as Allocating and this causes creation of VPN to fail. 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 #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9
blueorangutan commented on issue #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9 URL: https://github.com/apache/cloudstack/pull/2211#issuecomment-352941800 Trillian test result (tid-1833) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 24417 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2211-t1833-kvm-centos7.zip Smoke tests completed. 65 look OK, 1 have error(s) Only failed tests results shown below: Test | Result | Time (s) | Test File --- | --- | --- | --- test_01_vpc_remote_access_vpn | `Error` | 30.67 | 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] rhtyd commented on a change in pull request #2370: CLOUDSTACK-9595: Fix regression introduced in #1762
rhtyd commented on a change in pull request #2370: CLOUDSTACK-9595: Fix regression introduced in #1762 URL: https://github.com/apache/cloudstack/pull/2370#discussion_r157983244 ## File path: server/src/com/cloud/network/IpAddressManagerImpl.java ## @@ -936,8 +942,8 @@ public PublicIp assignDedicateIpAddress(Account owner, final Long guestNtwkId, f displayIp = vpc.isDisplay(); } -return fetchNewPublicIp(dcId, null, null, owner, VlanType.VirtualNetwork, guestNtwkId, isSourceNat, false, null, false, vpcId, displayIp); - +ip = fetchNewPublicIp(dcId, null, null, owner, VlanType.VirtualNetwork, guestNtwkId, isSourceNat, true, null, false, vpcId, displayIp); Review comment: @rafaelweingartner actually there is a `ip` variable that is used in `finally` which is why I assign and then return see the code below this line. 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 #2117: CLOUDSTACK-8735:Browser Based Volume and Template Upload Test Automat?
blueorangutan commented on issue #2117: CLOUDSTACK-8735:Browser Based Volume and Template Upload Test Automat? URL: https://github.com/apache/cloudstack/pull/2117#issuecomment-352994952 @borisstoyanov 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] borisstoyanov commented on issue #2117: CLOUDSTACK-8735:Browser Based Volume and Template Upload Test Automat?
borisstoyanov commented on issue #2117: CLOUDSTACK-8735:Browser Based Volume and Template Upload Test Automat? URL: https://github.com/apache/cloudstack/pull/2117#issuecomment-352994807 @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] rhtyd commented on issue #2370: CLOUDSTACK-9595: Fix regression introduced in #1762
rhtyd commented on issue #2370: CLOUDSTACK-9595: Fix regression introduced in #1762 URL: https://github.com/apache/cloudstack/pull/2370#issuecomment-353031343 @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] rhtyd commented on issue #2368: CLOUDSTACK-10126: Separate Subnet for SSVM and CPVM
rhtyd commented on issue #2368: CLOUDSTACK-10126: Separate Subnet for SSVM and CPVM URL: https://github.com/apache/cloudstack/pull/2368#issuecomment-353031485 @nvazquez can you fix conflicts on 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 issue #2369: CLOUDSTACK-10117 Domain level ldap configuration
rhtyd commented on issue #2369: CLOUDSTACK-10117 Domain level ldap configuration URL: https://github.com/apache/cloudstack/pull/2369#issuecomment-353031449 @DaanHoogland can you fix conflicts? 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 issue #2320: CLOUDSTACK-10178: Hotfixes to make 4.10 work
rhtyd commented on issue #2320: CLOUDSTACK-10178: Hotfixes to make 4.10 work URL: https://github.com/apache/cloudstack/pull/2320#issuecomment-353038637 @wido @GabrielBrascher (and others) are you lgtm on this? My only issue with the change is that it's suppressing exceptions with an `except: pass`. 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 issue #2146: Multidisk ova import
rhtyd commented on issue #2146: Multidisk ova import URL: https://github.com/apache/cloudstack/pull/2146#issuecomment-353038941 @nvazquez yes, can you make sure it has all the changes from our internal branches? We may need to run regression and manual tests then. 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 #2208: CLOUDSTACK-9542 make listNics and ListUserVms return uniform NIC data
blueorangutan commented on issue #2208: CLOUDSTACK-9542 make listNics and ListUserVms return uniform NIC data URL: https://github.com/apache/cloudstack/pull/2208#issuecomment-353040906 @rhtyd 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] rhtyd commented on issue #2208: CLOUDSTACK-9542 make listNics and ListUserVms return uniform NIC data
rhtyd commented on issue #2208: CLOUDSTACK-9542 make listNics and ListUserVms return uniform NIC data URL: https://github.com/apache/cloudstack/pull/2208#issuecomment-353040882 @DaanHoogland thanks, you know you can kick tests yourself! @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] rhtyd commented on issue #2042: CLOUDSTACK-9875: Unable to re-apply Explicit dedication to VM
rhtyd commented on issue #2042: CLOUDSTACK-9875: Unable to re-apply Explicit dedication to VM URL: https://github.com/apache/cloudstack/pull/2042#issuecomment-353041712 Tests LGTM, failures are not related to this PR. Merging. 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 issue #1760: CLOUDSTACK-9593: userdata: enforce data is a multiple of 4 characters
rhtyd commented on issue #1760: CLOUDSTACK-9593: userdata: enforce data is a multiple of 4 characters URL: https://github.com/apache/cloudstack/pull/1760#issuecomment-353042472 @marcaurele can you check volume related failures, maybe caused by your 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] nvazquez commented on issue #2368: CLOUDSTACK-10126: Separate Subnet for SSVM and CPVM
nvazquez commented on issue #2368: CLOUDSTACK-10126: Separate Subnet for SSVM and CPVM URL: https://github.com/apache/cloudstack/pull/2368#issuecomment-353031904 Sure, let me remove 2048 commits as it got merged 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 issue #2097: [4.11] CLOUDSTACK-9813: Extending Config Drive support
rhtyd commented on issue #2097: [4.11] CLOUDSTACK-9813: Extending Config Drive support URL: https://github.com/apache/cloudstack/pull/2097#issuecomment-353034900 @krissterckx I had started a thread on dev@ ML asking people to participate in PR review and pinging me if they want to get their PRs merged. Given we're only a few weeks away from freeze I'll be focusing on non-feature related PRs, limiting scope. But with that said, if people can review PRs, demonstrate stability and work with others any kind of PR may be include. I've re-added the milestone tagging. 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 issue #2097: [4.11] CLOUDSTACK-9813: Extending Config Drive support
rhtyd commented on issue #2097: [4.11] CLOUDSTACK-9813: Extending Config Drive support URL: https://github.com/apache/cloudstack/pull/2097#issuecomment-353034900 @krissterckx I had started a thread on dev@ ML asking people to participate in PR review and pinging me if they want to get their PRs merged. Given we're only a few weeks away from freeze I'll be focusing on non-feature related PRs, limiting scope. But with that said, if people can review PRs, demonstrate stability and work with others any kind of PR may be include. 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 issue #2365: CLOUDSTACK-10197: Rename xentools iso for XenServer 7.0+
rhtyd commented on issue #2365: CLOUDSTACK-10197: Rename xentools iso for XenServer 7.0+ URL: https://github.com/apache/cloudstack/pull/2365#issuecomment-353036067 @khos2ow can you fix the build failures? 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 #2146: Multidisk ova import
nvazquez commented on issue #2146: Multidisk ova import URL: https://github.com/apache/cloudstack/pull/2146#issuecomment-353038064 @rhtyd is there something else needed for 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 issue #2368: CLOUDSTACK-10126: Separate Subnet for SSVM and CPVM
rhtyd commented on issue #2368: CLOUDSTACK-10126: Separate Subnet for SSVM and CPVM URL: https://github.com/apache/cloudstack/pull/2368#issuecomment-353039475 @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] rhtyd commented on issue #2104: CLOUDSTACK-9908 : Primary Storage allocated capacity goes very high after VM snapshot
rhtyd commented on issue #2104: CLOUDSTACK-9908 : Primary Storage allocated capacity goes very high after VM snapshot URL: https://github.com/apache/cloudstack/pull/2104#issuecomment-353039745 This has very high failure rate, please check and fix @jayakarteek 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 #2368: CLOUDSTACK-10126: Separate Subnet for SSVM and CPVM
blueorangutan commented on issue #2368: CLOUDSTACK-10126: Separate Subnet for SSVM and CPVM URL: https://github.com/apache/cloudstack/pull/2368#issuecomment-353039690 @rhtyd 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] rhtyd closed pull request #2281: CLOUDSTACK-10102: New network type (L2)
rhtyd closed pull request #2281: CLOUDSTACK-10102: New network type (L2) URL: https://github.com/apache/cloudstack/pull/2281 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/api/src/com/cloud/network/Network.java b/api/src/com/cloud/network/Network.java index a02c8cfdbe2..95833d86b63 100644 --- a/api/src/com/cloud/network/Network.java +++ b/api/src/com/cloud/network/Network.java @@ -38,7 +38,7 @@ public interface Network extends ControlledEntity, StateObject, InternalIdentity, Identity, Serializable, Displayable { public enum GuestType { -Shared, Isolated +Shared, Isolated, L2 } public String updatingInSequence ="updatingInSequence"; diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java index 1ddff84f991..2d30cedcb8d 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java @@ -2207,8 +2207,8 @@ public Network createGuestNetwork(final long networkOfferingId, final String nam + zone.getName()); } if (! UuidUtils.validateUUID(vlanId)){ -// For Isolated networks, don't allow to create network with vlan that already exists in the zone -if (ntwkOff.getGuestType() == GuestType.Isolated) { +// For Isolated and L2 networks, don't allow to create network with vlan that already exists in the zone +if (ntwkOff.getGuestType() == GuestType.Isolated || ntwkOff.getGuestType() == GuestType.L2) { if (_networksDao.listByZoneAndUriAndGuestType(zoneId, uri.toString(), null).size() > 0) { throw new InvalidParameterValueException("Network with vlan " + vlanId + " already exists or overlaps with other network vlans in zone " + zoneId); } else { @@ -2289,8 +2289,9 @@ public Network createGuestNetwork(final long networkOfferingId, final String nam // with different Cidrs for the same Shared network final boolean cidrRequired = zone.getNetworkType() == NetworkType.Advanced && ntwkOff.getTrafficType() == TrafficType.Guest -&& (ntwkOff.getGuestType() == GuestType.Shared || ntwkOff.getGuestType() == GuestType.Isolated && !_networkModel.areServicesSupportedByNetworkOffering( -ntwkOff.getId(), Service.SourceNat)); +&& (ntwkOff.getGuestType() == GuestType.Shared || (ntwkOff.getGuestType() == GuestType.Isolated +&& !_networkModel.areServicesSupportedByNetworkOffering(ntwkOff.getId(), Service.SourceNat)) +|| ntwkOff.getGuestType() == GuestType.L2 && !_networkModel.listNetworkOfferingServices(ntwkOff.getId()).isEmpty()); if (cidr == null && ip6Cidr == null && cidrRequired) { throw new InvalidParameterValueException("StartIp/endIp/gateway/netmask are required when create network of" + " type " + Network.GuestType.Shared + " and network of type " + GuestType.Isolated + " with service " + Service.SourceNat.getName() + " disabled"); @@ -2560,7 +2561,6 @@ public boolean destroyNetwork(final long networkId, final ReservationContext con s_logger.debug("Unable to find network with id: " + networkId); return false; } - // Make sure that there are no user vms in the network that are not Expunged/Error final List userVms = _userVmDao.listByNetworkIdAndStates(networkId); diff --git a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java index b1ff7060ba1..d13234d1016 100644 --- a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java @@ -29,6 +29,9 @@ import javax.annotation.PostConstruct; import javax.inject.Inject; +import com.cloud.network.Network; +import com.cloud.network.dao.NetworkDao; +import com.cloud.network.dao.NetworkVO; import org.apache.log4j.Logger; import com.cloud.server.ResourceTag.ResourceObjectType; @@ -77,6 +80,8 @@ // ResourceTagsDaoImpl _tagsDao = ComponentLocator.inject(ResourceTagsDaoImpl.class); @Inject ResourceTagDao _tagsDao; +@Inject +NetworkDao networkDao; private static final String LIST_PODS_HAVING_VMS_FOR_ACCOUNT = "SELECT pod_id FROM cloud.vm_instance WHERE data_center_id = ? AND account_id = ? AND pod_id IS NOT NULL AND (state = 'Running' OR state = 'Stopped') " @@
[GitHub] rhtyd commented on issue #2281: CLOUDSTACK-10102: New network type (L2)
rhtyd commented on issue #2281: CLOUDSTACK-10102: New network type (L2) URL: https://github.com/apache/cloudstack/pull/2281#issuecomment-353040625 Tests LGTM, others are known failures. This is ready for merging. 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 issue #2301: CLOUDSTACK-10121 moveUser
rhtyd commented on issue #2301: CLOUDSTACK-10121 moveUser URL: https://github.com/apache/cloudstack/pull/2301#issuecomment-353041290 @borisstoyanov merged, please re-kick 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] rhtyd commented on issue #1740: CLOUDSTACK-9572 Snapshot on primary storage not cleaned up after Stor?
rhtyd commented on issue #1740: CLOUDSTACK-9572 Snapshot on primary storage not cleaned up after Stor? URL: https://github.com/apache/cloudstack/pull/1740#issuecomment-353041390 @yvsubhash please discuss and attend to outstanding issues 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 closed pull request #2042: CLOUDSTACK-9875: Unable to re-apply Explicit dedication to VM
rhtyd closed pull request #2042: CLOUDSTACK-9875: Unable to re-apply Explicit dedication to VM URL: https://github.com/apache/cloudstack/pull/2042 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java index f2502442c18..9e3f3c14b80 100644 --- a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java +++ b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java @@ -432,12 +432,23 @@ public UserVm updateVMAffinityGroups(Long vmId, List affinityGroupIds) { throw new InvalidParameterValueException("Unable to find affinity group by id " + affinityGroupId); } else { // verify permissions -_accountMgr.checkAccess(caller, null, true, owner, ag); -// Root admin has access to both VM and AG by default, but make sure the -// owner of these entities is same -if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || _accountMgr.isRootAdmin(caller.getId())) { -if (ag.getAccountId() != owner.getAccountId()) { -throw new PermissionDeniedException("Affinity Group " + ag + " does not belong to the VM's account"); +if (ag.getAclType() == ACLType.Domain) { +_accountMgr.checkAccess(caller, null, false, owner, ag); +// make sure the affinity group is available in that domain +if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || _accountMgr.isRootAdmin(caller.getId())) { +if (!isAffinityGroupAvailableInDomain(ag.getId(), owner.getDomainId())) { +throw new PermissionDeniedException("Affinity Group " + ag + " does not belong to the VM's domain"); +} +} +} else { +_accountMgr.checkAccess(caller, null, true, owner, ag); +// Root admin has access to both VM and AG by default, +// but +// make sure the owner of these entities is same +if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || _accountMgr.isRootAdmin(caller.getId())) { +if (ag.getAccountId() != owner.getAccountId()) { +throw new PermissionDeniedException("Affinity Group " + ag + " does not belong to the VM's account"); +} } } } 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: CLOUDSTACK-9875: Unable to re-apply Explicit dedication to VM (#2042)
This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git The following commit(s) were added to refs/heads/master by this push: new cd637fd CLOUDSTACK-9875: Unable to re-apply Explicit dedication to VM (#2042) cd637fd is described below commit cd637fd05f7c893824319c3040288166c82d6371 Author: harikrishna-patnalaAuthorDate: Wed Dec 20 17:12:46 2017 +0530 CLOUDSTACK-9875: Unable to re-apply Explicit dedication to VM (#2042) Problem: When a VM is deployed with in an Affinity group which has the cluster dedicated to a subdomain (zone is dedicated to parent domain) it is getting successful. We can also stop the vm and remove the affinity group, but if you want to add back the affinity it is failing. Root cause: During VM deployment there is clear check on affinity type (account/domain). Here since the acl_type is "domain" it does not expect to be same owner for entities. But during update of affinity to VM there is no specific check for acl_type "domain". Solution: Fix is to make the access check similar to VM deployment where it does not expect to be same owner for entities if the acl_type is "domain". --- .../affinity/AffinityGroupServiceImpl.java | 23 -- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java index f2c91c8..fd0b937 100644 --- a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java +++ b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java @@ -449,12 +449,23 @@ public class AffinityGroupServiceImpl extends ManagerBase implements AffinityGro throw new InvalidParameterValueException("Unable to find affinity group by id " + affinityGroupId); } else { // verify permissions -_accountMgr.checkAccess(caller, null, true, owner, ag); -// Root admin has access to both VM and AG by default, but make sure the -// owner of these entities is same -if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || _accountMgr.isRootAdmin(caller.getId())) { -if (ag.getAccountId() != owner.getAccountId()) { -throw new PermissionDeniedException("Affinity Group " + ag + " does not belong to the VM's account"); +if (ag.getAclType() == ACLType.Domain) { +_accountMgr.checkAccess(caller, null, false, owner, ag); +// make sure the affinity group is available in that domain +if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || _accountMgr.isRootAdmin(caller.getId())) { +if (!isAffinityGroupAvailableInDomain(ag.getId(), owner.getDomainId())) { +throw new PermissionDeniedException("Affinity Group " + ag + " does not belong to the VM's domain"); +} +} +} else { +_accountMgr.checkAccess(caller, null, true, owner, ag); +// Root admin has access to both VM and AG by default, +// but +// make sure the owner of these entities is same +if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || _accountMgr.isRootAdmin(caller.getId())) { +if (ag.getAccountId() != owner.getAccountId()) { +throw new PermissionDeniedException("Affinity Group " + ag + " does not belong to the VM's account"); +} } } } -- To stop receiving notification emails like this one, please contact ['"commits@cloudstack.apache.org" '].
[GitHub] rhtyd opened a new pull request #2371: README: Happy Holidays, may the cloud be with you in 2018!
rhtyd opened a new pull request #2371: README: Happy Holidays, may the cloud be with you in 2018! URL: https://github.com/apache/cloudstack/pull/2371 Happy holidays, requesting a review! 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 issue #2088: CLOUDSTACK-9892: Primary storage resource check is broken when using ?
rhtyd commented on issue #2088: CLOUDSTACK-9892: Primary storage resource check is broken when using ? URL: https://github.com/apache/cloudstack/pull/2088#issuecomment-353045557 @koushik-das please check and fix test failures? 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 #1934: [CLOUDSTACK-9772] Template: perform a HEAD request to check file size from a URL
rhtyd commented on a change in pull request #1934: [CLOUDSTACK-9772] Template: perform a HEAD request to check file size from a URL URL: https://github.com/apache/cloudstack/pull/1934#discussion_r158005734 ## File path: utils/src/main/java/com/cloud/utils/UriUtils.java ## @@ -201,40 +199,53 @@ public static String getUpdateUri(String url, boolean encrypt) { return details; } +public static void main(String[] args) { Review comment: Remove `main`. 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 issue #1934: [CLOUDSTACK-9772] Template: perform a HEAD request to check file size from a URL
rhtyd commented on issue #1934: [CLOUDSTACK-9772] Template: perform a HEAD request to check file size from a URL URL: https://github.com/apache/cloudstack/pull/1934#issuecomment-353045919 @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] rhtyd commented on issue #2367: Fix ACL_INBOUND/OUTBOUND rules for PrivateGateway
rhtyd commented on issue #2367: Fix ACL_INBOUND/OUTBOUND rules for PrivateGateway URL: https://github.com/apache/cloudstack/pull/2367#issuecomment-353046105 @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 #1934: [CLOUDSTACK-9772] Template: perform a HEAD request to check file size from a URL
blueorangutan commented on issue #1934: [CLOUDSTACK-9772] Template: perform a HEAD request to check file size from a URL URL: https://github.com/apache/cloudstack/pull/1934#issuecomment-353046064 @rhtyd 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] rhtyd commented on issue #2097: [4.11] CLOUDSTACK-9813: Extending Config Drive support
rhtyd commented on issue #2097: [4.11] CLOUDSTACK-9813: Extending Config Drive support URL: https://github.com/apache/cloudstack/pull/2097#issuecomment-353046171 Fix conflicts please 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 #2367: Fix ACL_INBOUND/OUTBOUND rules for PrivateGateway
blueorangutan commented on issue #2367: Fix ACL_INBOUND/OUTBOUND rules for PrivateGateway URL: https://github.com/apache/cloudstack/pull/2367#issuecomment-353046267 @rhtyd 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] rhtyd commented on issue #1762: CLOUDSTACK-9595 Transactions are not getting retried in case of datab?
rhtyd commented on issue #1762: CLOUDSTACK-9595 Transactions are not getting retried in case of datab? URL: https://github.com/apache/cloudstack/pull/1762#issuecomment-353046379 @yvsubhash please go through my comments and also see the regression fix. If this is not resolved earlier, we may, unfortunately, have to revert this. 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 #2368: CLOUDSTACK-10126: Separate Subnet for SSVM and CPVM
blueorangutan commented on issue #2368: CLOUDSTACK-10126: Separate Subnet for SSVM and CPVM URL: https://github.com/apache/cloudstack/pull/2368#issuecomment-353046573 Packaging result: ?centos6 ?centos7 ?debian. JID-1437 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] krissterckx commented on issue #2259: CLOUDSTACK-10024: Network migration support
krissterckx commented on issue #2259: CLOUDSTACK-10024: Network migration support URL: https://github.com/apache/cloudstack/pull/2259#issuecomment-353046904 Hi @borisstoyanov , see https://github.com/nuagenetworks/cloudstack/blob/8dddbb1544cbd34e68e772c294e0e3e287c06f0b/test/integration/plugins/nuagevsp/test_nuage_network_migration.py#L1859 and https://github.com/nuagenetworks/cloudstack/blob/7b51b325bbb85a6bb989dd6b18814ceac26da25a/test/integration/plugins/nuagevsp/test_nuage_network_migration.py#L1902 They migrate an isolated network and VPC within a native physical network, to a new offering. It is a special case of the migration across physical networks, but it comes down to the same behavior : the whole network is reimplemented again as the offering is different. We don't have the infrastructure set up for setting up multiple native physical networks, hence we took this approach. Is it ok we left this test under this nuage test module ? Or would you like to see a new native component test. Let me know what you think , i.e. whether what we did is fine or it is not what you had in mind. 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] blueorangutan commented on issue #2208: CLOUDSTACK-9542 make listNics and ListUserVms return uniform NIC data
blueorangutan commented on issue #2208: CLOUDSTACK-9542 make listNics and ListUserVms return uniform NIC data URL: https://github.com/apache/cloudstack/pull/2208#issuecomment-353047032 Packaging result: ?centos6 ?centos7 ?debian. JID-1438 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 issue #2292: CLOUDSTACK-10108:ConfigKey based approach for reading 'ping' configua?
rhtyd commented on issue #2292: CLOUDSTACK-10108:ConfigKey based approach for reading 'ping' configua? URL: https://github.com/apache/cloudstack/pull/2292#issuecomment-353047502 Ping @mrunalinikankariya 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 #2368: CLOUDSTACK-10126: Separate Subnet for SSVM and CPVM
nvazquez commented on issue #2368: CLOUDSTACK-10126: Separate Subnet for SSVM and CPVM URL: https://github.com/apache/cloudstack/pull/2368#issuecomment-353047486 @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