Skip to content

Commit e771ca0

Browse files
Merge branch '4.22' into 4.22-fix-cks-vpc-network
2 parents f9a5a25 + 516012a commit e771ca0

File tree

59 files changed

+751
-404
lines changed

Some content is hidden

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

59 files changed

+751
-404
lines changed

agent/conf/uefi.properties.in

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
18+
# Configuration file for UEFI
19+
20+
guest.nvram.template.legacy=@GUESTNVRAMTEMPLATELEGACY@
21+
guest.loader.legacy=@GUESTLOADERLEGACY@
22+
guest.nvram.template.secure=@GUESTNVRAMTEMPLATESECURE@
23+
guest.loader.secure=@GUESTLOADERSECURE@
24+
guest.nvram.path=@GUESTNVRAMPATH@

api/src/main/java/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ public void execute() {
153153
if (ObjectUtils.anyNotNull(name, capacityIops, capacityBytes, url, isTagARule, tags) ||
154154
MapUtils.isNotEmpty(details)) {
155155
result = _storageService.updateStoragePool(this);
156+
} else {
157+
result = _storageService.getStoragePool(getId());
156158
}
157159

158160
if (enabled != null) {

api/src/main/java/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class ListPublicIpAddressesCmd extends BaseListRetrieveOnlyResourceCountC
5353
@Parameter(name = ApiConstants.ALLOCATED_ONLY, type = CommandType.BOOLEAN, description = "limits search results to allocated public IP addresses")
5454
private Boolean allocatedOnly;
5555

56-
@Parameter(name = ApiConstants.STATE, type = CommandType.STRING, description = "lists all public IP addresses by state")
56+
@Parameter(name = ApiConstants.STATE, type = CommandType.STRING, description = "lists all public IP addresses by state. A comma-separated list of states can be passed")
5757
private String state;
5858

5959
@Parameter(name = ApiConstants.FOR_VIRTUAL_NETWORK, type = CommandType.BOOLEAN, description = "the virtual network for the IP address")

debian/cloudstack-agent.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# under the License.
1717

1818
/etc/cloudstack/agent/agent.properties
19+
/etc/cloudstack/agent/uefi.properties
1920
/etc/cloudstack/agent/environment.properties
2021
/etc/cloudstack/agent/log4j-cloud.xml
2122
/etc/default/cloudstack-agent

debian/cloudstack-agent.postinst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ case "$1" in
2323
configure)
2424
OLDCONFDIR="/etc/cloud/agent"
2525
NEWCONFDIR="/etc/cloudstack/agent"
26-
CONFFILES="agent.properties log4j.xml log4j-cloud.xml"
26+
CONFFILES="agent.properties uefi.properties log4j.xml log4j-cloud.xml"
2727

2828
mkdir -m 0755 -p /usr/share/cloudstack-agent/tmp
2929

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Description: CloudStack server library
2424

2525
Package: cloudstack-agent
2626
Architecture: all
27-
Depends: ${python:Depends}, ${python3:Depends}, openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), lsb-base (>= 9), openssh-client, qemu-kvm (>= 2.5) | qemu-system-x86 (>= 5.2), libvirt-bin (>= 1.3) | libvirt-daemon-system (>= 3.0), iproute2, ebtables, vlan, ipset, python3-libvirt, ethtool, iptables, cryptsetup, rng-tools, rsync, lsb-release, ufw, apparmor, cpu-checker, libvirt-daemon-driver-storage-rbd, sysstat
27+
Depends: ${python:Depends}, ${python3:Depends}, openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), lsb-base (>= 9), openssh-client, qemu-kvm (>= 2.5) | qemu-system-x86 (>= 5.2), libvirt-bin (>= 1.3) | libvirt-daemon-system (>= 3.0), iproute2, ebtables, vlan, ipset, python3-libvirt, ethtool, iptables, cryptsetup, rng-tools, rsync, ovmf, swtpm, lsb-release, ufw, apparmor, cpu-checker, libvirt-daemon-driver-storage-rbd, sysstat
2828
Recommends: init-system-helpers
2929
Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts
3030
Description: CloudStack agent

engine/components-api/src/main/java/com/cloud/event/UsageEventUtils.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ public static void publishUsageEvent(String usageType, long accountId, long zone
9494

9595
}
9696

97+
public static void publishUsageEvent(String usageType, long accountId, long zoneId, long resourceId, String resourceName, Long offeringId, Long templateId,
98+
Long size, String entityType, String entityUUID, Long vmId, boolean displayResource) {
99+
if (displayResource) {
100+
saveUsageEvent(usageType, accountId, zoneId, resourceId, offeringId, templateId, size, vmId, resourceName);
101+
}
102+
publishUsageEvent(usageType, accountId, zoneId, entityType, entityUUID);
103+
}
104+
97105
public static void publishUsageEvent(String usageType, long accountId, long zoneId, long resourceId, String resourceName, Long offeringId, Long templateId,
98106
Long size, Long virtualSize, String entityType, String entityUUID, Map<String, String> details) {
99107
saveUsageEvent(usageType, accountId, zoneId, resourceId, resourceName, offeringId, templateId, size, virtualSize, details);
@@ -202,6 +210,10 @@ public static void saveUsageEvent(String usageType, long accountId, long zoneId,
202210
s_usageEventDao.persist(new UsageEventVO(usageType, accountId, zoneId, vmId, securityGroupId));
203211
}
204212

213+
public static void saveUsageEvent(String usageType, long accountId, long zoneId, long resourceId, Long offeringId, Long templateId, Long size, Long vmId, String resourceName) {
214+
s_usageEventDao.persist(new UsageEventVO(usageType, accountId, zoneId, resourceId, offeringId, templateId, size, vmId, resourceName));
215+
}
216+
205217
private static void publishUsageEvent(String usageEventType, Long accountId, Long zoneId, String resourceType, String resourceUUID) {
206218
String configKey = "publish.usage.events";
207219
String value = s_configDao.getValue(configKey);

engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ public DiskProfile allocateRawVolume(Type type, String name, DiskOffering offeri
903903
// Save usage event and update resource count for user vm volumes
904904
if (vm.getType() == VirtualMachine.Type.User) {
905905
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, vol.getAccountId(), vol.getDataCenterId(), vol.getId(), vol.getName(), offering.getId(), null, size,
906-
Volume.class.getName(), vol.getUuid(), vol.isDisplayVolume());
906+
Volume.class.getName(), vol.getUuid(), vol.getInstanceId(), vol.isDisplayVolume());
907907
_resourceLimitMgr.incrementVolumeResourceCount(vm.getAccountId(), vol.isDisplayVolume(), vol.getSize(), offering);
908908
}
909909
DiskProfile diskProfile = toDiskProfile(vol, offering);
@@ -981,7 +981,7 @@ private DiskProfile allocateTemplatedVolume(Type type, String name, DiskOffering
981981
}
982982

983983
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, vol.getAccountId(), vol.getDataCenterId(), vol.getId(), vol.getName(), offeringId, vol.getTemplateId(), size,
984-
Volume.class.getName(), vol.getUuid(), vol.isDisplayVolume());
984+
Volume.class.getName(), vol.getUuid(), vol.getInstanceId(), vol.isDisplayVolume());
985985

986986
_resourceLimitMgr.incrementVolumeResourceCount(vm.getAccountId(), vol.isDisplayVolume(), vol.getSize(), offering);
987987
}

engine/schema/src/main/java/com/cloud/event/UsageEventVO.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ public enum DynamicParameters {
7575
@Column(name = "virtual_size")
7676
private Long virtualSize;
7777

78+
@Column(name = "vm_id")
79+
private Long vmId;
80+
7881
public UsageEventVO() {
7982
}
8083

@@ -143,6 +146,18 @@ public UsageEventVO(String usageType, long accountId, long zoneId, long vmId, lo
143146
this.offeringId = securityGroupId;
144147
}
145148

149+
public UsageEventVO(String usageType, long accountId, long zoneId, long resourceId, Long offeringId, Long templateId, Long size, Long vmId, String resourceName) {
150+
this.type = usageType;
151+
this.accountId = accountId;
152+
this.zoneId = zoneId;
153+
this.resourceId = resourceId;
154+
this.offeringId = offeringId;
155+
this.templateId = templateId;
156+
this.size = size;
157+
this.vmId = vmId;
158+
this.resourceName = resourceName;
159+
}
160+
146161
@Override
147162
public long getId() {
148163
return id;
@@ -248,4 +263,11 @@ public void setVirtualSize(Long virtualSize) {
248263
this.virtualSize = virtualSize;
249264
}
250265

266+
public Long getVmId() {
267+
return vmId;
268+
}
269+
270+
public void setVmId(Long vmId) {
271+
this.vmId = vmId;
272+
}
251273
}

engine/schema/src/main/java/com/cloud/event/dao/UsageEventDaoImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
4545
private final SearchBuilder<UsageEventVO> latestEventsSearch;
4646
private final SearchBuilder<UsageEventVO> IpeventsSearch;
4747
private static final String COPY_EVENTS =
48-
"INSERT INTO cloud_usage.usage_event (id, type, account_id, created, zone_id, resource_id, resource_name, offering_id, template_id, size, resource_type, virtual_size) "
49-
+ "SELECT id, type, account_id, created, zone_id, resource_id, resource_name, offering_id, template_id, size, resource_type, virtual_size FROM cloud.usage_event vmevt WHERE vmevt.id > ? and vmevt.id <= ? ";
48+
"INSERT INTO cloud_usage.usage_event (id, type, account_id, created, zone_id, resource_id, resource_name, offering_id, template_id, size, resource_type, virtual_size, vm_id) "
49+
+ "SELECT id, type, account_id, created, zone_id, resource_id, resource_name, offering_id, template_id, size, resource_type, virtual_size, vm_id FROM cloud.usage_event vmevt WHERE vmevt.id > ? and vmevt.id <= ? ";
5050
private static final String COPY_ALL_EVENTS =
51-
"INSERT INTO cloud_usage.usage_event (id, type, account_id, created, zone_id, resource_id, resource_name, offering_id, template_id, size, resource_type, virtual_size) "
52-
+ "SELECT id, type, account_id, created, zone_id, resource_id, resource_name, offering_id, template_id, size, resource_type, virtual_size FROM cloud.usage_event vmevt WHERE vmevt.id <= ?";
51+
"INSERT INTO cloud_usage.usage_event (id, type, account_id, created, zone_id, resource_id, resource_name, offering_id, template_id, size, resource_type, virtual_size, vm_id) "
52+
+ "SELECT id, type, account_id, created, zone_id, resource_id, resource_name, offering_id, template_id, size, resource_type, virtual_size, vm_id FROM cloud.usage_event vmevt WHERE vmevt.id <= ?";
5353
private static final String COPY_EVENT_DETAILS = "INSERT INTO cloud_usage.usage_event_details (id, usage_event_id, name, value) "
5454
+ "SELECT id, usage_event_id, name, value FROM cloud.usage_event_details vmevtDetails WHERE vmevtDetails.usage_event_id > ? and vmevtDetails.usage_event_id <= ? ";
5555
private static final String COPY_ALL_EVENT_DETAILS = "INSERT INTO cloud_usage.usage_event_details (id, usage_event_id, name, value) "

0 commit comments

Comments
 (0)