31073 Commits

Author SHA1 Message Date
Frank Maximus
3eafd0ce52
Merge pull request #1981 from nuagenetworks/feature/nuage_vpc_selectable_domain_template
CLOUDSTACK-9806: Nuage domain template selection per VPC
2017-11-17 11:31:48 +01:00
Rene Moser
55c059c098 CLOUDSTACK-10144: fix possible NPE in listVlanIpRanges 2017-11-17 10:04:43 +05:30
Rafael Weingärtner
7f6ae15972 Remove annotation not needed at cloud-engine-storage-image (#2324)
remove bogus depends-on declaration at spring-engine-storage-snapshot-core-context
2017-11-16 23:11:15 +05:30
Frank Maximus
14ab69e19a
Merge pull request #2005 from nuagenetworks/feature/nw_offering_for_vpc
CLOUDSTACK-9450: Network Offering for VPC based on DB flag
2017-11-16 17:33:07 +01:00
Rohit Yadav
a1008f9ae2
CLOUDSTACK-10129: Show account, network info in VR list view (#2327)
This shows the owner account and network of a VR in the VR list view,
and for VPCs shows the VPC name and redundant state of the VPC rVR.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-11-16 18:39:57 +05:30
Rohit Yadav
475aa03bb8 Merge branch '4.10'
Forwards merge 4.9->4.10->master.
2017-11-16 11:16:15 +05:30
Rohit Yadav
330f24117c Merge branch '4.9' into 4.10 2017-11-16 11:15:32 +05:30
Rohit Yadav
4fda0c039e
CLOUDSTACK-9998: Fix metrics generation failurein prometheus exporter (#2325)
This fixes metrics generation failures when metrics capacities are null.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-11-16 10:13:53 +05:30
Sigert Goeminne
880e475f40 CLOUDSTACK-9806: Nuage domain template selection per VPC
Co-Authored-By: Prashanth Manthena <prashanth.manthena@nuagenetworks.net>
Co-Authored-By: Frank Maximus <frank.maximus@nuagenetworks.net>

Bug: https://issues.apache.org/jira/browse/CLOUDSTACK-9806

Design Document: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Nuage+domain+template+selection+per+VPC
2017-11-15 14:40:30 +01:00
subhash yedugundla
4f1539ee70 CLOUDSTACK-10135 ACL rules order is not maintained for ACL_OUTBOUND in VPC VR (#2313)
(cherry picked from commit 60bec39b9ddb72c9badda49dc39c4105596bcb90)
2017-11-15 10:12:18 +01:00
subhash yedugundla
f250b3ae0c CLOUDSTACK-10135 ACL rules order is not maintained for ACL_OUTBOUND in VPC VR (#2313)
(cherry picked from commit 60bec39b9ddb72c9badda49dc39c4105596bcb90)
2017-11-15 10:09:35 +01:00
subhash yedugundla
60bec39b9d CLOUDSTACK-10135 ACL rules order is not maintained for ACL_OUTBOUND in VPC VR (#2313) 2017-11-15 10:06:00 +01:00
Rohit Yadav
3ee8d83621 CLOUDSTACK-10136: Fix RemoteHostEndPoint thread growth
This fixes the following:
- Unchecked thread growth in RemoteEndHostEndPoint
- Potential NPE while finding EP for a storage/scope

Unbounded thread growth can be reproduced with following findings:
- Every unreachable template would produce 6 new threads (in a single
ScheduledExecutorService instance) spaced by 10 seconds
- Every reachable template url without the template would produce 1 new
thread (and one ScheduledExecutorService instance), it errors out quickly without
causing more thread growth.
- Every valid url will produce upto 10 threads as the same ep (endpoint
instance) will be reused to query upload/download (async callback)
progresses.

Every RemoteHostEndPoint instances creates its own
ScheduledExecutorService instance which is why in the jstack dump, we
see several threads that share the prefix RemoteHostEndPoint-{1..10}
(given poolsize is defined as 10, it uses suffixes 1-10).

This fixes the discovered thread leakage with following notes:
- Instead of ScheduledExecutorService instance, a cached pool could be
used instead and was implemented, and with `static` scope to be reused
among other future RemoteHostEndPoint instances.
- It was not clear why we would want to wait when we've Answers returned
from the remote EP, and therefore a scheduled/delayed Runnable was
not required at all for processing answers. ScheduledExecutorService
was therefore not really required, moved to ExecutorService instead.
- Another benefit of using a cached pool is that it will shutdown
threads if they are not used in 60 seconds, and they get re-used for
future runnable submissions.
- Caveat: the executor service is still unbounded, however, the use-case
that this method is used for short jobs to check upload/download
progresses fits the case here.
- Refactored CmdRunner to not use/reference objects from parent class.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-11-10 22:04:09 +05:30
Marc-Aurèle Brothier
9c067c0496 CLOUDSTACK-10137: Only link log4j if not already present (#2316)
Use ln -sf to add link log4j.xml.

Signed-off-by: Marc-Aurèle Brothier <m@brothier.org>
2017-11-10 19:59:59 +05:30
Jayapal
4af82bbc5c CLOUDSTACK-9961: Fixed adding domain in vpn customer gateway (#2157)
Added accepting domain for the s2s vpn customer vpn gateway.
2017-11-09 21:38:17 +05:30
Marc-Aurèle Brothier
f0eabad16d Fix GroupBy (+ having) condition and tests (#1723)
The GroupBy + having isn't used currently in the code but was not clean.
It removes unused arguments and variables and adds a test based on a DAO
to show a full example on how to use it.

Signed-off-by: Marc-Aurèle Brothier <m@brothier.org>
2017-11-09 21:01:12 +05:30
Rohit Yadav
ee7dcf78f1
CLOUDSTACK-10129: Allow navigation from VRs to account, network, instances (#2306)
Supports following viewing and navigation/filtering:

- Networks -> view instances (instances that have nics on this network)
- Infra-> VRs -> view instances (attached to the VR's guest network id),
  view owner account (if not system, or project), view instances
- Infra -> VRs -> list of VPC redundant VRs will have redundant state in
  parenthesis in the list

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-11-09 02:09:14 +05:30
mrunalinikankariya
137d6a8940 CLOUDSTACK-10090: createPortForwardingRule api call accepts 'halt' as Protocol which Stops VR (#2273)
…Protocol which Stops VR

When we run the createPortForwardingRule API with input as Protocol as halt the PF rule is added however Halt is executed on VR. Hence the VR is stopped.

Following entry added to Firewall_Rules table and VirtualRouter went to halt(stopped)
mysql> select * from firewall_rules where id = 7

*************************** 1. row ***************************
id: 7
uuid: XXXXXXXXXXXXXXXXXXXXXXXXXXX
ip_address_id: 13
start_port: 222
end_port: 222
state: Revoke
protocol: halt
purpose: PortForwarding
account_id: 2
domain_id: 1
network_id: 208
xid: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
created: 2017-09-04 04:48:16
icmp_code: NULL
icmp_type: NULL
related: NULL
type: User
vpc_id: NULL
traffic_type
2017-11-08 10:25:37 +05:30
mrunalinikankariya
32807cb887 CLOUDSTACK-9958: Include tags of resources in listUsageRecords API (#2242)
Tags field to be included in the listusagerecords response such that it can be used in billing report. E.g.
"tags":[
{"key":"city","value":"Toronto","resourcetype":"UserVm","resourceid":"a0cca906-f985-4b56-ad11-f33e59c4c733","account":"admin","domainid":"dec39eb8-4f81-11e7-8315-067fa0000031","domain":"ROOT"}
,
{"key":"region","value":"canada","resourcetype":"UserVm","resourceid":"a0cca906-f985-4b56-ad11-f33e59c4c733","account":"admin","domainid":"dec39eb8-4f81-11e7-8315-067fa0000031","domain":"ROOT"}
2017-11-07 09:52:00 +05:30
Suresh Kumar Anaparti
c5692cea4e CLOUDSTACK-8599 [VMware] Successful migration was reported as failure when vCenter session timed out 2017-11-07 09:37:03 +05:30
Wido den Hollander
7bd460ce2b packging: Raise compat mode to 9 (#2307)
We are already compatible with that mode and should solve these
warnings:

dh: Compatibility levels before 9 are deprecated (level 7 in use)
   debian/rules override_dh_auto_clean
make[1]: Entering directory '/home/wido/repos/cloudstack'
dh_auto_clean
dh_auto_clean: Compatibility levels before 9 are deprecated (level 7 in use)
rm -f replace.properties.tmp
make[1]: Leaving directory '/home/wido/repos/cloudstack'
   dh_clean
dh_clean: Compatibility levels before 9 are deprecated (level 7 in use)
 debian/rules build
make: 'build' is up to date.
 fakeroot debian/rules binary
dh binary --with python2,systemd
dh: Compatibility levels before 9 are deprecated (level 7 in use)

Signed-off-by: Wido den Hollander <wido@widodh.nl>
2017-11-06 18:18:53 +05:30
vedulasantosh
2874fc23e7 CLOUDSTACK-10051 Mouse Scrolling is not working in instance VM console (#2240)
When mouse is scrolled in VM Console it is not working
2017-11-06 09:58:10 +05:30
Abhinandan Prateek
4627fb2cd7 CLOUDSTACK-9972: Enhance listVolume API to include physical size and … (#2158)
* CLOUDSTACK-9972: Enhance listVolume API to include physical size and utilization.
Also fixed pool, cluster and pod info

* CLOUDSTACK-9972: Fix volume_view and duplicate API constant

* CLOUDSTACK-9972: Backport Do not allow vms to be deployed on hosts that are in disabled pod

* CLOUDSTACK-9972: Fix localization missing keys

* CLOUDSTACK-9972: Fix sql path
2017-11-05 21:44:43 +05:30
Rohit Yadav
8c515df3e4 CLOUDSTACK-10012: Listen on :: for all interface ipv4/6
Per @wido's comment on PR #2226, this adds default server configuration
to make embedded Jetty listen on all interfaces ipv4 and ipv6. This
also fixes default deployment and mgmt server start issues on Trillian
and other CI systems.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-11-04 15:44:19 +05:30
Rohit Yadav
eda3b35bfa CLOUDSTACK-10012: Migrate to Embedded Jetty
- Migrate to embedded Jetty server.
- Improve ServerDaemon implementation.
- Introduce a new server.properties file for easier configuration.
- Have a single /etc/default/cloudstack-management to configure env.
- Reduce shaded jar file, removing unnecessary dependencies.
- Upgrade to Spring 5.x, upgrade several jar dependencies.
- Does not shade and include mysql-connector, used from classpath instead.
- Upgrade and use bountcastle as a separate un-shaded jar dependency.
- Remove tomcat related configuration and files.
- Have both embedded UI assets in uber jar and separate webapp directory.
- Refactor systemd and init scripts, cleanup packaging.
- Made cloudstack-setup-databases faster, using `urandom`.
- Remove unmaintained distro packagings.
- Moves creation and usage of server keystore in CA manager, this
  deprecates the need to create/store cloud.jks in conf folder and
  the db.cloud.keyStorePassphrase in db.properties file. This also
  remove the need of the --keystore-passphrase in the
  cloudstack-setup-encryption script.
- GZip contents dynamically in embedded Jetty

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-11-03 23:57:25 +05:30
Marc-Aurèle Brothier
e9f29c787d CLOUDSTACK-10012: Introduce Embedded Jetty with shaded jar
- Changes packaging to shaded jar
- Introduced embedded jetty
- Updates jetty dependencies version 9.2 (java 7+)
- Initial changes to debian config files
- Initial removal of tomcat dependency
- Introduce ServerDaemon class with customizations
2017-11-03 23:57:25 +05:30
Rafael Weingärtner
c6b808fd33 CLOUDSTACK-10111: Fix validation for parameter "vm.password.length" (#2291)
The description of the parameter was saying that the parameter has to be bigger than 6, however, in the code we were only accepting values bigger than 10. This PR changes the validation method to accept any number >= 6. We also change other inconsistencies in error messages presented to users. in near by validations.
2017-11-03 20:35:33 +05:30
Nicolas Vazquez
1315c947c0 CLOUDSTACK-10122: Unrelated error message (#2302)
Simply remove unrelated text from error message
2017-11-03 20:33:33 +05:30
Frank Maximus
d467a6b8ec CLOUDSTACK-9450: Network Offering for VPC based on DB flag
Co-Authored-By: Raf Smeets <raf.smeets@nuagenetworks.net>
2017-11-03 12:39:23 +01:00
Nitesh Sarda
a50a461c8e CLOUDSTACK-10085 : Upload volume from local fails when global config max.account.seconday.storage is set to -1 2017-11-03 08:43:09 +01:00
Nitesh Sarda
1d36b7288a CLOUDSTACK-10120 : Allow migration of VM's from Cloudstack UI between the hosts with different version 2017-11-03 08:37:20 +01:00
Frank Maximus
d077b3efc6
Merge pull request #2004 from nuagenetworks/feature/vr_without_public_ip
CLOUDSTACK-9832: Do not assign public IP NIC to the VPC VR when the VPC offering does not contain VpcVirtualRouter as a SourceNat provider
2017-11-02 11:56:05 +01:00
Frank Maximus
2139dbe803
Merge pull request #2238 from nuagenetworks/feature/caching_and_statistics
[CLOUDSTACK-10053] Performance improvement: caching of NuageVsp ID
2017-11-02 11:13:15 +01:00
Sigert Goeminne
0871ff9eda CLOUDSTACK-10053: Performance improvement: caching of NuageVsp ID
* VSP ID Caching
* VSP call Statistics
* 5.0 Support

Co-Authored-By: Frank Maximus <frank.maximus@nuagenetworks.net>
Co-Authored-By: Raf Smeets <raf.smeets@nuagenetworks.net>
2017-10-31 17:03:11 +01:00
Sigert Goeminne
587b66db71 CLOUDSTACK-10057: listNetworkOfferings now returns the correct number of offerings (#2250)
Fix paginated response to send correct total resource counts.
2017-10-31 15:05:29 +05:30
Frank Maximus
ca130488c0
Merge pull request #2268 from nuagenetworks/bugfix/CLOUDSTACK-10081
CLOUDSTACK-10081: getDevInfo now returns correct value
2017-10-30 13:25:42 +01:00
Sigert Goeminne
9c7cd8c248 CLOUDSTACK-10081: CloudUtils getDevInfo function will now return "bridge" instead of "dev" when the name of a ovs bridge is passed. 2017-10-30 11:53:04 +01:00
Rohit Yadav
41fdb88970 CLOUDSTACK-10047: DVSwitch fixes and improvements (#2293)
Allow security policies to apply on port groups:
- Accepts security policies while creating network offering
- Deployed network will have security policies from the network offering
  applied on the port group (in vmware environment)
- Global settings as fallback when security policies are not defined for a network
  offering
- Default promiscuous mode security policy set to REJECT as it's the default
  for standard/default vswitch

Portgroup vlan-trunking options for dvswitch: This allows admins to define
a network with comma separated vlan id and vlan
range such as vlan://200-400,21,30-50 and use the provided vlan range to
configure vlan-trunking for a portgroup in dvswitch based environment.

VLAN overlap checks are performed for:
- isolated network against existing shared and isolated networks
- dedicated vlan ranges for the physical/public network for the zone
- shared network against existing isolated network

Allow shared networks to bypass vlan overlap checks: This allows admins
to create shared networks with a `bypassvlanoverlapcheck` API flag
which when set to 'true' will create a shared network without
performing vlan overlap checks against isolated network and against
the vlans allocated to the datacenter's physical network (vlan ranges).

Notes:
- No vlan-range overlap checks are performed when creating shared networks
- Multiple vlan id/ranges should include the vlan:// scheme prefix

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-10-25 15:14:42 +05:30
Daan Hoogland
4d19373d36 Merge release branch 4.10 to master
* 4.10:
  CLOUDSTACK-10113 password resets only one at the time
2017-10-25 09:54:30 +02:00
Daan Hoogland
4f6b91d958 Merge release branch 4.9 to 4.10
* 4.9:
  CLOUDSTACK-10113 password resets only one at the time
2017-10-25 09:51:58 +02:00
Daan Hoogland
382d458f43 CLOUDSTACK-10113 password resets only one at the time 2017-10-25 09:29:35 +02:00
Rohit Yadav
b6dc40faef CLOUDSTACK-10103: Cloudian Connector for CloudStack (#2284)
Several organizations use Cloudian as S3 provider, this implements the
Cloudian Management Console connector for CloudStack that can do the
following:

- Provide ease in connector configuration using CloudStack global
  settings
- Perform SSO from CloudStack UI into Cloudian Management Console (CMC)
  when the connector is enabled
- Automatic provisioning and de-provisioning of CloudStack accounts and
  domains as Cloudian users and groups respectively
- During CloudStack UI logout, logout user from CMC
- CloudStack account will be mapped to Cloudian Users, and CloudStack
  domain will be mapped to Cloudian Groups.
- The CloudStack admin account is mapped to Cloudian admin (user name
  configurable).
- The user/group provisioning will be from CloudStack to Cloudian only,
  i.e. user/group addition/removal/updation/deactivation in Cloudian
  portal (CMC) won't propagate the changes to CloudStack.

FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Cloudian+Connector+for+CloudStack

New APIs:
- `cloudianIsEnabled`: API to check whether Cloudian Connector is enabled.
- `cloudianSsoLogin`: Performs SSO for the logged-in, requesting user
                      and returns the URL that can be used to perform
                      SSO and log into CMC.

New Global Settings:
- cloudian.connector.enabled  (false)
If set to true, this enables the Cloudian Connector for CloudStack.
Restarting management server(s) is required.
- cloudian.admin.host (s3-admin.cloudian.com)
The host where Cloudian Admin services are accessible.
- cloudian.admin.port (19443)
The admin service port.
- cloudian.admin.protocol (https)
The admin service API scheme/protocol.
- cloudian.validate.ssl (true)
 When set to true, this validates the certificate of the https-enabled
admin API service.
- cloudian.admin.user (sysadmin)
The admin user's name when making (admin) API calls.
- cloudian.admin.password (public)
The admin password used when making (admin) API calls.
- cloudian.api.request.timeout (5)
The API request timeout in seconds used by the internal HTTP/s client.
- cloudian.cmc.admin.user (admin)
The CMC admin user's name.
- cloudian.cmc.host (cmc.cloudian.com)
The CMC host.
- cloudian.cmc.port (8443)
The CMC service port.
- cloudian.cmc.protocol (https)
 The CMC service scheme/protocol.
- cloudian.sso.key (ss0sh5r3dk3y)
The Single-Sign-On shared key.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-10-25 10:49:45 +05:30
Rohit Yadav
bd953d811f CLOUDSTACK-10107: For VMware VMs add devices without unit number (#2288)
When VMs are deployed or nics are plugged, using a static unit number
may cause device configuration errors. This fixes a previous limitation
that more than 7 nics/networks could not be added to a VM.

Per the API docs, `unitNumber` need not be set:
https://www.vmware.com/support/developer/converter-sdk/conv55_apireference/vim.vm.device.VirtualDevice.html

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-10-25 09:56:44 +05:30
dahn
285fd77674 CLOUDSTACK-9957 test fix (#2297)
* tyopos in test
* unittest to prove interface
* test logic flaw fixed
2017-10-19 08:57:47 +02:00
Mike Tutkowski
4c89b5b97a Merge branch 'pr-2081' 2017-10-18 14:25:45 -06:00
dahn
3985c68bc5 CLOUDSTACK-10007 no isolationmethod check for directpodbase basic zone nets (#2296) 2017-10-15 09:06:04 +02:00
dahn
a379230e8e CLOUDSTACK-9957 Annotations (#2181)
* annotations on hosts

* Adding marvin tests

* rebase error

* review comments

* context for owner

* review

* illegal entity test

* entityType check on input

* Annotation events

* rebase issues
2017-10-13 11:55:26 +02:00
PranaliM
189b0e4487 CLOUDSTACK-10060: ListUsage API always displays the Virtual size as '0' for Usage type=9 (snapshot) (#2257)
Bug Description:
In the listUsage API, the Virtual Size of Snapshot is always displayed as '0'.

Root Cause:
In case of snapshots, the usage is accounted for depending on the value of the global parameter, 'usage.snapshot.virtualsize.select'. If set to 'true', the usage calculation is done based on the Virtual Size, and if set to false, it is done based on the Physical size. In the Usage API, this value, (i.e. virtual or physical) is displayed as 'Size' field correctly, but the field 'VirtualSize' is always displayed as 0. This is misleading.

Expected Output:
Since this is a Usage API, ideally only that size should be displayed which is used for billing, depending on the value of 'usage.snapshot.virtualsize.select'.
There is another API - the ListSnapshot API that displays both, the physical as well as Virtual size and can be used to know both the sizes.

Fix Implemented:
Skipped showing the 'VirtualSize' Field for type=snapshot
2017-10-12 18:17:18 +05:30
Rohit Yadav
c3ed1b38e5 CLOUDSTACK-9993: Have basic constraint in CA certificate (#2286)
- Refactors V3 x509 cert generator to put basic constraint and key usage
  extensions when CA cert is created
- Refactors root CA provider to use V3 generator to generate CA cert

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-10-11 17:41:37 +05:30
Rohit Yadav
0fedbdd7a9 CLOUDSTACK-9998: Prometheus Exporter for CloudStack (#2287)
This implements a CloudStack Prometheus exporter as a plugin, that serves
metrics on a HTTP port.

New global settings:

1. prometheus.exporter.enable - (default: false), Enable the prometheus
exporter plugin, management server restart needed.
2. prometheus.exporter.port - (default: 9595), The prometheus exporter
server port.
3. prometheus.exporter.allowed.ips - (default: 127.0.0.1), List of comma
separated prometheus server ips (with no spaces) that should be allowed to
access the URLs.

The following list  of  metrics are provided  per pop (zone)  with  the exporter:
• Per host:
o CPU cores:  used, total
o CPU usage:  used, total (in MHz)
o Memory  usage:  used, total (in MiBs)
o Total VMs running on  the host
• CPU cores:  allocated (per  zone)
• CPU usage:  allocated (per  zone, in  MHz)
• Memory  usage:  allocated (per  zone, in  MiBs)
• Hosts:  online, offline,  total
• VMs: in all states -- starting, running, stopping, stopped, destroyed,
       expunging, migrating,  error, unknown
• Volumes:  ready,  destroyed,  total
• Primary Storage Pool: (Disk size) used, allocated,  unallocated,  total (in GiBs)
• Secondary Storage Pool: (Disk size) used, allocated,  unallocated,  total (in GiBs)
• Private IPs:  allocated,  total
• Public  IPs:  allocated,  total
• Shared  Network IPs:  allocated,  total
• VLANs:  allocated,  total

Additional metrics for the environment:
• Summed  domain  (level=1) limit for CPU cores
• Summed  domain  (level=1) limit for memory/ram

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-10-11 17:24:22 +05:30