diff --git a/sandbox/vsphere/TODO b/sandbox/vsphere/TODO index 81960b3b76..1ced747a3a 100644 --- a/sandbox/vsphere/TODO +++ b/sandbox/vsphere/TODO @@ -1 +1 @@ -runNodesWithTag: when ask for more than 1 node, cloning step fails cause of concurrent access to the originale virtual disk to be cloned. \ No newline at end of file +runNodesWithTag: pass VirtualMachineRelocateSpec using Template? \ No newline at end of file diff --git a/sandbox/vsphere/src/main/java/org/jclouds/vi/Datacenter.java b/sandbox/vsphere/src/main/java/org/jclouds/vi/Datacenter.java deleted file mode 100644 index b1312ab871..0000000000 --- a/sandbox/vsphere/src/main/java/org/jclouds/vi/Datacenter.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * Copyright (C) 2010 Cloud Conscious, LLC. - * - * ==================================================================== - * Licensed 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.jclouds.vi; - -import com.google.common.base.Objects; - -/** - * This would be replaced with the real java object related to the underlying data center - * - * @author Adrian Cole - */ -public class Datacenter { - - public int id; - public String name; - - public Datacenter(int id, String name) { - this.id = id; - this.name = name; - } - - @Override - public int hashCode() { - return Objects.hashCode(id, name); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - return Objects.equal(this.toString(), that.toString()); - } - - @Override - public String toString() { - return Objects.toStringHelper(this).add("id", id).add("name", name).toString(); - } - -} diff --git a/sandbox/vsphere/src/main/java/org/jclouds/vi/compute/strategy/ViComputeServiceAdapter.java b/sandbox/vsphere/src/main/java/org/jclouds/vi/compute/strategy/ViComputeServiceAdapter.java index 27dafc3409..642fabe0e9 100644 --- a/sandbox/vsphere/src/main/java/org/jclouds/vi/compute/strategy/ViComputeServiceAdapter.java +++ b/sandbox/vsphere/src/main/java/org/jclouds/vi/compute/strategy/ViComputeServiceAdapter.java @@ -68,7 +68,7 @@ import com.vmware.vim25.mo.Task; import com.vmware.vim25.mo.VirtualMachine; /** - * defines the connection between the {@link Libvirt} implementation and the jclouds + * defines the connection between the {@link VI} implementation and the jclouds * {@link ComputeService} * */ diff --git a/sandbox/vsphere/src/test/java/org/jclouds/vi/compute/ViExperimentLiveTest.java b/sandbox/vsphere/src/test/java/org/jclouds/vi/compute/ViExperimentLiveTest.java index 202957116d..cef750823e 100644 --- a/sandbox/vsphere/src/test/java/org/jclouds/vi/compute/ViExperimentLiveTest.java +++ b/sandbox/vsphere/src/test/java/org/jclouds/vi/compute/ViExperimentLiveTest.java @@ -25,10 +25,10 @@ import java.util.Set; import org.jclouds.compute.ComputeServiceContext; import org.jclouds.compute.ComputeServiceContextFactory; +import org.jclouds.compute.domain.ComputeMetadata; import org.jclouds.compute.domain.Hardware; import org.jclouds.compute.domain.Image; -import org.jclouds.compute.domain.NodeMetadata; -import org.jclouds.compute.domain.Template; +import org.jclouds.domain.Location; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -59,19 +59,22 @@ public class ViExperimentLiveTest { context = new ComputeServiceContextFactory().createContext(new ViComputeServiceContextSpec( endpoint, identity, credential)); -// Set locations = context.getComputeService().listAssignableLocations(); -// + Set locations = context.getComputeService().listAssignableLocations(); + for (Location location : locations) { + System.out.println("location id: " + location.getId() + " - desc: " + location.getDescription()); + } + // Set nodes = context.getComputeService().listNodes(); // -// Set hardwares = context.getComputeService().listHardwareProfiles(); -// for (Hardware hardware : hardwares) { -// System.out.println("hardware id: " + hardware.getId()); -// } + Set hardwares = context.getComputeService().listHardwareProfiles(); + for (Hardware hardware : hardwares) { + System.out.println("hardware id: " + hardware.getId() + " - name: " + hardware.getName()); + } // -// Set images = context.getComputeService().listImages(); -// for (Image image : images) { -// System.out.println("id: " + image.getId() + " - name:" + image.getName()); -// } + Set images = context.getComputeService().listImages(); + for (Image image : images) { + System.out.println("id: " + image.getId() + " - name:" + image.getName()); + } // // NodeMetadata node = context.getComputeService().getNodeMetadata("MyWinServer"); // System.out.println(node); @@ -84,7 +87,7 @@ public class ViExperimentLiveTest { Template defaultTemplate = context.getComputeService().templateBuilder() .hardwareId("vm-1221").imageId("winNetEnterprise64Guest") //.locationId("") .build(); - */ + Set nodeMetadataSet = context.getComputeService().runNodesWithTag("MyWinServer", 1); for (NodeMetadata nodeMetadata : nodeMetadataSet) { @@ -93,6 +96,7 @@ public class ViExperimentLiveTest { //context.getComputeService().destroyNode(nodeMetadata.getId()); } + */ } catch (Exception e) { e.printStackTrace();