final String datastoreName = Config.get("abiquo.hypervisor.datastore");
machine = datacenter.discoverSingleMachine(ip, type, user, pass);
NetworkServiceType nst = datacenter.defaultNetworkServiceType();
NetworkInterface vswitch = find(machine.getNetworkInterfaces(), new Predicate<NetworkInterface>() {
@Override
public boolean apply(NetworkInterface input) {
return input.getName().equals(vswitchName);
}
});
vswitch.setNetworkServiceType(nst);
Datastore datastore = find(machine.getDatastores(), new Predicate<Datastore>() {
@Override
public boolean apply(Datastore input) {
return input.getName().equals(datastoreName);