diff --git a/src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java b/src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java index 98b6554ad7..8775559812 100644 --- a/src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java +++ b/src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java @@ -137,56 +137,6 @@ public class VirtualMachine extends PoolElement{ return client.call(ALLOCATE, description); } - /** - * Allocates a new VM in OpenNebula from a registered Template. - * - * @param client XML-RPC Client. - * @param templateId The source Template's ID - * @param newName Name for the new VM, replaces the Template's one. - * Can be null. - * @return If successful the message contains the associated - * id generated for this VM. - */ - public static OneResponse allocateFromTemplate(Client client, - int templateId, String newName) - { - String template = "TEMPLATE_ID = " + templateId; - if( newName != null ) - { - template += "\nNAME = " + newName; - } - - return allocate(client, template); - } - - /** - * Allocates a new VM in OpenNebula from a registered Template. - * - * @param client XML-RPC Client. - * @param templateId The source Template's ID - * @return If successful the message contains the associated - * id generated for this VM. - */ - public static OneResponse allocateFromTemplate(Client client, - int templateId) - { - return allocateFromTemplate(client, templateId, null); - } - - /** - * Allocates a new VM in OpenNebula from a registered Template. - * - * @param client XML-RPC Client. - * @param template The source Template. - * @return If successful the message contains the associated - * id generated for this VM. - */ - public static OneResponse allocateFromTemplate(Client client, - Template template) - { - return allocateFromTemplate(client, template.id()); - } - /** * Retrieves the information of the given VM. * diff --git a/src/oca/java/test/TemplateTest.java b/src/oca/java/test/TemplateTest.java index d8c9f0ee43..f36204dc71 100644 --- a/src/oca/java/test/TemplateTest.java +++ b/src/oca/java/test/TemplateTest.java @@ -247,17 +247,6 @@ public class TemplateTest assertTrue( res.isError() ); } - @Test - public void allocateFromTemplate() - { - res = template.info(); - assertTrue( !res.isError() ); - - res = VirtualMachine.allocateFromTemplate(client, template); - assertTrue( !res.isError() ); - assertTrue( res.getMessage().equals("0") ); - } - @Test public void chown() {