465 Commits

Author SHA1 Message Date
Wido den Hollander
4709756bd5 agent: Use FileInputStream for reading files instead of cat
Cat'ing a file and parsing that output is not reliable and this can be done
by using Java's native methods for that.
2013-02-02 18:08:24 +01:00
Kelven Yang
1b2b369ecb Merge latest master into javelin 2013-01-31 11:34:49 -08:00
Kelven Yang
176523254e Improve component lifecycle management with system run-level concept 2013-01-30 15:21:02 -08:00
Marcus Sorensen
482ce5fe07 Summary: Account for embedded nics (e.g. 'em0') when looking for physical nic
Signed-off-by: Marcus Sorensen <marcus@betterservers.com>
2013-01-28 21:21:30 -07:00
Rohit Yadav
356866c72b Merge branch 'master' into javelin
- Fixed new join dao impls as spring components
- Fixed component context xml to load api rate limit checker
- Fixed root pom.xml for duplicate plugin
- Fixed list data centers method
- Fixed following conflicts:
	api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java
	api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
	api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java
	api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java
	plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
	server/src/com/cloud/api/ApiDBUtils.java
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/api/query/QueryManagerImpl.java
	server/src/com/cloud/configuration/DefaultComponentLibrary.java
	server/src/com/cloud/server/ManagementServerImpl.java
	server/src/com/cloud/storage/swift/SwiftManagerImpl.java

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-24 19:18:53 -08:00
Hugo Trippaers
a0373fe1ff Summary: Apply feedback from Wido
Better checking on VlanID

Correct speling mistake
2013-01-21 12:34:20 +01:00
Hugo Trippaers
04f82623f6 Merge branch 'master' into cloud-agent-with-openvswitch
Conflicts:
	plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
2013-01-21 12:18:21 +01:00
Marcus Sorensen
a65b584d18 Summary: Fix bridge parsing when bridge names are subsets of others
Detail: There are several places in the code that do a
"brctl show | grep bridgeName" or similar, which causes all sorts
of problems when you have for example a cloudVirBr50 and a
cloudVirBr5000. This patch attempts to stop relying on the output
of brctl, instead favoring sysfs and /sys/devices/virtual/net.
It cuts a lot of bash out altogether by using java File. It was
tested in my devcloud-kvm against current 4.0, as well as by the
customer reporting initial bug.

BUG-ID: CLOUDSTACK-938
Fix-For: 4.0.1
Signed-off-by: Marcus Sorensen <marcus@betterservers.com>
2013-01-18 18:28:08 -07:00
Alex Huang
10d9c019a9 All merge conflicts resolved 2013-01-18 12:14:57 -08:00
Marcus Sorensen
55e8965bd0 Summary: Pass StoragePoolType that maps to libvirt in cleanupDisk
Description: When selecting a storage adaptor, cleanupDisk assumes that
libvirt is being used. Therefore, we pass a StoragePoolType that maps to
libvirt. This is the only place in LibvirtComputingResource where the
StoragePoolType can't be pulled from somewhere else.

BUG-ID: CLOUDSTACK-1011
Signed-off-by: Marcus Sorensen <marcus@betterservers.com>
2013-01-18 00:20:34 -07:00
Marcus Sorensen
975021dda1 Summary: adding resizeVolume api call
Detail: This merges the resizevolume feature branch, which provides the
ability to migrate a disk between disk offerings, thereby changing its
size, or specifying a new size if current disk offering is custom.

BUG-ID: CLOUDSTACK-644
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1358358209 -0700
2013-01-16 17:43:35 -07:00
anthony
a6b9027630 default Security rule doesn't apply to system VMs since nic.getIsolationUri is not set
use to.setSecurityGroupEnabled to indicate if securitygroup is enabled on this NIC

CLOUDSTACK-983: default Security rule doesn't apply to system VMs
2013-01-15 11:15:42 -08:00
Wido den Hollander
95222cdb6d Templates: Add Ubuntu 12.04 to the templates
Although I still think the templates aren't well maintained, I just
added 12.04 since this is an LTS and people probably want it in the
list of templates.

This system should be more generic I think though.
2013-01-15 13:25:48 +01:00
Hugo Trippaers
2d69a1855d Summary: Begone pesky tabs 2013-01-15 10:00:58 +01:00
Hugo Trippaers
9f00302ad3 Summary: Polish and shine
Document the used options in agent.properties

Default the bridge driver to something sensible based on the
configuration of the bridge type.
2013-01-15 09:18:24 +01:00
Hugo Trippaers
4267a3fc7c Summary: copy/paste error 2013-01-15 09:18:24 +01:00
Hugo Trippaers
87fe646953 Summary: small fix causing trouble when shutting down virtual machines 2013-01-15 09:18:24 +01:00
Hugo Trippaers
e0ecf7b834 Summary: Add vlan configuration to the network inteface definition
Add xml piece for defining vlans

Set vlan tag in the libvirt definition for the network inteface
2013-01-15 09:18:24 +01:00
Hugo Trippaers
68523e641f Summary: Add initial support for OpenVswitch to the KVM hypervisor
Create OvsVifDriver to deal with openvswitch specifics for plugging
intefaces

Create a parameter to set the bridge type to use in
LibvirtComputingResource. 
Create several functions to get bridge information from openvswitch

Add a check to detect the libvirt version and throw an exception when
the version is to low ( < 0.9.11 )

Fix classpath loading in Script.findScript to deal with missing path
separators at the end.

Add notification to the BridgeVifDriver that lswitch broadcast type is
not supported.
2013-01-15 09:18:24 +01:00
Hugo Trippaers
3d570c7647 Summary: Add vlan configuration to the network inteface definition
Add xml piece for defining vlans

Set vlan tag in the libvirt definition for the network inteface
2013-01-15 09:09:14 +01:00
Hugo Trippaers
a0ade283b7 Summary: Add initial support for OpenVswitch to the KVM hypervisor
Create OvsVifDriver to deal with openvswitch specifics for plugging
intefaces

Create a parameter to set the bridge type to use in
LibvirtComputingResource. 
Create several functions to get bridge information from openvswitch

Add a check to detect the libvirt version and throw an exception when
the version is to low ( < 0.9.11 )

Fix classpath loading in Script.findScript to deal with missing path
separators at the end.

Add notification to the BridgeVifDriver that lswitch broadcast type is
not supported.
2013-01-15 09:09:14 +01:00
Alex Huang
f922c6fc03 Keep removing 2013-01-10 14:46:52 -08:00
Alex Huang
56e5fbdee2 removed import of componentlocator and inject from all files 2013-01-10 11:44:47 -08:00
Alex Huang
cf8de7ee17 Removed all the .project files 2013-01-08 14:11:00 -08:00
Alex Huang
30f2565d98 Merge branch 'api_refactoring' into javelin 2013-01-08 12:36:04 -08:00
Hugo Trippaers
91673b10b8 Summary: Get started with packaging cloud-agent
Modify the spec file to package the agent files and the scripts

Some changes to the poms to put the java dependencies in the right place.

Move the agent script to the dedicated os dir in packaging.
2013-01-07 22:18:01 +01:00
Marcus Sorensen
6ed1989133 Summary: Allow for custom storage adaptors based on pool type in KVM
Detail: Instead of using LibvirtStorageAdaptor for everything, you can create
your own storage adaptor and use it. We select storage adaptor based on storage
pool type, thus we needed to adjust LibvirtComputingResource to pass pool type
to everything in KVMStoragePoolManager. This in turn required that we pass the
info necessary to LibvirtComputingResource as well, so a few agent Commands were
modified.

Note this patch in and of itself shouldn't change any existing behavior, just
allow for new storage adaptors to be selected based on storage pool type.

Reviewed-by: Edison Su
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1355769696 -0700
2012-12-17 11:41:36 -07:00
Hugo Trippaers
2b74b6e827 Start removing the old ant build files
Removed all build.xml files from the plugins
2012-12-07 15:58:56 +01:00
Marcus Sorensen
7ce2227108 Summary: master - Copy qcow2 instead of converting if source and dest are qcow2
Detail: If source image is qcow2, and we want a qcow2 image, then doing a
convert strips off compression and any snapshots the user had in that image. If
a backing file exists, we stick with convert so we can pull in both the backing
file and the COW image, otherwise we just cp the qcow2 file. This is also faster

Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1354755241 -0700
2012-12-05 17:54:01 -07:00
Marcus Sorensen
05d3f86b16 Summary: Fix orphaned patch disks for system VMs on KVM
Detail: This patch deletes any patchdisk found when deleting root volume for
system VM.

BUG-ID: CLOUDSTACK-566
Bugfix-for: 4.0.1
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1354222335 -0700
2012-11-29 13:52:15 -07:00
Marcus Sorensen
5aad7cc307 Summary: Pull patch from 4.0 that skips deleting patchVbd when systemvms are
stopped

Detail: This patch fixed an issue with hosts trying to stop system vms that were
already not running and deleting a patch disk for the system vm running on
another host. It got applied to 4.0 but not master.

Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1354222160 -0700
2012-11-29 13:49:20 -07:00
Marcus Sorensen
88180fc139 Summary: Direct template imaging for CLVM, bypass copy template to primary
Detail: Because of the way most other primary storage types work with cloudstack
   (i.e. backing stores) CLVM actually copies the template to a local logical
   volume on primary storage, then uses that. This causes all of your primary
   storage to be littered with a copy of every template used. Since we're not
   using these, dump the template direct to the newly created logical volume.
   This is faster as well since the template is sparse; we're not creating a fat
   template on primary storage and then copying that to a logical volume when we
   deploy from template.

BUG-ID: CLOUDSTACK-508
Bugfix-for: 4.1
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1353221260 -0700
2012-11-17 23:47:39 -07:00
Marcus Sorensen
b42f3f53d8 Summary: Fix empty traffic labels causing NullPointerExceptions on KVM
Detail: In com.cloud.hypervisor.kvm.resource.BridgeVifDriver.java, in 2 places
an if block should have evaluated to true if trafficLabel was null, however it
was causing a NullPointerException instead.

BUG-ID : NONE
Bugfix-for: 4.0
Reviewed-by: Marcus Sorensen
Reported-by: Dave Cahill
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1352307750 -0700
2012-11-07 10:02:30 -07:00
Alex Huang
91e68b5f2c A bunch of .project changes again 2012-11-04 19:25:03 -08:00
marcus
843e140858 Summary: Allow public and private nic to be the same bridge
Detail: There was a regression in functionality introduced by
915babd970a9b4f209deceb3c4973b7d1c9c0c12 where the public
bridge could not also be the private bridge. This had several
additional consequences, this patch should revert the behavior
back while keeping the functionality enhancements introduced by that
commit.

BUG-ID : NONE
Reviewed-by: Dave Cahill
Reported-by: Dave Cahill via cloudstack-dev
Signed-off-by: Marcus Sorensen <shadowsor@gmail.com> 1351574006 -0600
2012-10-29 23:13:26 -06:00
Hiroaki Kawai
c03712e86a CLOUDSTACK-423 : During VM migration on KVM, VifDriver.unplug is not
called.

VifDriver.unplug must be called in MigrateCommand which hooks VM
migration in source host, because plug will be called in
PrepareForMigration in destination host. But that operation is missing
in current LibvirtComputingResources.

Signed-off-by: Edison Su <sudison@gmail.com>
2012-10-29 11:36:25 -07:00
Hiroaki Kawai
cb9395498f kvm agent NIC unplug will always fail
On kvm computing host, vifdriver.unplug will always fails (throws
LibvirtException) and network cleanup will not be called. This was
because the code first undefine the computing domain, and then tries to
query the destroyed machine definition to fetch NIC information. IMHO,
kvm plugin code rounds LibvirtException too much.

Signed-off-by: Edison Su <sudison@gmail.com>
2012-10-29 11:35:49 -07:00
Alex Huang
f92ce72639 Correct dependency errors 2012-10-24 11:12:40 -07:00
Edison Su
059f605ace add more interfaces 2012-10-22 17:50:51 -07:00
Kelven Yang
5fee891162 merge from master 2012-10-11 17:42:25 -07:00
Wido den Hollander
f4a2298ca9 rbd: Make secret usage names unique for all pools
Since only the cephx user like 'admin' was passed we couldn't define two RBD storage pools
using the cephx user admin, even if they were running on different Ceph clusters.

By adding the monitor hostname and poolname to the secret's usage (which we don't even use) it becomes
unique.
2012-10-10 00:21:14 +02:00
Marcus Sorensen
653889dc4d KVM: removes check for 'snapshot' text in qemu-img --help output
Signed-off-by: Edison Su <sudison@gmail.com>
2012-10-05 17:58:12 -07:00
Edison Su
751d391a32 build kvm-agent.zip 2012-10-02 15:38:34 -07:00
Hugo Trippaers
aa6355ffe6 Updated master to 4.1.0
mvn release:update-versions -DautoVersionSubmodules=true -Dnonoss -P
client,deps,developer  -DdevelopmentVersion=4.1.0-SNAPSHOT
2012-10-01 11:00:55 -07:00
Marcus Sorensen
915babd970 fix kvm traffic labels (guest traffic types on multiple networks don't
work)

Cloudstack seems to let you create guest traffic types on multiple
physical networks. However, when I try this with KVM I end up always
bridging to whatever device is used for guest.network.device. This pulls
the traffic label (NicTO.getName()) and uses that bridge to ensure that
we get on the correct physical network, rather than just always using
the guest.network.device.

This also changes the bridge naming scheme from cloudVirBr + vlanid to
br + physicalinterface + "-" + vlanid. This is because we should be able
to support the same vlan numbers per physical network, and the previous
bridge name would not support this and collide.

Signed-off-by: Edison Su <sudison@gmail.com>
2012-09-26 17:14:57 -07:00
Marcus Sorensen
f0e928461a KVM: Storage Pool collisions on ISOs due to using random UUID on pool
create

The code is unable to detect an existing pool, because we use a random
UUID each time. New Libvirt doesn't allow multiple pools to be defined
to the same storage.  This patch generates a UUID based on the storage
path, so that it can be detected as existing and reused. It also cleans
up no-op code and adjusts the naming of a few things to clean up any
confusion.

Signed-off-by: Edison Su <sudison@gmail.com>
2012-09-26 16:19:06 -07:00
Marcus Sorensen
38a885776c fix /root/.ssh directory creation for KVM
Since /root is r-x permissions, Java fails to mkdir /root/.ssh (even
though the agent is running as root) because it looks for the writable
permission. This patch modifies the 'chmod 700 /root/.ssh' shell command
that we already use into 'mkdir -m 700 /root/.ssh', to be able to create
the directory as root even though write permissions are not set on
/root. This seemed cleaner/safer than adding writable to /root.

Signed-off-by: Edison Su <sudison@gmail.com>
2012-09-26 14:03:12 -07:00
Edison Su
66dc718625 add error log, if adding storage pool failed 2012-09-21 17:54:54 -07:00
Marcus Sorensen
9324e562e5 systemvm.iso not found when KVM launches system vms
Signed-off-by: Edison Su <sudison@gmail.com>
2012-09-20 13:54:41 -07:00
Edison Su
600a45ed39 fix compile error 2012-09-18 19:49:59 -07:00