diff --git a/core/src/com/cloud/resource/DiskPreparer.java b/core/src/com/cloud/resource/DiskPreparer.java deleted file mode 100644 index 77b8f7c1b7f..00000000000 --- a/core/src/com/cloud/resource/DiskPreparer.java +++ /dev/null @@ -1,42 +0,0 @@ -// 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.resource; - -import com.cloud.storage.VolumeVO; -import com.cloud.template.VirtualMachineTemplate.BootloaderType; -import com.cloud.utils.component.Adapter; - -/** - * DiskMounter mounts and unmounts disk for VMs - * to consume. - * - */ -public interface DiskPreparer extends Adapter { - /** - * Mounts a volumeVO and returns a path. - * - * @param vol - * @return - */ - public String mount(String vmName, VolumeVO vol, BootloaderType type); - - /** - * Unmounts - */ - public boolean unmount(String path); - -} diff --git a/core/src/com/cloud/resource/NetworkPreparer.java b/core/src/com/cloud/resource/NetworkPreparer.java deleted file mode 100644 index d7034535e9f..00000000000 --- a/core/src/com/cloud/resource/NetworkPreparer.java +++ /dev/null @@ -1,29 +0,0 @@ -// 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.resource; - -import com.cloud.utils.component.Adapter; - -/** - * Prepares the network for VM. - */ -public interface NetworkPreparer extends Adapter { - - String setup(String vnet); - - void cleanup(String vnet); -} diff --git a/core/src/com/cloud/resource/storage/PrimaryStorageHeadResource.java b/core/src/com/cloud/resource/storage/PrimaryStorageHeadResource.java deleted file mode 100644 index 65297a39b96..00000000000 --- a/core/src/com/cloud/resource/storage/PrimaryStorageHeadResource.java +++ /dev/null @@ -1,52 +0,0 @@ -// 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.resource.storage; - -import com.cloud.agent.api.storage.CreateAnswer; -import com.cloud.agent.api.storage.CreateCommand; -import com.cloud.agent.api.storage.DestroyAnswer; -import com.cloud.agent.api.storage.DestroyCommand; -import com.cloud.agent.api.storage.DownloadAnswer; -import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand; -import com.cloud.resource.ServerResource; - -/** - * a primary storage. - * - */ -public interface PrimaryStorageHeadResource extends ServerResource { - /** - * Downloads the template to the primary storage. - * @param cmd - * @return - */ - DownloadAnswer execute(PrimaryStorageDownloadCommand cmd); - - /** - * Creates volumes for the VM. - * @param cmd - * @return - */ - CreateAnswer execute(CreateCommand cmd); - - /** - * Destroys volumes for the VM. - * @param cmd - * @return - */ - DestroyAnswer execute(DestroyCommand cmd); -} diff --git a/core/src/com/cloud/vm/VirtualEnvironment.java b/core/src/com/cloud/vm/VirtualEnvironment.java deleted file mode 100644 index 79d4a59bbfc..00000000000 --- a/core/src/com/cloud/vm/VirtualEnvironment.java +++ /dev/null @@ -1,46 +0,0 @@ -// 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.util.List; - -/** - * - * be an information carrier within one thread only. - * - */ -public class VirtualEnvironment { - /** - * The actual machine - */ - public VirtualMachine machine; - - /** - * Disks to assign to the machine in order. - */ - public List disks; - - /** - * Networks to assign to the machine. - */ - public List networks; - - /** - * Boot options to assign to the machine. - */ - public String bootOptions; -} diff --git a/core/src/com/cloud/vm/VirtualNetwork.java b/core/src/com/cloud/vm/VirtualNetwork.java deleted file mode 100644 index ace3b80769f..00000000000 --- a/core/src/com/cloud/vm/VirtualNetwork.java +++ /dev/null @@ -1,72 +0,0 @@ -// 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 com.cloud.network.Networks.IsolationType; -import com.cloud.network.Networks.Mode; - -/** - * VirtualNetwork describes from a management level the - * machine. - */ -public class VirtualNetwork { - /** - * The gateway for this network. - */ - public String gateway; - - /** - * Netmask - */ - public String netmask; - - /** - * ip address. null if mode is DHCP. - */ - public String ip; - - /** - * Mac Address. - */ - public String mac; - - /** - * rate limit on this network. -1 if no limit. - */ - public long rate; - - /** - * tag for virtualization. - */ - public String tag; - - /** - * mode to acquire ip address. - */ - public Mode mode; - - /** - * Isolation method for networking. - */ - public IsolationType method; - - public boolean firewalled; - - public int[] openPorts; - - public int[] closedPorts; -} diff --git a/plugins/parent/pom.xml b/plugins/parent/pom.xml deleted file mode 100644 index 3a0bf3ce3cf..00000000000 --- a/plugins/parent/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - 4.0.0 - cloud-plugin-parent - Apache CloudStack Plugin POM - pom - - com.cloud - cloud-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - - - - com.cloud - cloud-server - ${project.version} - - - - install - src - - diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java index bb8f8f6abd6..d0a2305ecab 100755 --- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -37,7 +37,6 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; import org.apache.log4j.Logger; -import org.springframework.stereotype.Component; import com.cloud.agent.AgentManager; import com.cloud.agent.AgentManager.OnError; @@ -69,12 +68,10 @@ import com.cloud.agent.api.to.VirtualMachineTO; import com.cloud.agent.manager.Commands; import com.cloud.agent.manager.allocator.HostAllocator; import com.cloud.alert.AlertManager; -import com.cloud.capacity.CapacityManager; import com.cloud.cluster.ClusterManager; import com.cloud.configuration.Config; import com.cloud.configuration.ConfigurationManager; import com.cloud.configuration.dao.ConfigurationDao; -import com.cloud.consoleproxy.ConsoleProxyManager; import com.cloud.dc.DataCenter; import com.cloud.dc.DataCenterVO; import com.cloud.dc.HostPodVO; @@ -152,10 +149,7 @@ import com.cloud.utils.fsm.StateMachine2; import com.cloud.vm.ItWorkVO.Step; import com.cloud.vm.VirtualMachine.Event; import com.cloud.vm.VirtualMachine.State; -import com.cloud.vm.dao.ConsoleProxyDao; -import com.cloud.vm.dao.DomainRouterDao; import com.cloud.vm.dao.NicDao; -import com.cloud.vm.dao.SecondaryStorageVmDao; import com.cloud.vm.dao.UserVmDao; import com.cloud.vm.dao.VMInstanceDao; import com.cloud.vm.snapshot.VMSnapshot; @@ -194,12 +188,6 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac @Inject protected UserVmDao _userVmDao; @Inject - protected DomainRouterDao _routerDao; - @Inject - protected ConsoleProxyDao _consoleDao; - @Inject - protected SecondaryStorageVmDao _secondaryDao; - @Inject protected NicDao _nicsDao; @Inject protected AccountManager _accountMgr; @@ -214,12 +202,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac @Inject protected VolumeDao _volsDao; @Inject - protected ConsoleProxyManager _consoleProxyMgr; - @Inject protected ConfigurationManager _configMgr; @Inject - protected CapacityManager _capacityMgr; - @Inject protected HighAvailabilityManager _haMgr; @Inject protected HostPodDao _podDao; @@ -2591,7 +2575,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac _networkModel.getNetworkRate(network.getId(), vm.getId()), _networkModel.isSecurityGroupSupportedInNetwork(network), _networkModel.getNetworkTag(vmProfile.getVirtualMachine().getHypervisorType(), network)); - + //1) Unplug the nic if (vm.getState() == State.Running) { NicTO nicTO = toNicTO(nicProfile, vmProfile.getVirtualMachine().getHypervisorType()); @@ -2608,11 +2592,11 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac throw new ResourceUnavailableException("Unable to remove vm " + vm + " from network, is not in the right state", DataCenter.class, vm.getDataCenterId()); } - + //2) Release the nic _networkMgr.releaseNic(vmProfile, nic); s_logger.debug("Successfully released nic " + nic + "for vm " + vm); - + //3) Remove the nic _networkMgr.removeNic(vmProfile, nic); _nicsDao.expunge(nic.getId()); @@ -2647,7 +2631,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac s_logger.warn("Could not get a nic with " + network); return false; } - + // don't delete default NIC on a user VM if (nic.isDefaultNic() && vm.getType() == VirtualMachine.Type.User ) { s_logger.warn("Failed to remove nic from " + vm + " in " + network + ", nic is default."); @@ -2661,15 +2645,15 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac //1) Unplug the nic if (vm.getState() == State.Running) { - NicTO nicTO = toNicTO(nicProfile, vmProfile.getVirtualMachine().getHypervisorType()); - s_logger.debug("Un-plugging nic for vm " + vm + " from network " + network); - boolean result = vmGuru.unplugNic(network, nicTO, vmTO, context, dest); - if (result) { - s_logger.debug("Nic is unplugged successfully for vm " + vm + " in network " + network ); - } else { - s_logger.warn("Failed to unplug nic for the vm " + vm + " from network " + network); - return false; - } + NicTO nicTO = toNicTO(nicProfile, vmProfile.getVirtualMachine().getHypervisorType()); + s_logger.debug("Un-plugging nic for vm " + vm + " from network " + network); + boolean result = vmGuru.unplugNic(network, nicTO, vmTO, context, dest); + if (result) { + s_logger.debug("Nic is unplugged successfully for vm " + vm + " in network " + network ); + } else { + s_logger.warn("Failed to unplug nic for the vm " + vm + " from network " + network); + return false; + } } else if (vm.getState() != State.Stopped) { s_logger.warn("Unable to remove vm " + vm + " from network " + network); throw new ResourceUnavailableException("Unable to remove vm " + vm + " from network, is not in the right state",