Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import com.cloud.vm.VirtualMachineProfile;

public interface UserDataServiceProvider extends NetworkElement {
public boolean addPasswordAndUserdata(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context)
boolean addPasswordAndUserdata(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context)
throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException;

boolean savePassword(Network network, NicProfile nic, VirtualMachineProfile vm) throws ResourceUnavailableException;
Expand Down
5 changes: 5 additions & 0 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@
<artifactId>cloud-engine-storage-cache</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-engine-storage-configdrive</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-controller-secondary-storage</artifactId>
Expand Down
40 changes: 11 additions & 29 deletions core/src/com/cloud/agent/api/HandleConfigDriveIsoCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,60 +19,42 @@

package com.cloud.agent.api;

import java.util.List;

import com.cloud.agent.api.to.DataStoreTO;

public class HandleConfigDriveIsoCommand extends Command {

String isoFile;
List<String[]> vmData;
String configDriveLabel;
boolean create = false;
private boolean update = false;
private DataStoreTO destStore;

public HandleConfigDriveIsoCommand(List<String[]> vmData, String label, DataStoreTO destStore, String isoFile, boolean create, boolean update) {
this.vmData = vmData;
this.configDriveLabel = label;
this.create = create;
this.update = update;
this.destStore = destStore;
@LogLevel(LogLevel.Log4jLevel.Off)
private String isoData;

private String isoFile;
private boolean create = false;
private DataStoreTO destStore;

public HandleConfigDriveIsoCommand(String isoFile, String isoData, DataStoreTO destStore, boolean create) {
this.isoFile = isoFile;
this.isoData = isoData;
this.destStore = destStore;
this.create = create;
}

@Override
public boolean executeInSequence() {
return false;
}

public List<String[]> getVmData() {
return vmData;
}

public void setVmData(List<String[]> vmData) {
this.vmData = vmData;
public String getIsoData() {
return isoData;
}

public boolean isCreate() {
return create;
}

public String getConfigDriveLabel() {
return configDriveLabel;
}

public DataStoreTO getDestStore() {
return destStore;
}

public String getIsoFile() {
return isoFile;
}

public boolean isUpdate() {
return update;
}
}
11 changes: 7 additions & 4 deletions engine/api/src/com/cloud/vm/VirtualMachineManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@
*/
public interface VirtualMachineManager extends Manager {

static final ConfigKey<Boolean> ExecuteInSequence = new ConfigKey<Boolean>("Advanced", Boolean.class, "execute.in.sequence.hypervisor.commands", "false",
ConfigKey<Boolean> ExecuteInSequence = new ConfigKey<>("Advanced", Boolean.class, "execute.in.sequence.hypervisor.commands", "false",
"If set to true, start, stop, reboot, copy and migrate commands will be serialized on the agent side. If set to false the commands are executed in parallel. Default value is false.", false);

static final ConfigKey<String> VmConfigDriveLabel = new ConfigKey<String>("Hidden", String.class, "vm.configdrive.label", "config-2",
ConfigKey<String> VmConfigDriveLabel = new ConfigKey<>("Hidden", String.class, "vm.configdrive.label", "config-2",
"The default label name for the config drive", false);

public interface Topics {
public static final String VM_POWER_STATE = "vm.powerstate";
ConfigKey<Boolean> VmConfigDriveOnPrimaryPool = new ConfigKey<>("Advanced", Boolean.class, "vm.configdrive.primarypool.enabled", "false",
"If config drive need to be created and hosted on primary storage pool. Currently only supported for KVM.", true);

interface Topics {
String VM_POWER_STATE = "vm.powerstate";
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1108,10 +1108,11 @@ public void orchestrateStart(final String vmUuid, final Map<VirtualMachineProfil
}

try {
_networkMgr.prepare(vmProfile, new DeployDestination(dest.getDataCenter(), dest.getPod(), null, null), ctx);
_networkMgr.prepare(vmProfile, new DeployDestination(dest.getDataCenter(), dest.getPod(), null, null, dest.getStorageForDisks()), ctx);
if (vm.getHypervisorType() != HypervisorType.BareMetal) {
volumeMgr.prepare(vmProfile, dest);
}

//since StorageMgr succeeded in volume creation, reuse Volume for further tries until current cluster has capacity
if (!reuseVolume) {
reuseVolume = true;
Expand Down Expand Up @@ -4018,7 +4019,7 @@ public String getConfigComponentName() {
public ConfigKey<?>[] getConfigKeys() {
return new ConfigKey<?>[] {ClusterDeltaSyncInterval, StartRetry, VmDestroyForcestop, VmOpCancelInterval, VmOpCleanupInterval, VmOpCleanupWait,
VmOpLockStateRetry,
VmOpWaitInterval, ExecuteInSequence, VmJobCheckInterval, VmJobTimeout, VmJobStateReportInterval, VmConfigDriveLabel, HaVmRestartHostUp};
VmOpWaitInterval, ExecuteInSequence, VmJobCheckInterval, VmJobTimeout, VmJobStateReportInterval, VmConfigDriveLabel, VmConfigDriveOnPrimaryPool, HaVmRestartHostUp};
}

public List<StoragePoolAllocator> getStoragePoolAllocators() {
Expand Down
1 change: 1 addition & 0 deletions engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<module>storage/datamotion</module>
<module>storage/cache</module>
<module>storage/snapshot</module>
<module>storage/configdrive</module>
<module>components-api</module>
<module>network</module>
<module>service</module>
Expand Down
43 changes: 43 additions & 0 deletions engine/storage/configdrive/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cloud-engine-storage-configdrive</artifactId>
<name>Apache CloudStack Framework - Storage Config Drive Component</name>
<parent>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-engine</artifactId>
<version>4.11.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<dependencies>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-core</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

package org.apache.cloudstack.storage.configdrive;

public class ConfigDrive {

public final static String CONFIGDRIVEFILENAME = "configdrive.iso";
public final static String CONFIGDRIVEDIR = "configdrive";

public static final String cloudStackConfigDriveName = "/cloudstack/";
public static final String openStackConfigDriveName = "/openstack/latest/";

/**
* This is the path to iso file relative to mount point
* @return config drive iso file path
*/
public static String createConfigDrivePath(final String instanceName) {
return ConfigDrive.CONFIGDRIVEDIR + "/" + instanceName + "/" + ConfigDrive.CONFIGDRIVEFILENAME;
}

}
Loading