30047 Commits

Author SHA1 Message Date
Rohit Yadav
6f609e6946
Merge pull request #1713 from wido/CLOUDSTACK-9552
CLOUDSTACK-9552: Allow egress TCP/53 implicitly in Basic NetworkingAllow DNS queries over TCP when egress filtering is configured.

When using DNSSEC more and more queries are done over TCP and this
requires 53/TCP to be allowed.

Signed-off-by: Wido den Hollander wido@widodh.nl

* pr/1713:
  CLOUDSTACK-9552: Allow egress TCP/53 implicitly in Basic Networking

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-11-08 15:01:51 +05:30
Rajani Karuturi
f19a1631a5 Merge pull request #1746 from greenqloud/pr-iso-follow-redirects-4.9
SSVM downloader now handles redirects properly.New version of #1607, opened against 4.9 so it can be forward merged.

**Original Description**
Previously it was using the HttpClient to make an initial request to an ISO. This would follow redirects. Then it would make another request using built-in Java URL and InputStream, which doesn't follow redirects. This results in the ISO getting stuck at 0% forever and also causing DOS effects.

* pr/1746:
  SSVM downloader now handles redirects properly.

Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
2016-11-04 16:41:38 +05:30
Rohit Yadav
240f44392c
Merge branch '4.8' into 4.9 2016-11-03 16:55:47 +05:30
Rohit Yadav
c0a6fc2bfb
Merge pull request #1714 from yvsubhash/CLOUDSTACK-9553
CLOUDSTACK-9553 Usage event is not getting recorded for snapshots in a specific scenario

* pr/1714:
  CLOUDSTACK-9553 Usage event is not getting recorded for snapshots in a specific scenario

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-11-03 16:55:21 +05:30
Rohit Yadav
e2e5cdb74f
Merge branch '4.8' into 4.9 2016-11-03 16:52:08 +05:30
Rohit Yadav
41ed00a8ca Merge pull request #1715 from yvsubhash/CLOUDSTACK-9554
CLOUDSTACK-9554 Juniper Contrail plug-in is publishing events to wronJuniper Contrail plug-in is publishing events to message bus instead of event bus

* pr/1715:
  CLOUDSTACK-9554 Juniper Contrail plug-in is publishing events to wrong message bus

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-11-03 16:50:16 +05:30
Rohit Yadav
25b6990e22
server: Fix build regression caused by 32a39
A constructor signature has changed between 4.8 and 4.9+ branches which caused
failure in a unit test introduced by PR #1694. This fixes the unit test by
passing null as the additional parameter (the test does not need instantiated
object).

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-11-03 09:14:35 +05:30
Rohit Yadav
b75e695815
Merge pull request #1728 from shapeblue/4.9_9551
CLOUDSTACK-9551: Move java tmp dir to cloudstack-agent's path to avoidMove java tmp dir to cloudstack-agent's path to avoid noexec on /tmp

* pr/1728:
  CLOUDSTACK-9551: Move java tmp dir to cloudstack-agent's path to avoid noexec on /tmp

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-11-02 23:10:39 +05:30
Rohit Yadav
19951346ad
Merge branch '4.8' into 4.9 2016-11-02 23:03:31 +05:30
Rohit Yadav
68f22e2a43
Merge pull request #1694 from shapeblue/kvm-no-storage-failfast
CLOUDSTACK-9509: Host Connects Without StorageKVM hosts on shared storage failure was accepted by mgmt server with the
host state as Up, even though there was no primary/shared storage available on
it. This patch offers a quick fix by throwing an exception in the storage monitor
which connects storage pool on host. The failure is trapped by agent manager
that disconnects the agent without any investigation.

Based on Lab tests, KVM agent may take upto 2 minutes to attempt NFS mount when
the storage is inaccessible (firewalled, or shutdown) before returning back with
an error. It is safe to assume that this won't add pressure on mgmt server due to
several reconnection attempts, and KVM agent would retry reconnection every 2
minutes.

For such KVM hosts, where failure happens due to storage issues; they will be
briefly put in Alert state but will be mostly be in Connecting state during which
the KVM host attempts to mount/reconfigure NFS storage pool.

/cc @jburwell @karuturi
@blueorangutan package

* pr/1694:
  CLOUDSTACK-9509: Host Connects Without Storage

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-11-02 22:57:51 +05:30
jeff
7a4220f172 SSVM downloader now handles redirects properly.
Previously it was using the HttpClient to make an initial request
to an ISO. This would follow redirects. Then it would make
another request using built-in Java URL and InputStream, which
doesn't follow redirects. This results in the ISO getting stuck
at 0% forever and also causing DOS effects.
2016-11-01 10:48:53 +00:00
Abhinandan Prateek
83b5a8b2b2 CLOUDSTACK-9503: Increased the VR script timeout. Most of the changes are about converting int/long time values to joda Duration. 2016-11-01 16:14:23 +05:30
Rohit Yadav
305400b7b9
Merge branch '4.8' into 4.9 2016-11-01 14:05:43 +05:30
Rohit Yadav
84e282596e Merge pull request #1701 from shapeblue/vr-destroy-ui-allow
CLOUDSTACK-9534: Allow VR to be destroy in UI when in running stateThis allows us to destroy a VR that is in running state from the UI. This action is possible via cloudmonkey/APIs, and would be useful for anyone who wants to simply destroy a VR from the UI without having to stop it first.

As this is a pure UI fix, manual testing would be needed but no regression integration testing is necessary.
/cc @jburwell @karuturi

@blueorangutan package

Screenshot:

![screenshot from 2016-10-05 18-25-49](https://cloud.githubusercontent.com/assets/95203/19113882/398e8a8e-8b29-11e6-8e99-8f28def2e527.png)

* pr/1701:
  CLOUDSTACK-9534: Allow VR to be destroy in UI when in running state

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-11-01 14:04:58 +05:30
Rohit Yadav
2c436a4f1e Merge pull request #1712 from shapeblue/metrics-view-context-filtering
CLOUDSTACK-9550: Use context to filter items in a metrics viewUse available context to filter a metrics view based on zone, cluster, host
in the context object. This fixes metrics view filtering when metrics view is
viewed via Zone->Compute and Storage-> for a resource.

/cc @jburwell @karuturi -- this is a pure UI fix, one manual test LGTM would be required.

* pr/1712:
  CLOUDSTACK-9550: Use context to filter items in a metrics view

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-11-01 14:02:55 +05:30
Ólafur Stefán Arnarsson
420d06f4d3 CLOUDSTACK-9183: bash: /opt/cloud/bin/getRouterAlerts.sh: No such file or directory 2016-10-31 21:44:15 +00:00
Wido den Hollander
8ea75f1a85
CLOUDSTACK-9552: Allow egress TCP/53 implicitly in Basic Networking
Allow DNS queries over TCP when egress filtering is configured.

When using DNSSEC more and more queries are done over TCP and this
requires 53/TCP to be allowed.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
2016-10-31 09:57:25 +01:00
Murali Reddy
b449351a9f CLOUDSTACK-9491: incorrect parsing of device list to find ethernet index of plugged NIC
In VmwareResource, findRouterEthDeviceIndex() method find ethernet interface index given
  the mac address. This method is used, once a nic is plugged to determine ethernet interface.
  "/proc/sys/net/ipv4/conf" from the VR and looped through the devices to find the right
  ethernet interface. However current logic read it once, and loops through the device list.
  Its observerd device may not show up '/proc/sys/net/ipv4/conf' immediatly once NIC is plugged
  in the VM from vCenter.Fix ensured, while waiting for 15 sec in the loop, read the latest
  content from /proc/sys/net/ipv4/conf, so that right device list is processed.
2016-10-28 17:50:36 +05:30
Murali Reddy
9cc06a8fc8 CLOUDSTACK-9498: VR CsFile search utility methods fail when search string has
're' meta chars, and causing VPN user add/deelte to fail

    -there is no real use of python 're' in CsFile.py utility methods searchString, deleteLine
    Replacing with regular string search instead.

    -modifying the smoke test for VPN user add/delete to have all permissable chars
2016-10-28 17:45:15 +05:30
Marc-Aurèle Brothier
0f89a8939f CLOUDSTACK-9544: Check access on account trying to generate user API keys
This fixes CVE-2016-6813

Signed-off-by: Marc-Aurèle Brothier <m@brothier.org>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 158497d68a92ab1e1f864a77371ea1de5c4dc5bb)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-10-28 11:45:38 +05:30
Rohit Yadav
fcee71f35b Merge branch '4.8' into 4.9 2016-10-28 11:43:16 +05:30
Rohit Yadav
ec1d1e50c5 Merge pull request #1742 from shapeblue/cve-2016-6813
CLOUDSTACK-9544: Check access on account trying to generate user API keysThis is to merge Marc's fix on 4.8+ branches.

Tests run:
$ nosetests --with-xunit --xunit-file=test-results.xml --with-marvin --marvin-config=../marvin-cfgs/adv-kvm.cfg  -s -a tags=role --zone=Sandbox-simulator --hypervisor=Simulator  test/integration/component/test_accounts.py

==== Marvin Init Started ====

=== Marvin Parse Config Successful ===

=== Marvin Setting TestData Successful===

==== Log Folder Path: /tmp//MarvinLogs//Oct_27_2016_22_44_32_GVC833. All logs will be available here ====

=== Marvin Init Logging Successful===

==== Marvin Init Successful ====
=== TestName: test_user_cannot_renew_other_keys | Status : SUCCESS ===

=== TestName: test_user_key_renew_same_account | Status : SUCCESS ===

=== TestName: test_updateAdminDetails | Status : SUCCESS ===

=== TestName: test_updateDomainAdminDetails | Status : SUCCESS ===

=== TestName: test_updateUserDetails | Status : SUCCESS ===

===final results are now copied to: /tmp//MarvinLogs/test_accounts_90CDC2===

* pr/1742:
  CLOUDSTACK-9544: Check access on account trying to generate user API keys

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-10-28 11:31:25 +05:30
Marc-Aurèle Brothier
158497d68a CLOUDSTACK-9544: Check access on account trying to generate user API keys
This fixes CVE-2016-6813

Signed-off-by: Marc-Aurèle Brothier <m@brothier.org>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-10-27 22:15:49 +05:30
Sudharma Jain
759a92d251 CLOUDSTACK-9566 instance-id metadata for baremetal VM returns ID 2016-10-27 13:50:39 +05:30
Sudharma Jain
2c443cd189 CLOUDSTACK-9561 Unable to delete domain/Account 2016-10-27 10:58:37 +05:30
Rohit Yadav
a4b1688f79 Merge pull request #1731 from shapeblue/oobm-changepasswd-fix
CLOUDSTACK-9565: Fix intermittent failure in test_oobm_zchange_passwordFixes intermittent integration smoke test failures caused in
test_oobm_zchange_password test.

The scope is limited to the integration test only, and full integration test suite is not necessary. We can only consider code reviews and merge on basis of Travis results.

* pr/1731:
  CLOUDSTACK-9565: Fix intermittent failure in test_oobm_zchange_password

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-10-26 14:25:05 +05:30
Rohit Yadav
29844a3ec9 CLOUDSTACK-9565: Fix intermittent failure in test_oobm_zchange_password
Fixes intermittent integration smoke test failures caused in
test_oobm_zchange_password test.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-10-26 10:31:35 +05:30
Rohit Yadav
770397c0a1 Merge branch '4.8' into 4.9 2016-10-25 15:51:44 +05:30
Rohit Yadav
5a2a2f41b6 Merge pull request #1724 from murali-reddy/test_privategw_acl
CLOUDSTACK-9511: fix test_privategw_acl.py to handle multiple physical network
fix to ensure only physical network with guest traffic is picked up for
creating a private network for vpc private gateway

* pr/1724:
  CLOUDSTACK-9511: fix test_privategw_acl.py to handle multiple physical network

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-10-25 15:50:44 +05:30
subhash yedugundla
38c56bdf44 CLOUDSTACK-9410: Data Disk shown as detached in XS 2016-10-25 14:57:33 +05:30
Murali Reddy
1f50c27fc8 CLOUDSTACK-9511: fix test_privategw_acl.py to handle multiple physical network
fix to ensure only physical network with guest traffic is picked up for
creating a private network for vpc private gateway

Signed-off-by: Murali Reddy <muralimmreddy@gmail.com>

This closes #1724
2016-10-25 13:43:43 +05:30
Murali Reddy
e1202a0b06 CLOUDSTACK-9511: fix test_privategw_acl.py to handle multiple physical network
fix to ensure only physical network with guest traffic is picked up for
creating a private network for vpc private gateway

Signed-off-by: Murali Reddy <muralimmreddy@gmail.com>

This closes #1724
2016-10-25 13:31:35 +05:30
Abhinandan Prateek
bd85e5b4da CLOUDSTACK-9551: Move java tmp dir to cloudstack-agent's path to avoid
noexec on /tmp
2016-10-25 10:55:56 +05:30
nvazquez
94222b1356 CLOUDSTACK-8830: Fix for vm snapshots in Vmware, could not create vm snapshot until 12 minutes after vm creation due to vCenter sent null name on snpashot recent task 2016-10-24 13:26:45 -03:00
Murali Reddy
5728ad03ca CLOUDSTACK-9511: fix test_privategw_acl.py to handle multiple physical network
fix to ensure only physical network with guest traffic is picked up for
creating a private network for vpc private gateway
2016-10-24 15:15:35 +05:30
subhash_y
3987b8c6b4 CLOUDSTACK-9553 Usage event is not getting recorded for snapshots in a specific scenario 2016-10-24 11:47:53 +05:30
Rajani Karuturi
72612f79cd Merge release branch 4.8 to 4.9
* 4.8:
  Emit a VOLUME_DELETE usage event when account deletion destroys an instance.
2016-10-24 11:13:06 +05:30
Rajani Karuturi
fae90341be Merge pull request #1624 from greenqloud/pr-volume-usage-events-fixes-4.8
Fixes regarding VOLUME_DELETE events resulting from account deletionNew version of #1491.

**Original Description**
New version of #1373, but updated for the 4.7 branch with another fix that allows it to properly find expunged root volumes. This is a bug fix, which is why we target the 4.7 branch.

Original pull request:
Fixes regarding usage event emission.

UsageEventUtils was previously not checking deleted accounts, which meant that if an account was deleted that had some resources running on it, those resources would get destroyed without emitting any events.

Furthermore, the VOLUME_DELETE event of ROOT volumes is the responsibility of the UserVmManager, which gets circumvented when expunging resources following the account deletion. Added a check to the AccountManager which catches the ROOT volumes that need to be deleted and emits events for them.

To test this: Create a new user. As that user, create and destroy an instance. This should cause the VM_CREATE, VM_START, VM_STOP, VM_DESTROY, VOLUME_CREATE, and VOLUME_DELETE events to be emitted.
Create a new instance as the same user. Log in as admin, and delete the user. The same set of events should be emitted, and there should be no duplicate DELETE events for the ROOT volume of the previous instance.

* pr/1624:
  Emit a VOLUME_DELETE usage event when account deletion destroys an instance.

Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
2016-10-22 19:42:20 +05:30
nnesic
d989c5d8be Emit a VOLUME_DELETE usage event when account deletion destroys an instance.
Currently the logic about volume deletion seems to be that an event
should be emitted when the volume delete is requested, not when the
deletion completes.

The VolumeStateListener specifically ignores destroy events for ROOT
volumes, assuming that the ROOT volume only gets deleted when the
instance is destroyed and the UserVmManager should take care of it.

When deleting an account, all of its resources get destroyed, but the
instance expunging circumvents the UserVmManager, and thus we miss the
VOLUME_DESTROY usage event. The account manager now attempts to
propperly destroy the vm before expunging it. This way the destroy
logic is respected, including the event emission.
2016-10-21 09:26:59 +00:00
subhash yedugundla
725ddb82a1 CLOUDSTACK-9554 Juniper Contrail plug-in is publishing events to wrong message bus 2016-10-21 12:14:21 +05:30
Rohit Yadav
32a397aa93 CLOUDSTACK-9509: Host Connects Without Storage
KVM hosts on shared storage failure was accepted by mgmt server with the
host state as Up, even though there was no primary/shared storage available on
it. This patch offers a quick fix by throwing an exception in the storage monitor
which connects storage pool on host. The failure is trapped by agent manager
that disconnects the agent without any investigation.

Based on Lab tests, KVM agent may take upto 2 minutes to attempt NFS mount when
the storage is inaccessible (firewalled, or shutdown) before returning back with
an error. It is safe to assume that this won't add pressure on mgmt server due to
several reconnection attempts, and KVM agent would retry reconnection every 2
minutes.

For such KVM hosts, where failure happens due to storage issues; they will be
briefly put in Alert state but will be mostly be in Connecting state during which
the KVM host attempts to mount/reconfigure NFS storage pool.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-10-21 10:22:32 +05:30
Rohit Yadav
9b9b49e10b Merge branch '4.8' into 4.9 2016-10-21 10:14:16 +05:30
Rohit Yadav
a664e035bd Merge pull request #1692 from shapeblue/4.8-marvinpingtests
Fix Smoke Test Failuresfix ping tests to properly recognise successful ping test (on 4.8 branch)

* pr/1692:
  CLOUDSTACK-9529: Cleanup resources after marvin test completes
  CLOUDSTACK-9533: gateway of public IP is not handled correctly when parsing the cmd_line.json to create ips.json databag
  CLOUDSTACK-9532: Use macchinina as a template for failing tests
  CLOUDSTACK-9527: test_01_test_vm_volume_snapshot making test negative again
  CLOUDSTACK-9531: Try template teardown without failure
  CLOUDSTACK-9527: Skip tests not supported for hypervisor
  CLOUDSTACK-9524: Check router hypervisor before ssh to VR
  CLOUDSTACK-9522: Check for available attribute in marvin response
  CLOUDSTACK-9526: Marvin test_deploy_vgpu_enabled_vm.py - Fix a hardcoded username and password
  CLOUDSTACK-9515: internal LB vm is not handled when parsing cmd_line.json, resulting in internal LB vm not come up
  CLOUDSTACK-9161: move quota test to plugins
  Marvin Tests: Fix VPC network offering selection
  fix macchinina template specificied for vmware in Marvin tests
  fix ping tests to properly recognise successful ping test
  CLOUDSTACK-9514: Making the credentials of the host to be picked up from the
  CLOUDSTACK-9511: fix test_privategw_acl.py to handle multiple physical networks

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-10-21 10:11:12 +05:30
Rohit Yadav
2767e1ade6 CLOUDSTACK-9550: Use context to filter items in a metrics view
Use available context to filter a metrics view based on zone, cluster, host
in the context object. This fixes metrics view filtering when metrics view is
viewed via Zone->Compute and Storage-> for a resource.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-10-19 12:23:11 +05:30
Wei Zhou
784c33585f CLOUDSTACK-9538: FIX failure in Deleting Snapshot From Primary Storage RBD Storage if vm has been removed 2016-10-17 08:25:34 +02:00
Rajani Karuturi
2ebf949285 Merge pull request #1702 from nvazquez/listvmsnapshotsissues
CLOUDSTACK-9535: [API] listVMSnapshots improvement### Improvements
- Include missing fields in response: `account`, `domain`, `domainid`, `zoneid`
- Display total count of snapshots, not depending on page size

### Example
After creating 2 vm snapshots for a given vm, and making this API call: `command=listVMSnapshot&listAll=true&virtualmachineid=c8531ef8-8502-4b42-b1c5-c52ace0e7801&_=1475516598524&pagesize=1&page=1` we get this response:

```
<listvmsnapshotresponse cloud-stack-version="4.9.1.0-SNAPSHOT">
<count>2</count>
<vmSnapshot>
<id>88f7416a-8799-4245-99c6-c707cfbe6f47</id>
<name>i-2-10482-VM_VS_20161003174340</name>
<state>Ready</state>
<description>2</description>
<displayname>testsnap2</displayname>
<zoneid>0d074f25-ed31-482f-8bc5-44c9314fc417</zoneid>
<virtualmachineid>c8531ef8-8502-4b42-b1c5-c52ace0e7801</virtualmachineid>
<parent>24e44fe5-5f2e-4d35-a8f8-109b644a04e0</parent>
<parentName>testsnap</parentName>
<current>true</current>
<type>Disk</type>
<created>2016-10-03T10:43:40-0700</created>
<account>admin</account>
<domainid>5a7ffa07-3fca-11e5-9c45-005056ad45b7</domainid>
<domain>ROOT</domain>
</vmSnapshot>
</listvmsnapshotresponse>
```

**NOTES:** As in `listVirtualMachines`, despite `pagesize=1`, `count` field shows total snapshots count for given vm. Also, `account`, `domain`, `domainid`, `zoneid` fields are listed

* pr/1702:
  CLOUDSTACK-9535: [API] listVMSnapshots improvement

Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
2016-10-13 14:04:58 +05:30
Rohit Yadav
65eb3202c2 CLOUDSTACK-9534: Allow VR to be destroy in UI when in running state
This allows admins/users to destroy a VR that is in running state from the UI.
This action is possible via cloudmonkey/APIs.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-10-07 15:15:37 +05:30
Rohit Yadav
409e504f6f CLOUDSTACK-9529: Cleanup resources after marvin test completes
- Cleans up volumes, snapshots and VM after running test_snapshots

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-10-06 16:41:51 +05:30
Murali Reddy
93ac134f1e CLOUDSTACK-9533: gateway of public IP is not handled correctly when parsing the
cmd_line.json to create ips.json databag

using 'gateway' in cmd_line for the public ip gateway while creating ips.json databag
2016-10-06 16:41:29 +05:30
Rohit Yadav
0c146e14c6 CLOUDSTACK-9532: Use macchinina as a template for failing tests
- Switches to macchinina as template for VM in the tests
- Modifies the ostype of the macchinina template to 'Other Linux (64-bit)'
- Check template download status, fixes Nonetype iterable issue

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-10-06 16:41:22 +05:30