mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 10:02:27 +01:00
fix attach volume for kvm
This commit is contained in:
parent
1e21b0b0e8
commit
4e4112fcec
@ -156,6 +156,7 @@
|
||||
<argument>${basedir}/target/db/cloudbridge_offering_alter.sql</argument>
|
||||
<!-- Seed the database -->
|
||||
<argument>${basedir}/developer-prefill.sql</argument>
|
||||
<argument>${basedir}/developer-prefill.sql.override</argument>
|
||||
<!-- Do database upgrade-->
|
||||
<argument>com.cloud.upgrade.DatabaseUpgradeChecker</argument>
|
||||
<argument>--database=cloud,usage,awsapi</argument>
|
||||
@ -232,4 +233,4 @@
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@ -147,6 +147,13 @@ public class DatabaseCreator {
|
||||
databases = arg.substring(arg.lastIndexOf("=") + 1, arg.length()).split(",");
|
||||
} else if (arg.endsWith(".sql")) {
|
||||
sqlFiles.add(arg);
|
||||
} else if (arg.endsWith(".sql.override")) {
|
||||
if (fileExists(arg)) {
|
||||
int index = arg.lastIndexOf(".override");
|
||||
String fileToOverride = arg.substring(0, index);
|
||||
sqlFiles.remove(fileToOverride);
|
||||
sqlFiles.add(arg);
|
||||
}
|
||||
} else if (arg.endsWith(".properties")) {
|
||||
if (!dbPropsFile.endsWith("properties.override") && fileExists(arg))
|
||||
dbPropsFile = arg;
|
||||
|
||||
@ -680,7 +680,7 @@ public class KVMStorageProcessor implements StorageProcessor {
|
||||
DiskTO disk = cmd.getDisk();
|
||||
VolumeObjectTO vol = (VolumeObjectTO)disk.getData();
|
||||
PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO)vol.getDataStore();
|
||||
String vmName = vol.getVmName();
|
||||
String vmName = cmd.getVmName();
|
||||
try {
|
||||
Connect conn = LibvirtConnection.getConnectionByVmName(vmName);
|
||||
KVMStoragePool primary = storagePoolMgr.getStoragePool(
|
||||
@ -714,7 +714,7 @@ public class KVMStorageProcessor implements StorageProcessor {
|
||||
DiskTO disk = cmd.getDisk();
|
||||
VolumeObjectTO vol = (VolumeObjectTO)disk.getData();
|
||||
PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO)vol.getDataStore();
|
||||
String vmName = vol.getVmName();
|
||||
String vmName = cmd.getVmName();
|
||||
try {
|
||||
Connect conn = LibvirtConnection.getConnectionByVmName(vmName);
|
||||
KVMStoragePool primary = storagePoolMgr.getStoragePool(
|
||||
|
||||
@ -224,9 +224,20 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
|
||||
}
|
||||
|
||||
String hostIpAdr = NetUtils.getDefaultHostIp();
|
||||
boolean needUpdateHostIp = true;
|
||||
if (hostIpAdr != null) {
|
||||
_configDao.update(Config.ManagementHostIPAdr.key(), Config.ManagementHostIPAdr.getCategory(), hostIpAdr);
|
||||
s_logger.debug("ConfigurationServer saved \"" + hostIpAdr + "\" as host.");
|
||||
Boolean devel = Boolean.valueOf(_configDao.getValue("developer"));
|
||||
if (devel) {
|
||||
String value = _configDao.getValue(Config.ManagementHostIPAdr.key());
|
||||
if (value != null) {
|
||||
needUpdateHostIp = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (needUpdateHostIp) {
|
||||
_configDao.update(Config.ManagementHostIPAdr.key(), Config.ManagementHostIPAdr.getCategory(), hostIpAdr);
|
||||
s_logger.debug("ConfigurationServer saved \"" + hostIpAdr + "\" as host.");
|
||||
}
|
||||
}
|
||||
|
||||
// generate a single sign-on key
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user