30260 Commits

Author SHA1 Message Date
Rohit Yadav
ec847a890e Merge pull request #1638 from shapeblue/spring4-java8-only
CLOUDSTACK-9456: Migrate master to Spring 4.xThis changes makes CloudStack use spring 4:

```
- Bump spring-framework version to 4.x and Jetty to version that runs with JDK7
- Bump servet dependency version
- Migrates various xmls to use version independent schema uris
```

Outstanding issue:
    - Testing of various non-standard plugins such as network and storage plugins etc.

Since, this is a big change pinging for review -- @jburwell @karuturi @wido @murali-reddy @abhinandanprateek @DaanHoogland @GaborApatiNagy @JayapalUradi @kishankavala @K0zka @nvazquez @rafaelweingartner @pyr and others

@blueorangutan package

* pr/1638:
  CLOUDSTACK-9456: Update Spring version in maven poms

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-24 09:39:18 +05:30
Rohit Yadav
a9f45dfc5f
Merge branch '4.9' 2016-12-23 17:50:42 +05:30
Rohit Yadav
20986ba512 Merge pull request #1854 from shapeblue/4.9-multiplex-testing
4.9 multiplex testingThis merges several PRs in this PR, this is for speeding up test efforts.

* pr/1854:
  CLOUDSTACK-9688: Fix VR smoke test failure in vpc_vpn
  CLOUDSTACK-9688: Fix failing test_volumes on centos7/kvm
  CLOUDSTACK-9676 Start instance fails after reverting to a VM snapshot, when there are child VM snapshots
  CLOUDSTACK-9612: Fixed issue in restarting redundant network with cleanup Rvr Network with cleanup which is updated from the isolated network is failed. Corrected the column name string issue.
  CLOUDSTACK-9676 Start instance fails after reverting to a VM snapshot, when there are child VM snapshots
  CLOUDSTACK-9673 Exception occured while creating the CPVM in the VmWare Setup over standard vSwitches
  CLOUDSTACK-9617: Fixed enabling remote access after PF or LB  configured on vpn tcp ports
  CLOUDSTACK-9615: Fixed applying ingress rules without ports
  CLOUDSTACK-9639: Unable to create shared network with vLan isolation
  CLOUDSTACK-9597: Should not fetch resource count for removed entity
  CLOUDSTACK-9649: In the management server log there is an error  related to 0.0.0.0 IP address

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-23 17:49:39 +05:30
Murali Reddy
b25bb10c59 CLOUDSTACK-9688: Fix VR smoke test failure in vpc_vpn
The test_vpc_vpn uses a cidr that overlaps with the base test environment's
CIDR causing intermittent failure. This changes the cidr to not overlap
with underlying infra and avoid future failures.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-23 14:46:36 +05:30
Rohit Yadav
cc9e3b2bd4 Merge pull request #1858 from shapeblue/xmas2016
README: Happy Christmas, happy holidays!Here's a screenshot to confirm the UI change:
![screenshot from 2016-12-22 23-42-31](https://cloud.githubusercontent.com/assets/95203/21435538/64d5fdda-c8a0-11e6-9346-bceaa1eca4ab.png)

Pinging for review -- @abhinandanprateek @chipchilders @chiradeep @DaanHoogland  @imduffy15 @K0zka @PaulAngus @nvazquez @terbolous @murali-reddy @NuxRo @wido @mike-tutkowski @swill @resmo @sebgoa @wilderrodrigues @kiwiflyer  @pyr @pdion891 @koushik-das @JayapalUradi  @karuturi @kishankavala @milamberspace @mlsorensen @serverchief @jlk @pdube @syed and many others!

Since this a text/UI change, please accept this without explicit integration test results, of course as long as Travis is green :)

Happy holidays everyone!

* pr/1858:
  README: Happy Christmas, happy holidays!

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-23 12:22:00 +05:30
Rohit Yadav
86247ab3a6 README: Happy Christmas, happy holidays!
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 23:41:14 +05:30
Rohit Yadav
cdbe847d29 CLOUDSTACK-9688: Fix failing test_volumes on centos7/kvm
Due to OS/hypervisor/environmental configuration, detaching a disk/device
using libvirt can be successful without updating the domain configuration (xml).
This leads to reattachment failure as the device is blocked until the next
reboot. This fixes a specific environment case by performing stop/start on
the VM only in case of KVM, which will recreate a fresh domain config (xml)
as KVM VMs have transient domain configs (xmls don't persist).

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 15:23:00 +05:30
Rohit Yadav
52f224f61d Merge pull request #1827 from sateesh-chodapuneedi/pr-cloudstack-9673
CLOUDSTACK-9673 : Exception occured while creating the CPVM in VMware setup over standard vSwitchesJira
===
CLOUDSTACK-9673 : Exception occured while creating the CPVM in VMware setup over standard vSwitches

Issue
====
Exception occured while creating the CPVM in the VmWare Setup using standard vswitches.
```
StartCommand failed due to Exception: com.vmware.vim25.AlreadyExists
message: [] com.vmware.vim25.AlreadyExistsFaultMsg: The specified key, name, or identifier already exists
```

Fix
===
Ensure synchronization while attempting to create port group such that simultaneous attempts are not made with same port group name on same ESXi host.

Testing
======
Successfully ran manual tests (deploy user instance) on top of latest master commit `17653a86fad67447a4f13e455e336694ad5c1735`.This code change is involved in virtual network creation over VMware standard vSwitches. Existing functional tests covers this functionality.

* pr/1827:
  CLOUDSTACK-9673 Exception occured while creating the CPVM in the VmWare Setup over standard vSwitches

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 15:12:16 +05:30
Rohit Yadav
23df5be29e Merge pull request #1828 from sateesh-chodapuneedi/pr-cloudstack-9676
CLOUDSTACK-9676 Start instance fails after reverting to a VM snapshot when there are child VM snapshotsJira
===
CLOUDSTACK-9676 Start instance fails after reverting to a VM snapshot when there are child VM snapshots

Issue
====
Start instance fails after reverting to a VM snapshot, when there is 1 or more child VM snapshots in the snapshot tree of the VM.
Per the code, the method hasSnapshot() is supposed to detect the presence of any snapshot for the VM. But we are checking for only current snapshot instead of checking presence of any snapshot in the snapshot tree.
The failure to detect all snapshots means ACP reconfigures the VM in wrong way assuming there are no snapshots for the VM.
This results in start failure.

Fix
===
Ensure correct detection of VM snapshots in the VM snapshot tree

* pr/1828:
  CLOUDSTACK-9676 Start instance fails after reverting to a VM snapshot, when there are child VM snapshots

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 15:11:36 +05:30
Rohit Yadav
0a42f0127e Merge pull request #1764 from exoscale/fix/CLOUDSTACK-9597
CLOUDSTACK-9597: Should not fetch resource count for removed entityFetch the number of resourceCount by domain and account excluding the removed ones.

Signed-off-by: Marc-Aurle Brothier <m@brothier.org>

* pr/1764:
  CLOUDSTACK-9597: Should not fetch resource count for removed entity

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 13:31:11 +05:30
Rohit Yadav
746998d162 Merge pull request #1811 from sudhansu7/CLOUDSTACK-9649
CLOUDSTACK-9649: In the management server log there is an error
ISSUE
============
In the management server log there is an error

2016-10-01 00:07:31,670 ERROR [c.c.h.v.r.VmwareResource] (DirectAgent-417:ctx-e8c89b3f strmg-esx-01, cmd: GetRouterAlertsCommand) (logid:7beb3819) Command failed due to Exception: java.io.IOException
Message: There was a problem while connecting to 0.0.0.0:3922

In case of basic zone and VMWare ESXi host, the NIC 2 always gets 0.0.0.0 as IP address. Looks like we are generating an error for connecting through this invalid IP.

2016-10-01 04:37:31,680 DEBUG [c.c.a.m.AgentManagerImpl] (RouterStatusMonitor-1:ctx-8880f9c8) (logid:946838b8) Details from executing class com.cloud.agent.api.routing.GetRouterAlertsCommand: Command failed due to Exception: java.io.IOException
Message: There was a problem while connecting to 0.0.0.0:3922

2016-10-01 04:37:31,680 WARN  [c.c.n.r.VirtualNetworkApplianceManagerImpl] (RouterStatusMonitor-1:ctx-8880f9c8) (logid:946838b8) Unable to get alerts from router r-4-VM Command failed due to Exception: java.io.IOException
Message: There was a problem while connecting to 0.0.0.0:3922

2016-10-01 04:37:31,682 DEBUG [c.c.n.ExternalDeviceUsageManagerImpl] (ExternalNetworkMonitor-1:ctx-913c7bae) (logid:1b926a60) External devices stats collector is running...

Root Cause:
As Link local is not used in basic zone mode (vmware). 0.0.0.0 is just shown as a placeholder address. In getRouterAlerts before sending GetRouterAlertsCommand added check for ip and skip the command if ip is '0.0.0.0'.

* pr/1811:
  CLOUDSTACK-9649: In the management server log there is an error  related to 0.0.0.0 IP address

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 13:30:42 +05:30
Rohit Yadav
c7b0345ed2 Merge pull request #1804 from Accelerite/CLOUDSTACK-9639
CLOUDSTACK-9639: Unable to create shared network with vLan isolationDescription:
=========
Create shared network fails with Error.
While creating a shared network it fails to create with Error "The new IP range you have specified has overlapped with the guest network in the zone: XYZ. Please specify a different gateway/netmask"

Steps to Reproduce:
===============
1. Create an isolated network with a subnet eg: 10.1.1.0/24
2. Create a shared network with the same subnet but different VLAN, we should observe this issue.

Expected Behaviour:
===============
It shouldn't restrict the creation of the guest network with the same subnet as long as they are segmented by VLAN.

ACTUAL BEHAVIOR:
===============
It doesn't allow the creation of shared guest networks if there is any isolated guest network using the same subnet although it allows using the same subnet in multiple shared networks.

Cause:
=====
The issue is happening because, when Shared network is getting created we are checking if there is any guest network already implemented with the same CIDR and throwing the error without checking if they are having same VLAN also. Creating the same CIDR shared network with different VLAN should be allowed.

Fix:
===
When creating a shared network, if there is any existing guest network with the same CIDR, we check if they are having the same VLAN, if they are in same VLAN, then we don't allow creating it. If they are in the same CIDR with different VLAN then we allowing to create the network.

* pr/1804:
  CLOUDSTACK-9639: Unable to create shared network with vLan isolation

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 13:29:59 +05:30
Sateesh Chodapuneedi
b0535d770d CLOUDSTACK-9676 Start instance fails after reverting to a VM snapshot, when there are child VM snapshots
Issue
====
Start instance fails after reverting to a VM snapshot, when there is 1 or more child VM snapshots in the snapshot tree of the VM.
Per the code that detects the presence of a snapshot, we are checking for only current snapshot instead of checking presence of any snapshot in the snapshot tree.
The failure to detect all snapshots means ACP reconfigures the VM in wrong way assuming there are no snapshots for the VM.
This results in start failure.

Fix
===
Ensure correct detection of VM snapshots in the VM snapshot tree

This closes #1828

Signed-off-by: Sateesh Chodapuneedi <sateesh.chodapuneedi@accelerite.com>
(cherry picked from commit 673bb25b5936d1c54e9210781280e9ddc507c830)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 13:29:07 +05:30
Jayapalu
7d678dfcae CLOUDSTACK-9612: Fixed issue in restarting redundant network with cleanup
Rvr Network with cleanup which is updated from the isolated network is failed.
Corrected the column name string issue.

This closes #1781

(cherry picked from commit 0f742e17237fc84d5e86dae9a67c7ef6a0b6c80c)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 13:12:12 +05:30
Rohit Yadav
60c4fce690 Merge pull request #1782 from jayapalu/CLOUDSTACK-9617
CLOUDSTACK-9617: Fixed enabling remote access after PF configured on Enabling Remote access Vpn Fails when there is a portforwarding rule of the reserved ports ( 1701 , 500 , 4500) under TCP protocol on Source nat IP

* pr/1782:
  CLOUDSTACK-9617: Fixed enabling remote access after PF or LB  configured on vpn tcp ports

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 13:09:19 +05:30
Rohit Yadav
2088f0ad73 Merge pull request #1783 from jayapalu/CLOUDSTACK-9615
CLOUDSTACK-9615: Fixd applying ingress rules without portsWhen ingress rule is applied without ports (port start and port end params are not passed) then API/UI is showing rule got applied but in the VR, iptables rule not got applied.

Fixed this issue in the VR script.

* pr/1783:
  CLOUDSTACK-9615: Fixed applying ingress rules without ports

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 12:37:13 +05:30
Rohit Yadav
342162bad7 Merge branch '4.9'
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 11:59:02 +05:30
Rohit Yadav
a0e36b73ae Merge pull request #1711 from syed/xenserver7
XenServer 7 SupportThis PR adds support for XenServer 7. I have manually done the following tests
- Create a new cluster with XenServer7
- Add Primary storage: Should create an SR on XS7
- Add another XS7 host to the Pool
- Add host2 to Cloudstack
- Create VM1 from template
- Create VM2 from template
- Ping/SSH VM1 to VM2 and vice-versa
- Stop/Delete/Expunge VM2
- Create Data disk
- Attach it to VM1
- Create VM snaphsot of VM1
- Restore VM snapshot of VM1
- Delete VM snapshot of VM1
- Create Volume snapshot of Datadisk
- Create volume snapshot of Root disk
- Create new template from snapshot of root disk
- Create volume from snapshot of datadisk
- Detach datadisk volume
- Delete datadisk volume
- Aquire a public IP
- Create a static nat to VM1
- Live migrate VM1 while traffic on VM
- Delete VM1

* pr/1711:
  [CLOUDSTACK-9662] Add support for XenServer 7

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 11:18:57 +05:30
Rohit Yadav
38a955e8ec Merge pull request #1851 from shapeblue/4910to4920upgradepath
schema: Upgrade path from 4.9.1.0 to 4.9.2.0Upgrade paths added so PRs such as #1711 can use it.

* pr/1851:
  schema: Upgrade path from 4.9.1.0 to 4.9.2.0

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 11:13:47 +05:30
Rohit Yadav
f1cc4d1f5d schema: Upgrade path from 4.9.1.0 to 4.9.2.0
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 11:12:45 +05:30
Rohit Yadav
5b7f35c39f
Merge branch '4.9' 2016-12-22 10:02:24 +05:30
Rohit Yadav
743dd4249c Merge pull request #1839 from shapeblue/CLOUDSTACK-9683
CLOUDSTACK-9683: system.vm.default.hypervisor will pin the hypervisor for VR too with this fix

* pr/1839:
  CLOUDSTACK-9683: system.vm.default.hypervisor will pin the hypervisor for VR too with this fix

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 10:01:52 +05:30
Syed
eabf862ba9 [CLOUDSTACK-9662] Add support for XenServer 7 2016-12-21 16:58:10 -05:00
Sateesh Chodapuneedi
674bb064a3 CLOUDSTACK-9676 Start instance fails after reverting to a VM snapshot, when there are child VM snapshots
Issue
====
Start instance fails after reverting to a VM snapshot, when there is 1 or more child VM snapshots in the snapshot tree of the VM.
Per the code that detects the presence of a snapshot, we are checking for only current snapshot instead of checking presence of any snapshot in the snapshot tree.
The failure to detect all snapshots means ACP reconfigures the VM in wrong way assuming there are no snapshots for the VM.
This results in start failure.

Fix
===
Ensure correct detection of VM snapshots in the VM snapshot tree

Signed-off-by: Sateesh Chodapuneedi <sateesh.chodapuneedi@accelerite.com>
2016-12-22 01:41:33 +05:30
Sateesh Chodapuneedi
32e9e29a17 CLOUDSTACK-9673 Exception occured while creating the CPVM in the VmWare Setup over standard vSwitches
Issue
====
Exception occured while creating the CPVM in the VmWare Setup using standard vswitches.
StartCommand failed due to Exception: com.vmware.vim25.AlreadyExists
message: [] com.vmware.vim25.AlreadyExistsFaultMsg: The specified key, name, or identifier already exists

Fix
===
Ensure synchronization while attempting to create port group such that simultaneous attempts are not made with same port group name on same ESXi host.

Signed-off-by: Sateesh Chodapuneedi <sateesh.chodapuneedi@accelerite.com>
2016-12-22 01:35:10 +05:30
Rohit Yadav
d63c74a7d9
Merge branch '4.9' 2016-12-22 00:16:41 +05:30
Rohit Yadav
f68b6e8312 Merge pull request #1846 from shapeblue/49smoketest-fixes
CLOUDSTACK-9688: Fix failing smoke testsFixes failing smoke tests due to enviroment issues or corner cases:
- Fixes NPE in Template Manager

@blueorangutan package

* pr/1846:
  CLOUDSTACK-9688: Fix failing smoke tests

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 00:16:21 +05:30
Rohit Yadav
6f98fcd3a5 CLOUDSTACK-9688: Fix failing smoke tests
Fixes failing smoke tests due to enviroment issues or corner cases:
- Fixes NPE in Template Manager

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-21 11:45:20 +05:30
Abhinandan Prateek
ca8a00442c CLOUDSTACK-9683: system.vm.default.hypervisor will pin the hypervisor for VR too with this fix 2016-12-19 13:06:02 +05:30
Rohit Yadav
0dce1c50c1 CLOUDSTACK-9456: Update Spring version in maven poms
- Bump spring-framework version to 4.x and Jetty to version that runs with JDK8
- Bump servet dependency version
- Migrate spring xmls to version 4, fixes schema locations that are 3.0
  dependent in various xmls.
- Fix failing tests due to spring upgrade
  (Thanks @marcaurele Marc-Aurèle Brothier for fixing them)
    * Fix test DeploymentPlanningManagerImplTest
    * Fix GloboDNS test

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-16 21:21:20 +05:30
Rohit Yadav
61073ea511
Merge branch '4.9' 2016-12-16 21:00:23 +05:30
Rohit Yadav
5e19e64f2f Updating pom.xml version numbers for release 4.9.2.0-SNAPSHOT
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-16 20:48:16 +05:30
Rohit Yadav
f850b381ad
Merge pull request #1831 from shapeblue/fix-sql-pr-1615-410
CLOUDSTACK-9671: Fix sql change to corresponding version paths- Fixes issue of failing upgrade paths
- Moves schema changes from PR #1615 in the 4.9.1.0 to 4.10.0.0 sql path

* pr/1831:
  CLOUDSTACK-9671: Fix sql change to corresponding version paths

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-15 12:10:05 +05:30
Rohit Yadav
dd321a6de3 CLOUDSTACK-9671: Fix sql change to corresponding version paths
- Fixes issue of failing upgrade paths
- Moves schema changes from PR #1615 in the 4.9.1.0 to 4.10.0.0 sql path

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-15 12:00:47 +05:30
Jayapalu
d2ca30a133 CLOUDSTACK-9617: Fixed enabling remote access after PF or LB configured on vpn tcp ports 2016-12-12 11:59:33 +05:30
Jayapalu
fed58eebdd CLOUDSTACK-9615: Fixed applying ingress rules without ports 2016-12-12 11:11:02 +05:30
Rohit Yadav
af2679959b Updating pom.xml version numbers for release 4.9.1.0
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
4.9.1-RC1 4.9.1.0 4.9.1.0-rc1
2016-12-10 08:38:03 +05:30
Rohit Yadav
17653a86fa
Merge branch '4.9' 2016-12-10 01:29:16 +05:30
Rohit Yadav
7da95172a4
Merge branch '4.8' into 4.9 2016-12-10 01:28:14 +05:30
Rohit Yadav
a13ee852af Merge pull request #896 from yvsubhash/CLOUDSTACK-8908
CLOUDSTACK-8908 After copying the template charging for that template is getting stoppedThis is happening as the zone id is not part of the query.  Zone id is added to the query and unit tests are also added

* pr/896:
  CLOUDSTACK-8908 After copying the template charging for that template is stopped

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-10 00:15:35 +05:30
Rohit Yadav
c89198f4c6 Merge pull request #1796 from sudhansu7/CLOUDSTACK-9626
CLOUDSTACK-9626: Instance fails to start after unsuccesful computeISSUE
============
Instance fails to start after unsuccesful compute offering upgrade.

TROUBLESHOOTING
==================
We observed VM instance get compute values "cpuNumber","cpuSpeed","memory" removed from table "user_vm_details", which cause instance fail to startup next time on XenServer

`mysql> select * from user_vm_details where vm_id=10;
--------------------------------------------------------------------------------------------------
id 	vm_id 	name 	value 	display

--------------------------------------------------------------------------------------------------
218 	10 	platform 	viridian:true;acpi:1;apic:true;pae:true;nx:true 	1
219 	10 	hypervisortoolsversion 	xenserver56 	1
220 	10 	Message.ReservedCapacityFreed.Flag 	true 	1

--------------------------------------------------------------------------------------------------
3 rows in set (0.00 sec)`

`2016-11-29 06:49:03,667 ERROR [c.c.a.ApiAsyncJobDispatcher] (API-Job-Executor-12:ctx-49c25b1d job-125) (logid:114a2f1b) Unexpected exception while executing org.apache.cloudstack.api.command.admin.vm.ScaleVMCmdByAdmin
java.lang.NullPointerException
	at com.cloud.vm.UserVmManagerImpl.upgradeRunningVirtualMachine(UserVmManagerImpl.java:1664)
	at com.cloud.vm.UserVmManagerImpl.upgradeVirtualMachine(UserVmManagerImpl.java:1631)
	at com.cloud.vm.UserVmManagerImpl.upgradeVirtualMachine(UserVmManagerImpl.java:1561)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
	at org.apache.cloudstack.network.contrail.management.EventUtils$EventInterceptor.invoke(EventUtils.java:106)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
	at com.cloud.event.ActionEventInterceptor.invoke(ActionEventInterceptor.java:51)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
	at com.sun.proxy.$Proxy197.upgradeVirtualMachine(Unknown Source)
	at org.apache.cloudstack.api.command.admin.vm.ScaleVMCmdByAdmin.execute(ScaleVMCmdByAdmin.java:48)
	at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:150)
	at com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:108)
	at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:554)
	at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
	at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46)
	at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.run(AsyncJobManagerImpl.java:502)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)`

REPRO STEPS
==================
1. Set global setting enable.dynamic.scale.vm to true
2. Create a custom Compute Offerings A
3. Create a VM instance apply A, ie. cpuNumber=1,cpuSpeed=1000,memory=512M
4. Create another custom Compute Offerings B
5. Change service offering to B, ie. cpuNumber=2,cpuSpeed=2000,memory=4096M (ensure 4 times over previous memory size), then you will encounter scaling failed
6. Stop VM instance , you will never startup again

EXPECTED BEHAVIOR
==================
Succeed Startup VM instance

ACTUAL BEHAVIOR
==================
Fail to start instance

RCA:
The ROLLBACK does not take care of restoring old service offering details. In case failure we are removing the new service offering details but restoring old service offering details is missing.

Before Fix:
`user_vm_details before upgrade.
mysql> select * from user_vm_details where vm_id =9;
+-----+-------+------------------------------------+-------------------------------------------------+---------+
| id  | vm_id | name                               | value                                           | display |
+-----+-------+------------------------------------+-------------------------------------------------+---------+
| 118 |     9 | platform                           | viridian:true;acpi:1;apic:true;pae:true;nx:true |       1 |
| 119 |     9 | hypervisortoolsversion             | xenserver56                                     |       1 |
| 120 |     9 | Message.ReservedCapacityFreed.Flag | false                                           |       1 |
| 121 |     9 | cpuNumber                          | 1                                               |       1 |
| 122 |     9 | cpuSpeed                           | 1000                                            |       1 |
| 123 |     9 | memory                             | 256                                             |       1 |
+-----+-------+------------------------------------+-------------------------------------------------+---------+
6 rows in set (0.00 sec)

user_vm_details after unsuccessful upgrade.
mysql> select * from user_vm_details where vm_id =9;
+-----+-------+------------------------------------+-------------------------------------------------+---------+
| id  | vm_id | name                               | value                                           | display |
+-----+-------+------------------------------------+-------------------------------------------------+---------+
| 133 |     9 | platform                           | viridian:true;acpi:1;apic:true;pae:true;nx:true |       1 |
| 134 |     9 | hypervisortoolsversion             | xenserver56                                     |       1 |
| 135 |     9 | Message.ReservedCapacityFreed.Flag | false                                           |       1 |
+-----+-------+------------------------------------+-------------------------------------------------+---------+
3 rows in set (0.00 sec)`

After fix:
`
mysql> select * from user_vm_details where vm_id =9;
+-----+-------+------------------------------------+-------------------------------------------------+---------+
| id  | vm_id | name                               | value                                           | display |
+-----+-------+------------------------------------+-------------------------------------------------+---------+
| 166 |     9 | cpuNumber                          | 1                                               |       1 |
| 167 |     9 | platform                           | viridian:true;acpi:1;apic:true;pae:true;nx:true |       1 |
| 168 |     9 | cpuSpeed                           | 1000                                            |       1 |
| 169 |     9 | Message.ReservedCapacityFreed.Flag | false                                           |       1 |
| 170 |     9 | memory                             | 256                                             |       1 |
| 171 |     9 | hypervisortoolsversion             | xenserver56                                     |       1 |
+-----+-------+------------------------------------+-------------------------------------------------+---------+
6 rows in set (0.00 sec)
`

* pr/1796:
  CLOUDSTACK-9626: Instance fails to start after unsuccesful compute offering  upgrade.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-09 23:52:47 +05:30
Sudhansu
542a2112ba CLOUDSTACK-9626: Instance fails to start after unsuccesful compute
offering  upgrade.
2016-12-09 17:06:13 +05:30
Rohit Yadav
f2798403b5 Merge pull request #1815 from pdion891/dockerfile4.10.0
Fix docker image build for cloudstack-managementCLOUDSTACK-9651

Fix Docker images build for 4.10.0.0:
- simulator
- marvin
- management_centos6

Squashed version of #1435.

* pr/1815:
  CLOUDSTACK-9651; fix docker image build for cloudstack-management, simulator and marvin for 4.10.0.0 close #1435

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-09 13:34:27 +05:30
Rohit Yadav
fac8c5fc2a
Merge branch '4.9' 2016-12-09 13:32:43 +05:30
Rohit Yadav
b931b798f8
Merge branch '4.8' into 4.9 2016-12-09 13:32:21 +05:30
Rohit Yadav
f8c9f454d2 Merge pull request #1823 from shapeblue/4.8-travis-templatefix
CLOUDSTACK-9594: Fix regression in test_templatesFixes regression in component test `test_templates.py`

* pr/1823:
  CLOUDSTACK-9594: Fix regression in test_templates

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-09 13:31:51 +05:30
Nitin Kumar Maharana
25efc1acd6 CLOUDSTACK-9639: Unable to create shared network with vLan isolation 2016-12-09 12:55:31 +05:30
Rohit Yadav
ae32aa13ed CLOUDSTACK-9594: Fix regression in test_templates
Fixes regression in component test `test_templates.py`

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-09 11:57:40 +05:30
Rohit Yadav
7df21f9cce
Merge branch '4.9' 2016-12-09 00:40:05 +05:30
Rohit Yadav
f03015b25b Merge pull request #1817 from sateesh-chodapuneedi/pr-cloudstack-9654
CLOUDSTACK-9654 Missing hypervisor mapping of various SUSE Linux gues**Jira**
CLOUDSTACK-9654 Missing hypervisor mapping of various SUSE Linux guest os versions on VMware 6.0

**Issue:**
Currently many versions of SUSE Linux does not have any hypervisor mapping entry in guest_os_hypervisor table in cloud database for VMware 6.0. Also observed that the guest_os_name field is incorrect for some SUSE Linux variants, which results in deployed instance (with SUSE Linux) set to guest OS type as "Other (64-bit)" on vCenter, which would not represent the guest OS accurately on hypervisor.

**Fix:**
Add the missing hypervisor mappings
Signed-off-by: Sateesh Chodapuneedi <sateesh.chodapuneedi@accelerite.com>

The current (4.9) list of SUSE Linux guest os in database looks as below,

```
> mysql> select id,display_name from guest_os where display_name like '%suse%';
 +-----+----------------------------------------------+
 | id  | display_name                                 |
 +-----+----------------------------------------------+
 |  40 | SUSE Linux Enterprise Server 9 SP4 (32-bit)  |
 |  41 | SUSE Linux Enterprise Server 10 SP1 (32-bit) |
 |  42 | SUSE Linux Enterprise Server 10 SP1 (64-bit) |
 |  43 | SUSE Linux Enterprise Server 10 SP2 (32-bit) |
 |  44 | SUSE Linux Enterprise Server 10 SP2 (64-bit) |
 |  45 | SUSE Linux Enterprise Server 10 SP3 (64-bit) |
 |  46 | SUSE Linux Enterprise Server 11 (32-bit)     |
 |  47 | SUSE Linux Enterprise Server 11 (64-bit)     |
 |  96 | SUSE Linux Enterprise 8(32-bit)              |
 |  97 | SUSE Linux Enterprise 8(64-bit)              |
 | 107 | SUSE Linux Enterprise 9(32-bit)              |
 | 108 | SUSE Linux Enterprise 9(64-bit)              |
 | 109 | SUSE Linux Enterprise 10(32-bit)             |
 | 110 | SUSE Linux Enterprise 10(64-bit)             |
 | 151 | SUSE Linux Enterprise Server 10 SP3 (32-bit) |
 | 152 | SUSE Linux Enterprise Server 10 SP4 (64-bit) |
 | 153 | SUSE Linux Enterprise Server 10 SP4 (32-bit) |
 | 154 | SUSE Linux Enterprise Server 11 SP1 (64-bit) |
 | 155 | SUSE Linux Enterprise Server 11 SP1 (32-bit) |
 | 185 | SUSE Linux Enterprise Server 11 SP2 (64-bit) |
 | 186 | SUSE Linux Enterprise Server 11 SP2 (32-bit) |
 | 187 | SUSE Linux Enterprise Server 11 SP3 (64-bit) |
 | 188 | SUSE Linux Enterprise Server 11 SP3 (32-bit) |
 | 202 | Other SUSE Linux(32-bit)                     |
 | 203 | Other SUSE Linux(64-bit)                     |
 | 244 | SUSE Linux Enterprise Server 12 (64-bit)     |
 +-----+----------------------------------------------+
 26 rows in set (0.00 sec)

```

The current (4.9) hypervisor mappings for SUSE Linux guest os over VMware 6.0 in database looks as below. We can observe in the below query result, which lists all hypervisor mappings for SUSE Linux guest OS over VMware 6.0, many guest os listed in above query result are missing their mappings for VMware 6.0. Hence the need to add the missing hypervisor mappings.

```
mysql> select o.id,o.display_name, h.guest_os_name, h.hypervisor_version from guest_os as o, guest_os_hypervisor as h where o.id=h.guest_os_id and h.hypervisor_version='6.0' and h.hypervisor_type='vmware' and o.display_name like '%SUSE%';
+-----+----------------------------------+---------------+--------------------+
| id  | display_name                     | guest_os_name | hypervisor_version |
+-----+----------------------------------+---------------+--------------------+
|  96 | SUSE Linux Enterprise 8(32-bit)  | suseGuest     | 6.0                |
|  97 | SUSE Linux Enterprise 8(64-bit)  | suse64Guest   | 6.0                |
| 107 | SUSE Linux Enterprise 9(32-bit)  | suseGuest     | 6.0                |
| 108 | SUSE Linux Enterprise 9(64-bit)  | suse64Guest   | 6.0                |
| 109 | SUSE Linux Enterprise 10(32-bit) | suseGuest     | 6.0                |
| 110 | SUSE Linux Enterprise 10(64-bit) | suse64Guest   | 6.0                |
| 202 | Other SUSE Linux(32-bit)         | suseGuest     | 6.0                |
| 203 | Other SUSE Linux(64-bit)         | suse64Guest   | 6.0                |
+-----+----------------------------------+---------------+--------------------+
8 rows in set (0.00 sec)

```

* pr/1817:
  CLOUDSTACK-9654 Missing hypervisor mapping of various SUSE Linux guest os versions on VMware 6.0

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-09 00:38:41 +05:30