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/02/14 00:41:33 UTC
git commit: refs/heads/master - Removed a bunch of missing files and
useless imports
Updated Branches:
refs/heads/master d346f632c -> f542c320d
Removed a bunch of missing files and useless imports
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/f542c320
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/f542c320
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/f542c320
Branch: refs/heads/master
Commit: f542c320d340fc8ff235a79df5411f4a4e97601f
Parents: d346f63
Author: Alex Huang <al...@citrix.com>
Authored: Wed Feb 13 15:41:06 2013 -0800
Committer: Alex Huang <al...@citrix.com>
Committed: Wed Feb 13 15:41:27 2013 -0800
----------------------------------------------------------------------
core/src/com/cloud/resource/DiskPreparer.java | 42 ---------
core/src/com/cloud/resource/NetworkPreparer.java | 29 ------
.../storage/PrimaryStorageHeadResource.java | 52 -----------
core/src/com/cloud/vm/VirtualEnvironment.java | 46 ---------
core/src/com/cloud/vm/VirtualNetwork.java | 72 ---------------
plugins/parent/pom.xml | 42 ---------
.../com/cloud/vm/VirtualMachineManagerImpl.java | 42 +++------
7 files changed, 13 insertions(+), 312 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f542c320/core/src/com/cloud/resource/DiskPreparer.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/resource/DiskPreparer.java b/core/src/com/cloud/resource/DiskPreparer.java
deleted file mode 100644
index 77b8f7c..0000000
--- 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);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f542c320/core/src/com/cloud/resource/NetworkPreparer.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/resource/NetworkPreparer.java b/core/src/com/cloud/resource/NetworkPreparer.java
deleted file mode 100644
index d703453..0000000
--- 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);
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f542c320/core/src/com/cloud/resource/storage/PrimaryStorageHeadResource.java
----------------------------------------------------------------------
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 65297a3..0000000
--- 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);
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f542c320/core/src/com/cloud/vm/VirtualEnvironment.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/vm/VirtualEnvironment.java b/core/src/com/cloud/vm/VirtualEnvironment.java
deleted file mode 100644
index 79d4a59..0000000
--- 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<VirtualDisk> disks;
-
- /**
- * Networks to assign to the machine.
- */
- public List<VirtualNetwork> networks;
-
- /**
- * Boot options to assign to the machine.
- */
- public String bootOptions;
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f542c320/core/src/com/cloud/vm/VirtualNetwork.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/vm/VirtualNetwork.java b/core/src/com/cloud/vm/VirtualNetwork.java
deleted file mode 100644
index ace3b80..0000000
--- 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;
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f542c320/plugins/parent/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/parent/pom.xml b/plugins/parent/pom.xml
deleted file mode 100644
index 3a0bf3c..0000000
--- a/plugins/parent/pom.xml
+++ /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.
--->
-<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-plugin-parent</artifactId>
- <name>Apache CloudStack Plugin POM</name>
- <packaging>pom</packaging>
- <parent>
- <groupId>com.cloud</groupId>
- <artifactId>cloud-parent</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <relativePath>../../parent/pom.xml</relativePath>
- </parent>
- <dependencies>
- <dependency>
- <groupId>com.cloud</groupId>
- <artifactId>cloud-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- <build>
- <defaultGoal>install</defaultGoal>
- <sourceDirectory>src</sourceDirectory>
- </build>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f542c320/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
index bb8f8f6..d0a2305 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",