Skip to content

Commit 99bdc8d

Browse files
committed
Merge branch 'master' into rbac.
2 parents f2d4b4d + 5779292 commit 99bdc8d

305 files changed

Lines changed: 11197 additions & 2893 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

agent/conf/agent.properties

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ domr.scripts.dir=scripts/network/domr/kvm
7070
# In MegaBytes per second
7171
#vm.migrate.speed=0
7272

73+
# set target downtime at end of livemigration, the 'hiccup' for final copy. Higher numbers
74+
# make livemigration easier, lower numbers may cause migration to never complete. Less than 1
75+
# means hypervisor default (20ms).
76+
#vm.migrate.downtime=0
77+
78+
# Busy VMs may never finish migrating, depending on environment. When its available, we will
79+
# want to add support for autoconvergence migration flag which should fix this. Set an upper
80+
# limit in milliseconds for how long live migration should wait, at which point VM is paused and
81+
# migration will finish quickly. Less than 1 means disabled.
82+
#vm.migrate.pauseafter=0
83+
7384
# set the type of bridge used on the hypervisor, this defines what commands the resource
7485
# will use to setup networking. Currently supported NATIVE, OPENVSWITCH
7586
#network.bridge.type=native

agent/distro/centos/SYSCONFDIR/rc.d/init.d/cloud-agent.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
# set environment variables
2828

29-
SHORTNAME="$0"
29+
SHORTNAME=`basename $0`
3030
PIDFILE=@PIDDIR@/"$SHORTNAME".pid
3131
LOCKFILE=@LOCKDIR@/"$SHORTNAME"
3232
LOGFILE=@AGENTLOG@

agent/distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-agent.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
# set environment variables
2828

29-
SHORTNAME="$0"
29+
SHORTNAME=`basename $0`
3030
PIDFILE=@PIDDIR@/"$SHORTNAME".pid
3131
LOCKFILE=@LOCKDIR@/"$SHORTNAME"
3232
LOGFILE=@AGENTLOG@

agent/distro/opensuse/sles/SYSCONFDIR/init.d/cloud-agent.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
# set environment variables
3535

36-
SHORTNAME="$0"
36+
SHORTNAME=`basename $0`
3737
PIDFILE=@PIDDIR@/"$SHORTNAME".pid
3838
LOCKFILE=@LOCKDIR@/"$SHORTNAME"
3939
LOGFILE=@AGENTLOG@

agent/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-agent.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
# set environment variables
2828

29-
SHORTNAME="$0"
29+
SHORTNAME=`basename $0`
3030
PIDFILE=@PIDDIR@/"$SHORTNAME".pid
3131
LOCKFILE=@LOCKDIR@/"$SHORTNAME"
3232
LOGFILE=@AGENTLOG@

agent/distro/sles/SYSCONFDIR/init.d/cloud-agent.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
# set environment variables
3535

36-
SHORTNAME="$0"
36+
SHORTNAME=`basename $0`
3737
PIDFILE=@PIDDIR@/"$SHORTNAME".pid
3838
LOCKFILE=@LOCKDIR@/"$SHORTNAME"
3939
LOGFILE=@AGENTLOG@

api/src/com/cloud/agent/api/HostVmStateReportEntry.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,12 @@ public class HostVmStateReportEntry {
3232
// host name or host uuid
3333
String host;
3434

35-
// XS needs Xen Tools version info
36-
String hostToolsVersion;
37-
3835
public HostVmStateReportEntry() {
3936
}
4037

41-
public HostVmStateReportEntry(PowerState state, String host, String hostToolsVersion) {
38+
public HostVmStateReportEntry(PowerState state, String host) {
4239
this.state = state;
4340
this.host = host;
44-
this.hostToolsVersion = hostToolsVersion;
4541
}
4642

4743
public PowerState getState() {
@@ -51,8 +47,4 @@ public PowerState getState() {
5147
public String getHost() {
5248
return host;
5349
}
54-
55-
public String getHostToolsVersion() {
56-
return hostToolsVersion;
57-
}
5850
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package com.cloud.agent.api.to;
18+
19+
import java.util.HashMap;
20+
21+
public class GPUDeviceTO {
22+
23+
private String gpuGroup;
24+
private String vgpuType;
25+
private HashMap<String, HashMap<String, Long>> groupDetails = new HashMap<String, HashMap<String, Long>>();
26+
27+
public GPUDeviceTO( String gpuGroup, String vgpuType, HashMap<String, HashMap<String, Long>> groupDetails) {
28+
this.gpuGroup = gpuGroup;
29+
this.vgpuType = vgpuType;
30+
this.groupDetails = groupDetails;
31+
}
32+
33+
public String getGpuGroup() {
34+
return gpuGroup;
35+
}
36+
37+
public String getVgpuType() {
38+
return vgpuType;
39+
}
40+
41+
public void setGpuGroup(String gpuGroup) {
42+
this.gpuGroup = gpuGroup;
43+
}
44+
45+
public void setVgpuType(String vgpuType) {
46+
this.vgpuType = vgpuType;
47+
}
48+
49+
public HashMap<String, HashMap<String, Long>> getGroupDetails() {
50+
return groupDetails;
51+
}
52+
53+
public void setGroupDetails(HashMap<String, HashMap<String, Long>> groupDetails) {
54+
this.groupDetails = groupDetails;
55+
}
56+
}

api/src/com/cloud/agent/api/to/VirtualMachineTO.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public class VirtualMachineTO {
6060

6161
DiskTO[] disks;
6262
NicTO[] nics;
63+
GPUDeviceTO gpuDevice;
6364

6465
public VirtualMachineTO(long id, String instanceName, VirtualMachine.Type type, int cpus, Integer speed, long minRam, long maxRam, BootloaderType bootloader,
6566
String os, boolean enableHA, boolean limitCpuUse, String vncPassword) {
@@ -266,4 +267,12 @@ public void setUuid(String uuid) {
266267
this.uuid = uuid;
267268
}
268269

270+
public GPUDeviceTO getGpuDevice() {
271+
return gpuDevice;
272+
}
273+
274+
public void setGpuDevice(GPUDeviceTO gpuDevice) {
275+
this.gpuDevice = gpuDevice;
276+
}
277+
269278
}

api/src/com/cloud/event/EventTypes.java

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
import com.cloud.offering.NetworkOffering;
5151
import com.cloud.offering.ServiceOffering;
5252
import com.cloud.projects.Project;
53+
import com.cloud.storage.GuestOS;
54+
import com.cloud.storage.GuestOSHypervisor;
5355
import com.cloud.storage.Snapshot;
5456
import com.cloud.storage.Volume;
5557
import com.cloud.template.VirtualMachineTemplate;
@@ -440,8 +442,8 @@ public class EventTypes {
440442

441443
public static final String EVENT_HOST_RESERVATION_RELEASE = "HOST.RESERVATION.RELEASE";
442444
// Dedicated guest vlan range
443-
public static final String EVENT_GUEST_VLAN_RANGE_DEDICATE = "GUESTVLANRANGE.DEDICATE";
444-
public static final String EVENT_DEDICATED_GUEST_VLAN_RANGE_RELEASE = "GUESTVLANRANGE.RELEASE";
445+
public static final String EVENT_GUEST_VLAN_RANGE_DEDICATE = "GUESTVLANRANGE.DEDICATE";
446+
public static final String EVENT_DEDICATED_GUEST_VLAN_RANGE_RELEASE = "GUESTVLANRANGE.RELEASE";
445447

446448
public static final String EVENT_PORTABLE_IP_RANGE_CREATE = "PORTABLE.IP.RANGE.CREATE";
447449
public static final String EVENT_PORTABLE_IP_RANGE_DELETE = "PORTABLE.IP.RANGE.DELETE";
@@ -479,10 +481,19 @@ public class EventTypes {
479481
public static final String EVENT_EXTERNAL_OPENDAYLIGHT_DELETE_CONTROLLER = "PHYSICAL.ODLCONTROLLER.DELETE";
480482
public static final String EVENT_EXTERNAL_OPENDAYLIGHT_CONFIGURE_CONTROLLER = "PHYSICAL.ODLCONTROLLER.CONFIGURE";
481483

484+
//Guest OS related events
485+
public static final String EVENT_GUEST_OS_ADD = "GUEST.OS.ADD";
486+
public static final String EVENT_GUEST_OS_REMOVE = "GUEST.OS.REMOVE";
487+
public static final String EVENT_GUEST_OS_UPDATE = "GUEST.OS.UPDATE";
488+
public static final String EVENT_GUEST_OS_MAPPING_ADD = "GUEST.OS.MAPPING.ADD";
489+
public static final String EVENT_GUEST_OS_MAPPING_REMOVE = "GUEST.OS.MAPPING.REMOVE";
490+
public static final String EVENT_GUEST_OS_MAPPING_UPDATE = "GUEST.OS.MAPPING.UPDATE";
491+
482492
static {
483493

484494
// TODO: need a way to force author adding event types to declare the entity details as well, with out braking
485495
// current ActionEvent annotation semantics
496+
// TODO #2 - The map should be from event type to class.
486497

487498
entityEventDetails = new HashMap<String, String>();
488499

@@ -493,10 +504,13 @@ public class EventTypes {
493504
entityEventDetails.put(EVENT_VM_REBOOT, VirtualMachine.class.getName());
494505
entityEventDetails.put(EVENT_VM_UPDATE, VirtualMachine.class.getName());
495506
entityEventDetails.put(EVENT_VM_UPGRADE, VirtualMachine.class.getName());
507+
entityEventDetails.put(EVENT_VM_DYNAMIC_SCALE, VirtualMachine.class.getName());
496508
entityEventDetails.put(EVENT_VM_RESETPASSWORD, VirtualMachine.class.getName());
509+
entityEventDetails.put(EVENT_VM_RESETSSHKEY, VirtualMachine.class.getName());
497510
entityEventDetails.put(EVENT_VM_MIGRATE, VirtualMachine.class.getName());
498511
entityEventDetails.put(EVENT_VM_MOVE, VirtualMachine.class.getName());
499512
entityEventDetails.put(EVENT_VM_RESTORE, VirtualMachine.class.getName());
513+
entityEventDetails.put(EVENT_VM_EXPUNGE, VirtualMachine.class.getName());
500514

501515
entityEventDetails.put(EVENT_ROUTER_CREATE, VirtualRouter.class.getName());
502516
entityEventDetails.put(EVENT_ROUTER_DESTROY, VirtualRouter.class.getName());
@@ -544,9 +558,11 @@ public class EventTypes {
544558
entityEventDetails.put(EVENT_LB_CERT_REMOVE, LoadBalancer.class.getName());
545559

546560
// Account events
561+
entityEventDetails.put(EVENT_ACCOUNT_ENABLE, Account.class.getName());
547562
entityEventDetails.put(EVENT_ACCOUNT_DISABLE, Account.class.getName());
548563
entityEventDetails.put(EVENT_ACCOUNT_CREATE, Account.class.getName());
549564
entityEventDetails.put(EVENT_ACCOUNT_DELETE, Account.class.getName());
565+
entityEventDetails.put(EVENT_ACCOUNT_UPDATE, Account.class.getName());
550566
entityEventDetails.put(EVENT_ACCOUNT_MARK_DEFAULT_ZONE, Account.class.getName());
551567

552568
// UserVO Events
@@ -661,13 +677,13 @@ public class EventTypes {
661677
entityEventDetails.put(EVENT_SECURITY_GROUP_REMOVE, SecurityGroup.class.getName());
662678

663679
// Host
664-
entityEventDetails.put(EVENT_HOST_RECONNECT, Host.class.getName());
680+
entityEventDetails.put(EVENT_HOST_RECONNECT, Host.class.getName());
665681

666682
// Maintenance
667-
entityEventDetails.put(EVENT_MAINTENANCE_CANCEL, Host.class.getName());
668-
entityEventDetails.put(EVENT_MAINTENANCE_CANCEL_PRIMARY_STORAGE, Host.class.getName());
669-
entityEventDetails.put(EVENT_MAINTENANCE_PREPARE, Host.class.getName());
670-
entityEventDetails.put(EVENT_MAINTENANCE_PREPARE_PRIMARY_STORAGE, Host.class.getName());
683+
entityEventDetails.put(EVENT_MAINTENANCE_CANCEL, Host.class.getName());
684+
entityEventDetails.put(EVENT_MAINTENANCE_CANCEL_PRIMARY_STORAGE, Host.class.getName());
685+
entityEventDetails.put(EVENT_MAINTENANCE_PREPARE, Host.class.getName());
686+
entityEventDetails.put(EVENT_MAINTENANCE_PREPARE_PRIMARY_STORAGE, Host.class.getName());
671687

672688
// VPN
673689
entityEventDetails.put(EVENT_REMOTE_ACCESS_VPN_CREATE, RemoteAccessVpn.class.getName());
@@ -762,8 +778,8 @@ public class EventTypes {
762778
entityEventDetails.put(EVENT_TAGS_DELETE, "tag");
763779

764780
// external network device events
765-
entityEventDetails.put(EVENT_EXTERNAL_NVP_CONTROLLER_ADD, "NvpController");
766-
entityEventDetails.put(EVENT_EXTERNAL_NVP_CONTROLLER_DELETE, "NvpController");
781+
entityEventDetails.put(EVENT_EXTERNAL_NVP_CONTROLLER_ADD, "NvpController");
782+
entityEventDetails.put(EVENT_EXTERNAL_NVP_CONTROLLER_DELETE, "NvpController");
767783
entityEventDetails.put(EVENT_EXTERNAL_NVP_CONTROLLER_CONFIGURE, "NvpController");
768784

769785
// AutoScale
@@ -789,6 +805,14 @@ public class EventTypes {
789805
entityEventDetails.put(EVENT_EXTERNAL_OPENDAYLIGHT_ADD_CONTROLLER, "OpenDaylightController");
790806
entityEventDetails.put(EVENT_EXTERNAL_OPENDAYLIGHT_DELETE_CONTROLLER, "OpenDaylightController");
791807
entityEventDetails.put(EVENT_EXTERNAL_OPENDAYLIGHT_CONFIGURE_CONTROLLER, "OpenDaylightController");
808+
809+
//Guest OS
810+
entityEventDetails.put(EVENT_GUEST_OS_ADD, GuestOS.class.getName());
811+
entityEventDetails.put(EVENT_GUEST_OS_REMOVE, GuestOS.class.getName());
812+
entityEventDetails.put(EVENT_GUEST_OS_UPDATE, GuestOS.class.getName());
813+
entityEventDetails.put(EVENT_GUEST_OS_MAPPING_ADD, GuestOSHypervisor.class.getName());
814+
entityEventDetails.put(EVENT_GUEST_OS_MAPPING_REMOVE, GuestOSHypervisor.class.getName());
815+
entityEventDetails.put(EVENT_GUEST_OS_MAPPING_UPDATE, GuestOSHypervisor.class.getName());
792816
}
793817

794818
public static String getEntityForEvent(String eventName) {

0 commit comments

Comments
 (0)