fix runNodeWithTagAndNameAndStoreCredentials: it shoud run the domain not only define it

This commit is contained in:
andreaturli 2010-11-01 22:35:01 +01:00
parent 67fde1115a
commit 03d5445cf5
2 changed files with 5 additions and 3 deletions

View File

@ -117,8 +117,10 @@ public class LibvirtComputeServiceAdapter implements ComputeServiceAdapter<Domai
String xmlFinal = generateClonedDomainXML(domain.getXMLDesc(0)); String xmlFinal = generateClonedDomainXML(domain.getXMLDesc(0));
domain = client.domainDefineXML(xmlFinal); domain = client.domainDefineXML(xmlFinal);
domain.create();
// store the credentials so that later functions can use them // store the credentials so that later functions can use them
//credentialStore.put(domain.getUUIDString() + "", new Credentials("identity", "credential")); credentialStore.put(domain.getUUIDString() + "", new Credentials("identity", "credential"));
//} //}
//} //}
@ -260,7 +262,7 @@ public class LibvirtComputeServiceAdapter implements ComputeServiceAdapter<Domai
newNode.getFirstChild().setNodeValue(UUID.randomUUID().toString()); newNode.getFirstChild().setNodeValue(UUID.randomUUID().toString());
builder.getDocument().getDocumentElement().replaceChild(newNode, oldChild); builder.getDocument().getDocumentElement().replaceChild(newNode, oldChild);
builder.xpathFind("//domain/devices/disk/source").a("file", "/var/lib/libvirt/images/ubuntu.img-clone"); builder.xpathFind("//domain/devices/disk/source").a("file", "/var/lib/libvirt/images/ttylinux.img-clone");
// TODO generate valid MAC address // TODO generate valid MAC address
builder.xpathFind("//domain/devices/interface/mac").a("address", "52:54:00:5c:dd:eb"); builder.xpathFind("//domain/devices/interface/mac").a("address", "52:54:00:5c:dd:eb");
return builder.asString(outputProperties); return builder.asString(outputProperties);

View File

@ -83,7 +83,7 @@ public class LibvirtExperimentLiveTest {
* You can control the default template via overriding a method in standalonecomputeservicexontextmodule * You can control the default template via overriding a method in standalonecomputeservicexontextmodule
*/ */
context.getComputeService().runNodesWithTag("ubuntu", 1/*, defaultTemplate*/); context.getComputeService().runNodesWithTag("ttylinux", 1/*, defaultTemplate*/);
} catch (RunNodesException e) { } catch (RunNodesException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block