You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ah...@apache.org on 2013/06/25 01:52:11 UTC
[35/50] [abbrv] merge is complete
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7b7db056/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/vm/UserVmManagerImpl.java
index 52580b6,66103fb..ae96297
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@@ -58,15 -59,16 +58,18 @@@ import org.apache.cloudstack.api.comman
import org.apache.cloudstack.api.command.user.vm.UpgradeVMCmd;
import org.apache.cloudstack.api.command.user.vmgroup.CreateVMGroupCmd;
import org.apache.cloudstack.api.command.user.vmgroup.DeleteVMGroupCmd;
+import org.apache.cloudstack.context.CallContext;
import org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntity;
import org.apache.cloudstack.engine.service.api.OrchestrationService;
+ import org.apache.cloudstack.engine.subsystem.api.storage.TemplateDataFactory;
+ import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
+import org.apache.cloudstack.framework.jobs.Outcome;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
+ import org.apache.cloudstack.storage.to.TemplateObjectTO;
import com.cloud.agent.AgentManager;
-import com.cloud.agent.AgentManager.OnError;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.GetVmDiskStatsAnswer;
import com.cloud.agent.api.GetVmDiskStatsCommand;
@@@ -75,11 -77,15 +78,11 @@@ import com.cloud.agent.api.GetVmStatsCo
import com.cloud.agent.api.PvlanSetupCommand;
import com.cloud.agent.api.StartAnswer;
import com.cloud.agent.api.StopAnswer;
-import com.cloud.agent.api.UnPlugNicAnswer;
-import com.cloud.agent.api.UnPlugNicCommand;
import com.cloud.agent.api.VmDiskStatsEntry;
import com.cloud.agent.api.VmStatsEntry;
+ import com.cloud.agent.api.to.DiskTO;
import com.cloud.agent.api.to.NicTO;
import com.cloud.agent.api.to.VirtualMachineTO;
- import com.cloud.agent.api.to.VolumeTO;
import com.cloud.agent.manager.Commands;
import com.cloud.alert.AlertManager;
import com.cloud.api.ApiDBUtils;
@@@ -1702,7 -1708,8 +1700,8 @@@ public class UserVmManagerImpl extends
Long id = cmd.getId();
Long osTypeId = cmd.getOsTypeId();
String userData = cmd.getUserData();
+ Account caller = CallContext.current().getCallingAccount();
+ Boolean isDynamicallyScalable = cmd.isDynamicallyScalable();
- Account caller = UserContext.current().getCaller();
// Input validation
UserVmVO vmInstance = null;
@@@ -2869,30 -2893,11 +2885,11 @@@
vm.setDetails(details);
if (vm.getIsoId() != null) {
- String isoPath = null;
-
- VirtualMachineTemplate template = _templateDao.findById(vm
- .getIsoId());
- if (template == null || template.getFormat() != ImageFormat.ISO) {
- throw new CloudRuntimeException(
- "Can not find ISO in vm_template table for id "
- + vm.getIsoId());
- }
-
- Pair<String, String> isoPathPair = templateMgr.getAbsoluteIsoPath(
- template.getId(), vm.getDataCenterId());
-
- if (template.getTemplateType() == TemplateType.PERHOST) {
- isoPath = template.getName();
- } else {
- if (isoPathPair == null) {
- s_logger.warn("Couldn't get absolute iso path");
- return false;
- } else {
- isoPath = isoPathPair.first();
- TemplateInfo template = this.templateMgr.prepareIso(vm.getIsoId(), vm.getDataCenterId());
++ TemplateInfo template = templateMgr.prepareIso(vm.getIsoId(), vm.getDataCenterId());
+ if (template == null){
+ s_logger.error("Failed to prepare ISO on secondary or cache storage");
+ throw new CloudRuntimeException("Failed to prepare ISO on secondary or cache storage");
- }
+ }
- }
-
if (template.isBootable()) {
profile.setBootLoaderType(BootloaderType.CD);
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7b7db056/server/test/com/cloud/agent/MockAgentManagerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7b7db056/server/test/com/cloud/async/TestAsyncJobManager.java
----------------------------------------------------------------------
diff --cc server/test/com/cloud/async/TestAsyncJobManager.java
index 6b4788b,e323393..8e27247
--- a/server/test/com/cloud/async/TestAsyncJobManager.java
+++ b/server/test/com/cloud/async/TestAsyncJobManager.java
@@@ -223,24 -157,96 +223,24 @@@ public class TestAsyncJobManager extend
}
}
});
-
- t1.start();
- t2.start();
-
- try {
- t1.join();
- t2.join();
- } catch (InterruptedException e) {
- }
- }
- */
-
- private long getRandomLockId() {
- return 1L;
-
- /*
- * will use in the future test cases
- int i = new Random().nextInt();
- if(i % 2 == 0)
- return 1L;
- return 2L;
- */
- }
-
- public void tstLocking() {
-
- int testThreads = 20;
- Thread[] threads = new Thread[testThreads];
-
- for(int i = 0; i < testThreads; i++) {
- final int current = i;
- threads[i] = new Thread(new Runnable() {
- @Override
- public void run() {
-
- final HostDao hostDao = new HostDaoImpl();
- while(true) {
- Transaction txn = Transaction.currentTxn();
- try {
- HostVO host = hostDao.acquireInLockTable(getRandomLockId(), 10);
- if(host != null) {
- s_logger.info("Thread " + (current + 1) + " acquired lock");
-
- try { Thread.sleep(1000); } catch (InterruptedException e) {}
-
- s_logger.info("Thread " + (current + 1) + " released lock");
- hostDao.releaseFromLockTable(host.getId());
-
- try { Thread.sleep(1000); } catch (InterruptedException e) {}
- } else {
- s_logger.info("Thread " + (current + 1) + " is not able to acquire lock");
- }
- } finally {
- txn.close();
- }
- }
- }
- });
- threads[i].start();
- }
-
- try {
- for(int i = 0; i < testThreads; i++)
- threads[i].join();
- } catch(InterruptedException e) {
- }
- }
-
- public void testDomain() {
- DomainDao domainDao = new DomainDaoImpl();
-
- DomainVO domain1 = new DomainVO("d1", 2L, 1L, null, 1);
- domainDao.create(domain1);
-
- DomainVO domain2 = new DomainVO("d2", 2L, 1L, null, 1);
- domainDao.create(domain2);
-
- DomainVO domain3 = new DomainVO("d3", 2L, 1L, null, 1);
- domainDao.create(domain3);
-
- DomainVO domain11 = new DomainVO("d11", 2L, domain1.getId(), null, 1);
- domainDao.create(domain11);
-
- domainDao.remove(domain11.getId());
-
- DomainVO domain12 = new DomainVO("d12", 2L, domain1.getId(), null, 1);
- domainDao.create(domain12);
-
- domainDao.remove(domain3.getId());
- DomainVO domain4 = new DomainVO("d4", 2L, 1L, null, 1);
- domainDao.create(domain4);
+ thread.start();
+
+ jobMonitor.registerActiveTask(1, 1);
+
- asyncMgr.waitAndCheck(new String[] {"VM"}, 5000L, 10000L, new Predicate() {
++ asyncMgr.waitAndCheck(new AsyncJobVO(), new String[] {"VM"}, 5000L, 10000L, new Predicate() {
+ @Override
+ public boolean checkCondition() {
+ System.out.println("Check condition to exit");
+ messageBus.publish(null, AsyncJob.Topics.JOB_HEARTBEAT, PublishScope.LOCAL, 1L);
+ return false;
+ }
+ });
+
+ jobMonitor.unregisterActiveTask(1);
+
+ try {
+ thread.join();
+ } catch(InterruptedException e) {
+ }
}
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7b7db056/server/test/com/cloud/network/DedicateGuestVlanRangesTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7b7db056/server/test/com/cloud/vm/VmWorkMockVirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --cc server/test/com/cloud/vm/VmWorkMockVirtualMachineManagerImpl.java
index d4ded07,0000000..cc6b906
mode 100644,000000..100644
--- a/server/test/com/cloud/vm/VmWorkMockVirtualMachineManagerImpl.java
+++ b/server/test/com/cloud/vm/VmWorkMockVirtualMachineManagerImpl.java
@@@ -1,327 -1,0 +1,325 @@@
+// 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 com.cloud.vm;
+
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.framework.jobs.AsyncJobExecutionContext;
+import org.apache.cloudstack.framework.jobs.Outcome;
+import org.apache.cloudstack.framework.messagebus.MessageBus;
+import org.apache.cloudstack.jobs.JobInfo;
+
+import com.cloud.agent.api.to.NicTO;
+import com.cloud.agent.api.to.VirtualMachineTO;
+import com.cloud.deploy.DeployDestination;
+import com.cloud.deploy.DeploymentPlan;
+import com.cloud.exception.AgentUnavailableException;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InsufficientServerCapacityException;
+import com.cloud.exception.ManagementServerException;
+import com.cloud.exception.OperationTimedoutException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.exception.VirtualMachineMigrationException;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.network.Network;
+import com.cloud.network.dao.NetworkVO;
+import com.cloud.offering.ServiceOffering;
+import com.cloud.service.ServiceOfferingVO;
+import com.cloud.storage.DiskOfferingVO;
+import com.cloud.storage.StoragePool;
+import com.cloud.storage.VMTemplateVO;
+import com.cloud.storage.Volume;
+import com.cloud.user.Account;
+import com.cloud.utils.Pair;
+import com.cloud.utils.fsm.NoTransitionException;
+import com.cloud.vm.VirtualMachine.Event;
+import com.cloud.vm.VirtualMachine.Type;
+import com.cloud.vm.VirtualMachineProfile.Param;
+
+public class VmWorkMockVirtualMachineManagerImpl implements VirtualMachineManager {
+ private static final Logger s_logger = Logger.getLogger(VmWorkMockVirtualMachineManagerImpl.class);
+
+ @Inject MessageBus _msgBus;
+
+ @Override
+ public String getName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setName(String name) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void setConfigParams(Map<String, Object> params) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public Map<String, Object> getConfigParams() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int getRunLevel() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public void setRunLevel(int level) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean configure(String name, Map<String, Object> params)
+ throws ConfigurationException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean start() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean stop() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean allocate(String vmInstanceName, VMTemplateVO template,
+ ServiceOfferingVO serviceOffering,
+ Pair<? extends DiskOfferingVO, Long> rootDiskOffering,
+ List<Pair<DiskOfferingVO, Long>> dataDiskOfferings,
+ List<Pair<NetworkVO, NicProfile>> networks,
+ Map<Param, Object> params, DeploymentPlan plan,
+ HypervisorType hyperType, Account owner) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+
+ @Override
+ public boolean allocate(String vmInstanceName, VMTemplateVO template,
+ ServiceOfferingVO serviceOffering,
+ List<Pair<NetworkVO, NicProfile>> networkProfiles,
+ DeploymentPlan plan, HypervisorType hyperType, Account owner) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void easyStart(String vmUuid, Map<Param, Object> params) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void easyStart(String vmUuid, Map<Param, Object> params, DeploymentPlan planToDeploy) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void easyStop(String vmUuid) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void expunge(String vmUuid) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void registerGuru(Type type, VirtualMachineGuru guru) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean stateTransitTo(VMInstanceVO vm, Event e, Long hostId)
+ throws NoTransitionException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public Outcome<VirtualMachine> start(String vmUuid, Map<Param, Object> params,
+ DeploymentPlan planToDeploy) {
+ return null;
+ }
+
+ @Override
+ public Outcome<VirtualMachine> stop(String vmUuid, boolean forced) {
+ return null;
+ }
+
+ @Override
+ public void advanceExpunge(String vmUuid) throws ResourceUnavailableException,
+ OperationTimedoutException, ConcurrentOperationException {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public boolean destroy(String vmUuid) throws AgentUnavailableException,
+ OperationTimedoutException, ConcurrentOperationException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean migrateAway(Type type, long vmid, long hostId)
+ throws InsufficientServerCapacityException,
+ VirtualMachineMigrationException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
- public VirtualMachine migrate(String vmUuid, long srcHostId,
- DeployDestination dest) throws ResourceUnavailableException,
- ConcurrentOperationException, ManagementServerException,
- VirtualMachineMigrationException {
++ public Outcome<VirtualMachine> migrate(String vmUuid, long srcHostId,
++ DeployDestination dest) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void reboot(String vmUuid) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void advanceReboot(String vmUuid)
+ throws InsufficientCapacityException, ResourceUnavailableException,
+ ConcurrentOperationException, OperationTimedoutException {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public VirtualMachine storageMigration(String vmUuid,
+ StoragePool storagePoolId) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void checkIfCanUpgrade(VirtualMachine vmInstance,
+ long newServiceOfferingId) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean upgradeVmDb(long vmId, long serviceOfferingId) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public NicProfile addVmToNetwork(VirtualMachine vm, Network network,
+ NicProfile requested) throws ConcurrentOperationException,
+ ResourceUnavailableException, InsufficientCapacityException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean removeNicFromVm(VirtualMachine vm, NicVO nic)
+ throws ConcurrentOperationException, ResourceUnavailableException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean removeVmFromNetwork(VirtualMachine vm, Network network,
+ URI broadcastUri) throws ConcurrentOperationException,
+ ResourceUnavailableException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public NicTO toNicTO(NicProfile nic, HypervisorType hypervisorType) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public VirtualMachineTO toVmTO(
+ VirtualMachineProfile profile) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean reConfigureVm(VirtualMachine vm,
+ ServiceOffering newServiceOffering, boolean sameHost)
+ throws ResourceUnavailableException, ConcurrentOperationException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean findHostAndMigrate(String vmUUid,
+ Long newSvcOfferingId) throws InsufficientCapacityException,
+ ConcurrentOperationException, ResourceUnavailableException,
+ VirtualMachineMigrationException, ManagementServerException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean migrateForScale(String vmUuid, long srcHostId,
+ DeployDestination dest, Long newSvcOfferingId)
+ throws ResourceUnavailableException, ConcurrentOperationException,
+ ManagementServerException, VirtualMachineMigrationException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ int wakeupCount = 0;
+ public void processVmStartWakeup() {
+ s_logger.info("processVmStartWakeup. job-" + AsyncJobExecutionContext.getCurrentExecutionContext().getJob().getId());
+
+ if(wakeupCount++ < 3) {
+ AsyncJobExecutionContext.getCurrentExecutionContext().resetSyncSource();
+ } else {
+ AsyncJobExecutionContext.getCurrentExecutionContext().completeAsyncJob(JobInfo.Status.SUCCEEDED, 0, null);
+ }
+ }
+
+ @Override
+ public VirtualMachine migrateWithStorage(String vmUuid, long srcId, long destId, Map<Volume, StoragePool> volumeToPool) throws ResourceUnavailableException,
+ ConcurrentOperationException, ManagementServerException, VirtualMachineMigrationException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7b7db056/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7b7db056/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java
----------------------------------------------------------------------
diff --cc server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java
index 2fe9dda,6398e20..89c1fe9
--- a/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java
+++ b/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java
@@@ -29,14 -35,7 +29,15 @@@ import org.springframework.core.type.cl
import org.springframework.core.type.classreading.MetadataReaderFactory;
import org.springframework.core.type.filter.TypeFilter;
+import org.apache.cloudstack.acl.SecurityChecker;
+import org.apache.cloudstack.context.CallContext;
+ import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
+import org.apache.cloudstack.region.PortableIpDaoImpl;
+import org.apache.cloudstack.region.PortableIpRangeDaoImpl;
+import org.apache.cloudstack.region.dao.RegionDaoImpl;
+import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDaoImpl;
+import org.apache.cloudstack.test.utils.SpringUtils;
+
import com.cloud.agent.AgentManager;
import com.cloud.alert.AlertManager;
import com.cloud.api.query.dao.UserAccountJoinDaoImpl;
@@@ -357,10 -363,10 +357,10 @@@ public class ChildTestConfiguration
public AccountDetailsDao accountDetailsDao() {
return Mockito.mock(AccountDetailsDao.class);
}
-
+
@Bean
- public ConfigurationManager configurationMgr() {
- return Mockito.mock(ConfigurationManager.class);
+ public DataStoreManager dataStoreManager() {
+ return Mockito.mock(DataStoreManager.class);
}
public static class Library implements TypeFilter {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7b7db056/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7b7db056/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --cc setup/db/db/schema-410to420.sql
index 2046f6c,325924b..75088e5
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@@ -86,9 -94,135 +94,141 @@@ CREATE TABLE `cloud`.`image_store`
PRIMARY KEY(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
++<<<<<<< HEAD
+ALTER TABLE `cloud`.`async_job` ADD COLUMN `related` CHAR(40) NOT NULL;
+
+ALTER TABLE `cloud`.`vm_template` ADD COLUMN `image_data_store_id` bigint unsigned;
++=======
+ CREATE TABLE `cloud`.`image_store_details` (
+ `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `store_id` bigint unsigned NOT NULL COMMENT 'store the detail is related to',
+ `name` varchar(255) NOT NULL COMMENT 'name of the detail',
+ `value` varchar(255) NOT NULL COMMENT 'value of the detail',
+ PRIMARY KEY (`id`),
+ CONSTRAINT `fk_image_store_details__store_id` FOREIGN KEY `fk_image_store__store_id`(`store_id`) REFERENCES `image_store`(`id`) ON DELETE CASCADE,
+ INDEX `i_image_store__name__value`(`name`(128), `value`(128))
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+ DROP VIEW IF EXISTS `cloud`.`image_store_view`;
+ CREATE VIEW `cloud`.`image_store_view` AS
+ select
+ image_store.id,
+ image_store.uuid,
+ image_store.name,
+ image_store.image_provider_name,
+ image_store.protocol,
+ image_store.url,
+ image_store.scope,
+ image_store.role,
+ image_store.removed,
+ data_center.id data_center_id,
+ data_center.uuid data_center_uuid,
+ data_center.name data_center_name,
+ image_store_details.name detail_name,
+ image_store_details.value detail_value
+ from
+ `cloud`.`image_store`
+ left join
+ `cloud`.`data_center` ON image_store.data_center_id = data_center.id
+ left join
+ `cloud`.`image_store_details` ON image_store_details.store_id = image_store.id;
+
+
+ -- here we have to allow null for store_id to accomodate baremetal case to search for ready templates since template state is only stored in this table
+ -- FK also commented out due to this
+ CREATE TABLE `cloud`.`template_store_ref` (
+ `id` bigint unsigned NOT NULL auto_increment,
+ `store_id` bigint unsigned,
+ `template_id` bigint unsigned NOT NULL,
+ `created` DATETIME NOT NULL,
+ `last_updated` DATETIME,
+ `job_id` varchar(255),
+ `download_pct` int(10) unsigned,
+ `size` bigint unsigned,
+ `store_role` varchar(255),
+ `physical_size` bigint unsigned DEFAULT 0,
+ `download_state` varchar(255),
+ `error_str` varchar(255),
+ `local_path` varchar(255),
+ `install_path` varchar(255),
+ `url` varchar(255),
+ `state` varchar(255) NOT NULL,
+ `destroyed` tinyint(1) COMMENT 'indicates whether the template_store entry was destroyed by the user or not',
+ `is_copy` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'indicates whether this was copied ',
+ `update_count` bigint unsigned,
+ `ref_cnt` bigint unsigned,
+ `updated` datetime,
+ PRIMARY KEY (`id`),
+ -- CONSTRAINT `fk_template_store_ref__store_id` FOREIGN KEY `fk_template_store_ref__store_id` (`store_id`) REFERENCES `image_store` (`id`) ON DELETE CASCADE,
+ INDEX `i_template_store_ref__store_id`(`store_id`),
+ CONSTRAINT `fk_template_store_ref__template_id` FOREIGN KEY `fk_template_store_ref__template_id` (`template_id`) REFERENCES `vm_template` (`id`),
+ INDEX `i_template_store_ref__template_id`(`template_id`)
+ ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
+
+ -- ALTER TABLE `cloud`.`vm_template` ADD COLUMN `image_data_store_id` bigint unsigned;
+
+ -- Do we still need these columns? TODO, to delete them, remove FK constraints from snapshots table
+ -- ALTER TABLE `cloud`.`snapshots` DROP COLUMN `swift_id`;
+ -- ALTER TABLE `cloud`.`snapshots` DROP COLUMN `s3_id`;
+ -- ALTER TABLE `cloud`.`snapshots` DROP COLUMN `sechost_id`;
+
+ -- change upload host_id FK to point to image_store table
+ ALTER TABLE `cloud`.`upload` DROP FOREIGN KEY `fk_upload__host_id`;
+ ALTER TABLE `cloud`.`upload` ADD CONSTRAINT `fk_upload__store_id` FOREIGN KEY(`host_id`) REFERENCES `image_store` (`id`) ON DELETE CASCADE;
+
+ CREATE TABLE `cloud`.`snapshot_store_ref` (
+ `id` bigint unsigned NOT NULL auto_increment,
+ `store_id` bigint unsigned NOT NULL,
+ `snapshot_id` bigint unsigned NOT NULL,
+ `created` DATETIME NOT NULL,
+ `last_updated` DATETIME,
+ `job_id` varchar(255),
+ `store_role` varchar(255),
+ `size` bigint unsigned,
+ `physical_size` bigint unsigned DEFAULT 0,
+ `parent_snapshot_id` bigint unsigned DEFAULT 0,
+ `install_path` varchar(255),
+ `state` varchar(255) NOT NULL,
+ -- `removed` datetime COMMENT 'date removed if not null',
+ `update_count` bigint unsigned,
+ `ref_cnt` bigint unsigned,
+ `updated` datetime,
+ PRIMARY KEY (`id`),
+ INDEX `i_snapshot_store_ref__store_id`(`store_id`),
+ CONSTRAINT `fk_snapshot_store_ref__snapshot_id` FOREIGN KEY `fk_snapshot_store_ref__snapshot_id` (`snapshot_id`) REFERENCES `snapshots` (`id`),
+ INDEX `i_snapshot_store_ref__snapshot_id`(`snapshot_id`)
+ ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
+
+ CREATE TABLE `cloud`.`volume_store_ref` (
+ `id` bigint unsigned NOT NULL auto_increment,
+ `store_id` bigint unsigned NOT NULL,
+ `volume_id` bigint unsigned NOT NULL,
+ `zone_id` bigint unsigned NOT NULL,
+ `created` DATETIME NOT NULL,
+ `last_updated` DATETIME,
+ `job_id` varchar(255),
+ `download_pct` int(10) unsigned,
+ `size` bigint unsigned,
+ `physical_size` bigint unsigned DEFAULT 0,
+ `download_state` varchar(255),
+ `checksum` varchar(255) COMMENT 'checksum for the data disk',
+ `error_str` varchar(255),
+ `local_path` varchar(255),
+ `install_path` varchar(255),
+ `url` varchar(255),
+ `state` varchar(255) NOT NULL,
+ `destroyed` tinyint(1) COMMENT 'indicates whether the volume_host entry was destroyed by the user or not',
+ `update_count` bigint unsigned,
+ `ref_cnt` bigint unsigned,
+ `updated` datetime,
+ PRIMARY KEY (`id`),
+ CONSTRAINT `fk_volume_store_ref__store_id` FOREIGN KEY `fk_volume_store_ref__store_id` (`store_id`) REFERENCES `image_store` (`id`) ON DELETE CASCADE,
+ INDEX `i_volume_store_ref__store_id`(`store_id`),
+ CONSTRAINT `fk_volume_store_ref__volume_id` FOREIGN KEY `fk_volume_store_ref__volume_id` (`volume_id`) REFERENCES `volumes` (`id`),
+ INDEX `i_volume_store_ref__volume_id`(`volume_id`)
+ ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
+
++>>>>>>> master
ALTER TABLE `cloud`.`service_offering` ADD COLUMN `is_volatile` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if the vm needs to be volatile, i.e., on every reboot of vm from API root disk is discarded and creates a new root disk';
@@@ -1632,10 -1718,13 +1791,13 @@@ CREATE VIEW `cloud`.`user_vm_view` A
`cloud`.`async_job` ON async_job.instance_id = vm_instance.id
and async_job.instance_type = 'VirtualMachine'
and async_job.job_status = 0
- left join
- `cloud`.`affinity_group_vm_map` ON vm_instance.id = affinity_group_vm_map.instance_id
- left join
+ left join
+ `cloud`.`affinity_group_vm_map` ON vm_instance.id = affinity_group_vm_map.instance_id
+ left join
- `cloud`.`affinity_group` ON affinity_group_vm_map.affinity_group_id = affinity_group.id;
+ `cloud`.`affinity_group` ON affinity_group_vm_map.affinity_group_id = affinity_group.id
+ left join
+ `cloud`.`user_vm_details` vm_details ON vm_details.vm_id = vm_instance.id
+ and vm_details.name = 'enable.dynamic.scaling';
DROP VIEW IF EXISTS `cloud`.`volume_view`;
CREATE VIEW `cloud`.`volume_view` AS
@@@ -1766,7 -1960,10 +2033,10 @@@ CREATE TABLE `cloud`.`account_vnet_map
ALTER TABLE `cloud`.`op_dc_vnet_alloc` ADD COLUMN account_vnet_map_id bigint unsigned;
ALTER TABLE `cloud`.`op_dc_vnet_alloc` ADD CONSTRAINT `fk_op_dc_vnet_alloc__account_vnet_map_id` FOREIGN KEY `fk_op_dc_vnet_alloc__account_vnet_map_id` (`account_vnet_map_id`) REFERENCES `account_vnet_map` (`id`);
-
+
+ update `cloud`.`vm_template` set state='Allocated' where state is NULL;
+ update `cloud`.`vm_template` set update_count=0 where update_count is NULL;
+
CREATE TABLE `cloud`.`network_acl` (
`id` bigint unsigned NOT NULL auto_increment COMMENT 'id',
`name` varchar(255) NOT NULL COMMENT 'name of the network acl',
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7b7db056/tools/devcloud/devcloud.cfg
----------------------------------------------------------------------
diff --cc tools/devcloud/devcloud.cfg
index 353a259,e209b55..5abea54
--- a/tools/devcloud/devcloud.cfg
+++ b/tools/devcloud/devcloud.cfg
@@@ -84,10 -84,12 +84,12 @@@
"internaldns1": "192.168.56.1",
"secondaryStorages": [
{
- "url": "nfs://192.168.56.10:/opt/storage/secondary"
+ "url": "nfs://192.168.56.10/opt/storage/secondary",
+ "provider": "NFS",
+ "details": [ ]
- }
+ }
]
- }
+ }
],
"logger": [
{