1507 Commits

Author SHA1 Message Date
Rohit Yadav
ef99f01e59 Merge remote-tracking branch 'anshul/CLOUDSTACK-6900'
This closes #68

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-02 16:40:44 +05:30
Rohit Yadav
43cf1da865 CLOUDSTACK-5238: password checks, NPE fixes and minor fixes
- insecure authenticators excluded in configuration
- snapshot response should have zone
- remove vmsnapshots when removing accounts

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 5481485a083957ff58da3b6fea9d7b6d20f06875)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	api/src/org/apache/cloudstack/api/response/VMSnapshotResponse.java
	server/src/com/cloud/api/ApiResponseHelper.java
	server/src/com/cloud/storage/download/DownloadActiveState.java
2015-02-27 18:24:46 +05:30
Daan Hoogland
43a39d1eb0 findbugs: possible nullpointer 2015-02-19 10:27:51 +01:00
Daan Hoogland
0f8a055dff findbugs: equals() call on Long instead of =-comparison 2015-02-19 10:23:10 +01:00
Rohit Yadav
1a6df6f978 CLOUDSTACK-7908: Add user_id column to vm_instance table
Design Document:
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Allow+VM+listing+by+User+ID

- Adds column to VMInstance DAO
- Adds column in vm_instance table
- Adds column in the UserVMJoinVO
- Adds default admin user which has UID = 2
- Adds migration path that sets user_id to first user of the accountId that
  owns the vm in vm_instance table
- Add arg on list VMs API to query by userId, add support in query layer
- Refactor VMInstanceVO and child classes to accept userId
- Add code to let service layer pass userId if loggedIn user belongs to same
  account as the owner executing an API call or use first user from owner account
- In case of CPVM and SSVM use system user ID
- Fix unit tests and spring injections

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-16 15:02:38 +05:30
Daan Hoogland
7e75f339bc license and format 2015-02-12 14:47:12 +00:00
Daan Hoogland
a9c384fd17 CLOUDSTACK-8238 mocked test to make sure xapi code is called in test for
pingtask
2015-02-10 16:15:24 +01:00
Rohit Yadav
a8f9233377 CLOUDSTACK-8146: close search builder using done()
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit a4d24adfb889291bfb3b888555603e66aeee51a1)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-05 18:06:15 +05:30
Rohit Yadav
7c41a1184c agent: don't investigate if host is null, send alert instead
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-05 16:42:13 +05:30
Rohit Yadav
a2547ed827 orchestration: allow storage migration
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-05 16:38:53 +05:30
Rohit Yadav
61dfb2d625 AgentAttache: allow checkonhost command in maintenance, cancel if only allowed
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-05 16:29:03 +05:30
Rohit Yadav
d4663df7c9 Make volume deletion publish event, removed by 781648fb1003c8c32875e9ff7a6c4ef4694539f7
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-05 15:01:39 +05:30
Daan Hoogland
b586439c9f CLOUDSTACK-8197 create MinVRVersion config item 2015-02-03 13:18:15 +01:00
Mike Tutkowski
31f67c2b3c If the HypervisorType of a storage pool is Any, we need to retrieve hosts in the given zone for each HypervisorType. 2015-01-29 19:18:04 -07:00
Mike Tutkowski
bd6a89939d Adding/updating comments around the volume's hypervisor snapshot reserve field 2015-01-29 15:50:42 -07:00
Mike Tutkowski
1b51bbbf74 Update hypervisor snapshot reserve for the root volume earlier than when it is currently being set 2015-01-29 13:01:51 -07:00
Mike Tutkowski
c2330f48dd Replace synchronized with the use of database locking 2015-01-27 17:36:21 -07:00
Mike Tutkowski
c847831662 Do not allow deletion of the snapshot if the snapshot is being copied 2015-01-26 14:57:28 -07:00
Nitin Mehta
abf4e5c646 CLOUDSTACK-8181: Introducing a new allocator called firstfitleastconsumed. The purpose of this allocator is to find hosts/pools with least capacity usage (in terms of percentage) within the cluster and use those resources first before others. This allocator can be used changing vm.allocation.algorithm. For hosts it would decide the least consumed host through the setting host.capacityType.to.order.clusters to base the usage on cpu or ram.
Reviewed-by: Prachi
2015-01-26 10:48:06 -08:00
Daan Hoogland
29aeed71fc CLOUDSTACK-6485 prevent ipaddress asignment of gateway to gateway-interface on vpc router by setting vpcid to null in network 2015-01-26 16:54:53 +01:00
Mike Tutkowski
8204a44890 When creating a template from a managed-storage snapshot, put the snapshot in the Copying state before performing the copy (don't want to do anything with the snapshot until this process has completed) 2015-01-25 23:29:27 -07:00
Rohit Yadav
f9a8111e17 CLOUDSTACK-8151: Add removeRawUsageRecords API to cleanup old cloud_usage data
Call removeRawUsageRecords with interval (> 0) and it will clean up cloud_usage
table by removing records older than interval no. of days from today (current date)
and in case it runs when the job exec time is near, it will fail alerting
user to try again after a 15 min window.

There is an issue with async job scheduler, if this API were async it tries
to search and remove job from cloud_usage.async_job table and fails which is
why this API is sync and extends BaseCmd.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-01-23 19:38:32 +05:30
Mike Tutkowski
2094286c8a Adding support for creating a volume from a snapshot when the snapshot is on managed storage 2015-01-21 13:06:05 -07:00
Rohit Yadav
664186f483 CLOUDSTACK-8160: use preferable protocols
(cherry picked from commit debfcdef788ce0d51be06db0ef10f6815f9b563b)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-01-21 18:04:45 +05:30
Mike Tutkowski
0f84e042b9 Adding support for creating a volume from a snapshot when the snapshot is on managed storage 2015-01-20 15:24:33 -07:00
Abhinandan Prateek
d8def3dc0b CLOUDSTACK-8164: Look for all host to avoid NPE
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit a1a601be5a08a42739c3ef999f551db1b7bd7749)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-01-19 11:30:49 +05:30
Rohit Yadav
d9bd235bf6 engine/storage: add NPE check, break if parent snapshot is null
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit c06ca09b54b053b37db9d4fc47226558bf15c6ba)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-01-18 17:20:56 +05:30
Anshul Gangwar
91e1881be8 CLOUDSTACK-6900: This fixes volume migration failing after that volume is downloaded.
When we download volume then we create entry in volume_store_ref table.
We mark the volume entry to ready state once download_url gets generated.
When we migrate that volume, then again one more entry is created with same volume id.
Its state is marked as allocated. Later we try to list only one dataobject in datastore
for state transition during volume migration. If the listed volume's state is allocated
then migration passes otherwise it fails.

Below fix will remove the randomness and give priority to volume entry which is made for
migration (download_url/extracturl will be null in case of migration). Giving priority to
download volume case is not needed as there will be only one entry in that case so no randomness.
2015-01-16 15:15:14 +05:30
Daan Hoogland
06d4458d0a CID-1256275 regression: resource leak in systemvm update code 2015-01-12 20:40:01 +01:00
Wei Zhou
b528047fb6 CLOUDSTACK-8146: Resource count of primary storage does not consider the detached volumes 2015-01-12 12:25:28 +01:00
Likitha Shetty
4b67a48144 CLOUDSTACK-3439. [VMWARE] While preparing for migration, include dynamically created nics in case of VMware too. 2015-01-08 09:50:19 +05:30
Kishan Kavala
f767adfe71 Bug-Id: CLOUDSTACK-3439: Include dynamically created nics in Prepare for migration command in KVM 2015-01-07 14:52:42 +05:30
Kishan Kavala
438f90a262 Close transaction while fetching recent events 2015-01-07 14:14:44 +05:30
Kishan Kavala
9eb8d538dd For volumes created from template, do not log offering ID in VOLUME.CREATE in usage_event. Moved offering type to DiskOffering interface 2015-01-07 12:31:41 +05:30
Kishan Kavala
42cecbb000 Network offering usage event should be logged for UserVms only 2015-01-07 12:29:11 +05:30
Daan Hoogland
5251fb2dc3 CID-1261670 added null check 2015-01-05 16:01:13 +01:00
Daan Hoogland
251e88c401 CID-1261671 added null check 2015-01-05 15:55:33 +01:00
Likitha Shetty
15b348632d CLOUDSTACK-8129. Cold migration of VM across VMware DCs leaves the VM behind in the source host.
If VM has been cold migrated across different VMware DCs, then unregister the VM from source host.
2014-12-26 11:07:30 +05:30
Likitha Shetty
7b32b8a268 CLOUDSTACK-8125. VM fails to start on the first attempt after a cold migration.
Update volume chain_info to NULL during cold migration.
Otherwise during VM start, CCP will configure and try to power-on the VM with wrong disk information.
2014-12-24 14:33:51 +05:30
Likitha Shetty
a5a65c7b55 CLOUDSTACK-8122. Handle NPE thrown during migration failures.
When migration fails instead of returning NULL, throw the exception.
2014-12-24 13:33:11 +05:30
Likitha Shetty
521258bafb CLOUDSTACK-8114. Ensure VM stop and then start updates the volume path correctly in the DB. 2014-12-24 09:56:06 +05:30
Likitha Shetty
5f9e4fddf3 CLOUDSTACK-8112. CS allows creation of VM's with the same Display name when vm.instancename.flag is set to true.
During VM creation, if vm.instancename.flag is set to true and hypervisor type is VMware, check if VM with the same hostname already exists in the zone.
2014-12-23 14:00:32 +05:30
Likitha Shetty
33179cce56 CLOUDSTACK-8112. CS allows creation of VM's with the same Display name when vm.instancename.flag is set to true.
Before registering a VM check if a different CS VM with same name exists in vCenter.
2014-12-23 13:48:01 +05:30
Koushik Das
106ec718fc Revert "CLOUDSTACK-7872: network getting shutdown inspite of running VM's in the network"
This reverts commit 709bf074de9f8f22e6a71362551c4867be884e4b.

Network GC is broken with out-of-band VM movements due to the original commit, so reverting.
2014-12-23 12:13:51 +05:30
Likitha Shetty
a75a431373 CLOUDSTACK-8107. Failed to create snapshot from volume when the task is performed repeatedly in zone wide primary Storage.
While taking a snapshot of a volume, CS chooses the endpoint to perform backup snapshot operation by selecting any host that has the storage containing the volume mounted on it.
Instead, if the volume is attached to a VM, the endpoint chosen by CS should be the host that contains the VM.
2014-12-23 09:48:35 +05:30
Koushik Das
331e257ca0 CLOUDSTACK-8103: Vmsync marks VM as stopped even after failing to stop it in HV
During vmsync if StopCommand (issued as part of PowerOff/PowerMissing report) fails to stop VM (since VM is running on HV),
don't transition VM state to "Stopped" in CS db. Also added a check to throw ConcurrentOperationException if vm state is not
"Running" after start operation.
2014-12-22 10:52:13 +05:30
Min Chen
e559b15b6a CLOUDSTACK-8101: volume sync not working as expected - MS restart during upload volume leaves volume in hung state. 2014-12-19 16:51:41 -08:00
Min Chen
ea634550fc CLOUDSTACK-8101: volume sync not working as expected - MS restart during upload volume leaves volume in hung state. 2014-12-19 15:51:52 -08:00
Sanjay Tripathi
0c4128e024 CLOUDSTACK-8097: Failed to create volume snapshot after vm live migration across clusters. 2014-12-19 14:26:48 +05:30
Saksham Srivastava
1df0453d27 CLOUDSTACK-8088: VM scale up is failing in vmware with Unable to execute ScaleVmCommand due to java.lang.NullPointerException 2014-12-18 14:27:55 +05:30