1001 Commits

Author SHA1 Message Date
Nick Livens
71c9c90e0c CLOUDSTACK-9365 : updateVirtualMachine with userdata should not error when a VM is attached to multiple networks from which one or more doesn't support userdata 2016-05-11 07:59:38 +02:00
Rohit Yadav
126a039eb8 Merge branch '4.7' into 4.8 2016-05-03 08:20:27 +05:30
Rohit Yadav
8e4644e413 vmware: improve support for disks
- Improve disk chain usage while attaching, migrating disks
- Gets root disk controller based diskDeviceBusName from volume's chain info
- Refactor and move VirtualMachineDiskInfo to cloud-utils
- Allows mixing of scsi controller types
- Fixes a NPE case with map passed as null, for example in case of detach volume
  command
- Use a osdefault translator that allow use of recent os types added (enums of
  which) are not available in the sdk

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-04-18 22:44:18 +05:30
Remi Bergsma
bca6076f15 Merge pull request #864 from bvbharatk/CLOUDSTACK-8860
CLOUDSTACK-8860: improve error messages in VM deployment code path.improved the error messages in vm deployment code path. added some more data to the error messages and also fixed some errors using internal ids to use uuids.

* pr/864:
  CLOUDSTACK-8860: improve error messages in VM deployment code path.

Signed-off-by: Remi Bergsma <github@remi.nl>
2016-01-20 15:05:09 +01:00
Remi Bergsma
cdfcea3da2 Merge release branch 4.6 to master
* 4.6:
  [UI] bug fix: Delete added ACL lists is not available for Domain Admin and normal users
  CLOUDSTACK-4787: Allow users to select disk controller for VM/template
  CLOUDSTACK-4787 Allow selection of scsi controller type in vSphere
2015-12-12 22:29:19 +01:00
Wei Zhou
ccf770636c CLOUDSTACK-9051: reprogram network as a part of vm nic ip update 2015-11-30 09:20:26 +01:00
Wei Zhou
c01c73e44d CLOUDSTACK-9051: add unit tests for UpdateVmNicIp 2015-11-30 09:20:26 +01:00
Wei Zhou
b79d338f29 CLOUDSTACK-9051: update nic IP address of stopped vm 2015-11-30 09:20:25 +01:00
Rohit Yadav
a15187a57a CLOUDSTACK-4787: Allow users to select disk controller for VM/template
- Adds new controller types in the UI, for selecting root disk controller while
  registering templates
- Fixes bug to not override disk controller type if provided in the details (either
  vm details or from template details)

(cherry picked from commit c7d67628b3ff86802a1ac3b58e0bc05d54afd543)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-11-27 18:52:02 +05:30
Sateesh Chodapuneedi
6a9956e0f5 CLOUDSTACK-4787 Allow selection of scsi controller type in vSphere
commit #7
    So far only 1 controller (scsi or ide) is supported in Cloudstack for ide or
    scsi, this is existing limitation. Added support for 2nd IDE controller. Support adding IDE
    virtual disk to VM. Also added check if VM is running as IDE virtual disk cannot be attached
    to VM if VM is runnning.If user detaches a virtual disk on lower unit number of controller,
    then subsequent attach operation should find free unit number on the controller and attach
    the virtual disk there.

    commit #6
    Let the controllers of existing VMs continue without flip, current busInfo retrieved from
    chain_info field of volume record from database would be preferred over
    controller settings from all configuration settings.

    commit #5
    Editing global configuration param vmware.root.disk.controller osdefault value results
    in loss of previous root disk controller type. Hence root disk's controller type for legacy
    VMs is unknow post that modificaiton by user. If VM is stop/start then we could get this
    infromation from bus info of existing volume. But if user resets VM and then try to start VM.
    The existing bus info would be lost. Hence existing disk info is not available to depend on.
    Using lsilogic or generic scsi controller for ROOT disk of legacy VMs if reset.

    commit #4
    Avoid adding additional (>1) scsi controllers to system vms. While attaching volume to legacy VM
    don't use osdefault optoin which applicable only for VM created with the option enabled, use
    legacy data disk controller type (lsilogic)

    commit #3
    If root disk's controller type is scsi and data disk controller type condenses
    to any of scsi sub-types then data disk controller type would fall back to root disk controller itself. This
    ensures data volumes would be accessible in all cases as controller of root volume would be reliable
    and it means VM has the supported controller. It also avoids mix of scsi controller sub-types in a user instance.
    Also translating disk controller type scsi to lsilogic.

    commit #2
    Support auto detection of recommended virtual disk controller type for specific guest OS.

    commit #1
    Support granual controller types. Add support for controller types in template registration as well.

    Fix white spaces.
    Removed stale HEAD merge lines
    Removed tail of merge lines
    Fixed VmwareResource, removing storage commands that moved to VmwareStorageProcessor.
    removed stale code of controller that is present in processor
    Fixed check style errors.
    Fixed injection.
    Tested with Linux and windows templates. Unable to run iso based tests due to few bugs in register iso area.

    Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

(cherry picked from commit a4cc987a6f66f20c434942956fffe5951df09e43)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-11-27 18:39:41 +05:30
cirstofolini
1a64c247ad Removed unnecessary @Local annotations and their respective imports from the ComponentLifecycleBase class and its subclasses. 2015-11-21 18:31:11 -02:00
Rajani Karuturi
242b87dbfb CLOUDSTACK-8816: some of the events do not have resource uuids
uuid is missing in the first event of VM create as the entity is just
created and never put in the Context.
Added the entity uuid to context on successful creation.
2015-10-26 09:15:32 +05:30
Boris Schrijver
80cb3adad0 Added isEmpty() check to prevent nullPointerException. 2015-09-23 15:07:16 +02:00
Bharat Kumar
1718bb38aa CLOUDSTACK-8860: improve error messages in VM deployment code path.
Conflicts:
	engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
2015-09-22 10:17:00 +05:30
Rajani Karuturi
37c3451aae CLOUDSTACK-8816 Fixed entityUuid missing in some cases is events
context parameters is Map<object,Object>. This has been used
interchangeably with String and class object resulting the param value
not being available in some cases if its put with object and get with
class.forName()

made the put and get consistent by using Object as key everywhere.
2015-09-09 14:23:27 +05:30
Koushik Das
53cba7c741 Merge pull request #741 from koushik-das/simulator_fixes
Made following fixes in simulator
- Support for ScaleVmCommand/NetworkRulesVmSecondaryIpCommand in resource layer
- Added support for scaling up a running VM in simulator
- Fixed some method names not following convention

In order to test PR #725 using simulator some of these changes are needed.

Based on the way HV check is present in the scale VM API, had to explicitly put simulator related check to allow support. The ideal way would be to remove all these HV specific check from code and made them some configuration (by putting them in hypervisor_capabilities table in DB). But that will be a bigger effort outside the scope of this PR.

Signed-off-by: Koushik Das <koushik@apache.org>
2015-08-31 12:15:54 +05:30
Rajani Karuturi
8bc0294014 Revert "Merge pull request #714 from rafaelweingartner/master-lrg-cs-hackday-003"
This reverts commit cd7218e241a8ac93df7a73f938320487aa526de6, reversing
changes made to f5a7395cc2ec37364a2e210eac60720e9b327451.

Reason for Revert:

noredist build failed with the below error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project cloud-plugin-hypervisor-vmware: Compilation failure
[ERROR] /home/jenkins/acs/workspace/build-master-noredist/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java:[484,12] error: non-static variable logger cannot be referenced from a static context
[ERROR] -> [Help 1]

even the normal build is broken as reported by @koushik-das on dev list
http://markmail.org/message/nngimssuzkj5gpbz
2015-08-31 11:27:57 +05:30
Rafael Weingartner
3818257a68 Solved jira ticket: CLOUDSTACK-8750 2015-08-28 22:35:08 -03:00
Rohit Yadav
5f04aa5687 Merge pull request #673 from anshul1886/CLOUDSTACK-8721
CLOUDSTACK-8721: Fixed Setting details of VM through API results in removal of all other details except the one passed in API

* pr/673:
  CLOUDSTACK-8721: Fixed Setting details of VM through API results in removal of all other details except the one passed in API

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-26 16:08:46 +05:30
Koushik Das
86684cd4bc Made following fixes in simulator
- Support for ScaleVmCommand/NetworkRulesVmSecondaryIpCommand in resource layer
- Added support for scaling up a running VM in simulator
- Fixed some method names not following convention
2015-08-25 14:52:48 +05:30
Boris Schrijver
4b88eabef1 Fix for the NicVO.java regression.
Renamed set*() methods to correct naming.
2015-08-21 14:03:00 +02:00
Boris Schrijver
c30ba1df0b Refactored Nic.java for readability.
Changed methodnames according to Nic.java refactor.

Fixed NicVO.java due to regression from Nic.java refactor.

Fixed VmWareGuru.java after Nic.java refactor.

See issue CLOUDSTACK-8736 for ongoing effort to clean up network code.
2015-08-18 14:04:48 +02:00
Anshul Gangwar
728635a3d3 CLOUDSTACK-8721: Fixed Setting details of VM through API results in removal of all other details except the one passed in API 2015-08-10 16:14:04 +05:30
Boris Schrijver
2984acca83 CLOUDSTACK-8580 Users are now able to view, expunge and recover their vm's themselves. Two configuration options are added to allow this behaviour on a global or per account scale. Configuration options default to false.
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #593
2015-07-23 13:59:44 +02:00
Jayapal
140cd7c227 CLOUDSTACK-8324: Fixed config key in multiple places 2015-07-10 09:47:09 +05:30
Jayapal
6e96fc6f38 CLOUDSTACK-8324: Updated import and added ResourceWrapper annotation 2015-05-28 15:56:37 +05:30
Jayapal
e407986183 CLOUDSTACK-8324: Added config drive support for xenserver 2015-05-28 15:51:50 +05:30
Jayapal
733ac2b728 CLOUDSTACK-8324: Added vm ip fetch logic 2015-05-28 15:42:08 +05:30
Milamber
87d4086a64 CLOUDSTACK-6181 Specify GB for the value of rootdisksize parameter. Add some Bytes/GB for log or exception messages. Fix Gb->GB. 2015-05-23 17:52:21 +01:00
Mike Tutkowski
ac2bccd2a2 Removing unused imports 2015-05-07 13:52:25 -06:00
Daan Hoogland
1c408dec37 Merge branch '4.5' after 4.5.1 vote passes 2015-05-07 16:03:26 +02:00
Rohit Yadav
ca99603321 server: NPE checks and improved case checking
- pool allocation checks for both root and data disks
- NPE checks to not add null object in collection or try to migrate null VM
- HA work tries need to increment and be given up when max retries are crossed
- VM creation should check IP address format for IPv4 and IPv6
- If userdata is not supported by a network, then fail early if userdata, ssh key,
  or password enabled template is passed/used

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 24435dd6bc2424da18277ca00229d1d3bb0ec284)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-16 17:37:03 +05:30
Rohit Yadav
24435dd6bc server: NPE checks and improved case checking
- pool allocation checks for both root and data disks
- NPE checks to not add null object in collection or try to migrate null VM
- HA work tries need to increment and be given up when max retries are crossed
- VM creation should check IP address format for IPv4 and IPv6
- If userdata is not supported by a network, then fail early if userdata, ssh key,
  or password enabled template is passed/used

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-16 17:28:20 +05:30
Bharat Kumar
2783cf540b CLOUDSTACK-7348 InvalidParameter Exception while executing scale vm.
We do not throw the exceptions any more, so added info in the logs to say
what happend to this command.

Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
(cherry picked from commit 659edb4d9b64377a52eb587ab07039e6badb604e)
2015-03-16 12:37:45 +05:30
Bharat Kumar
659edb4d9b CLOUDSTACK-7348 InvalidParameter Exception while executing scale vm.
We do not throw the exceptions any more, so added info in the logs to say
what happend to this command.

Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2015-03-16 12:34:43 +05:30
Funs
c27c69438b hypervisors: add OVM3 plugin that supports OVM 3.2.1/3.3.x
This is a plugin that puts in ovm3 support ranging from 3.3.1 to 3.3.2. Basic
functionality is in here, advanced networking etc..

Snapshots only work when a VM is stopped now due to the semantics of OVM's raw
image implementation (so snapshots should work on a storage level underneath the
hypervisor shrug)

This closes #113

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-12 11:33:42 +05:30
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
Nitin Mehta
4ea0dcda9b CLOUDSTACK-7870: When Vm deployments fail and end in error state volume count should be decremented
(cherry picked from commit a8b89bea4f37a54267694b9a49be6b5bec91f0b0)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-06 16:24:06 +05:30
Saksham Srivastava
54d08a8e29 CLOUDSTACK-8091: Stale entry exists for a VM NIC even after an exception while adding a new nic to vm
(cherry picked from commit 4821bfffe2813ffb43761246e75cc7cf73291d27)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-06 16:19:46 +05:30
Santhosh Edukulla
c25263ba81 Fixed Coverity Issues 2015-02-05 15:59:29 +05:30
Likitha Shetty
f00140243c 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.

(cherry picked from commit 5f9e4fddf303f312a0b17abc0d837f28042caeda)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-02 14:30:18 +05:30
Nitin Mehta
a6f9411b1e CLOUDSTACK-7771: Throw exception while restoring vm if the template is already deleted. Also fix the usage event being generated from the right template id and fix the log message which sometime showed incorrect template id.
CLOUDSTACK-4201: listServiceOfferings API needs to be able to take virtualmachineid of SystemVM and return service offerings available for the vm to change service offering

(cherry picked from commit ee0f0a1cffb96a8371d9a8c4210b428660f79d4f)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-01-20 12:05:25 +05:30
Daan Hoogland
e8a54f471c CID-1114606 use of MAX_VALUE and longValue() on Integer 2015-01-06 16:24:29 +01:00
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
Koushik Das
788fe5a273 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 12:31:34 +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
Saksham Srivastava
4821bfffe2 CLOUDSTACK-8091: Stale entry exists for a VM NIC even after an exception while adding a new nic to vm 2014-12-18 17:45:34 +05:30
Min Chen
9fb654cbad CLOUDSTACK-8077: Not able to deploy VM using a shared template. 2014-12-16 16:40:37 -08:00
Min Chen
cf1eed4811 CLOUDSTACK-8077: Not able to deploy VM using a shared template. 2014-12-16 16:39:56 -08:00
Sebastien Goasguen
cdc66c9e70 Small typo correction, exisits -> exists
Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>

This closes #57
2014-12-15 11:26:19 +05:30