Merge branch 'master' into vpc

Conflicts:
	api/src/com/cloud/api/ApiConstants.java
	api/src/com/cloud/api/BaseCmd.java
	api/src/com/cloud/api/ResponseGenerator.java
	api/src/com/cloud/api/commands/ListNetworksCmd.java
	api/src/com/cloud/api/response/NetworkResponse.java
	api/src/com/cloud/event/EventTypes.java
	api/src/com/cloud/network/NetworkService.java
	client/tomcatconf/commands.properties.in
	scripts/network/domr/getDomRVersion.sh
	scripts/network/domr/ipassoc.sh
	scripts/network/domr/l2tp_vpn.sh
	scripts/network/domr/networkUsage.sh
	scripts/network/domr/router_proxy.sh
	server/src/com/cloud/api/ApiDBUtils.java
	server/src/com/cloud/api/ApiResponseHelper.java
	server/src/com/cloud/configuration/DefaultComponentLibrary.java
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/dao/IPAddressDao.java
	server/src/com/cloud/network/dao/IPAddressDaoImpl.java
	setup/apidoc/gen_toc.py
	setup/db/create-schema.sql
	wscript
This commit is contained in:
Alena Prokharchyk 2012-06-28 17:41:40 -07:00
commit 634cd78baa
425 changed files with 11992 additions and 23946 deletions

View File

@ -50,7 +50,9 @@ wait_for_network() {
i=1
while [ $i -lt 10 ]
do
if ip addr show cloudbr0 |grep -w inet > /dev/null 2>&1; then
# Under Ubuntu and Debian libvirt by default creates a bridge called virbr0.
# That's why we want more then 3 lines back from brctl, so that there is a manually created bridge
if [ "$(brctl show|wc -l)" -gt 2 ]; then
break
else
sleep 1
@ -75,7 +77,6 @@ start() {
exit 1
fi
#FIXME: wait for network
wait_for_network
if start-stop-daemon --start --quiet \

View File

@ -1,272 +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.agent.dhcp;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Formatter;
import org.apache.log4j.Logger;
import org.jnetpcap.packet.JMemoryPacket;
import org.jnetpcap.packet.JPacket;
import org.jnetpcap.packet.PcapPacket;
import org.jnetpcap.protocol.lan.Ethernet;
import org.jnetpcap.protocol.lan.IEEE802dot1q;
import org.jnetpcap.protocol.network.Ip4;
import org.jnetpcap.protocol.tcpip.Udp;
import com.cloud.agent.dhcp.DhcpSnooperImpl.DHCPState;
public class DhcpPacketParser implements Runnable {
private static final Logger s_logger = Logger
.getLogger(DhcpPacketParser.class);
private enum DHCPPACKET {
OP(0), HTYPE(1), HLEN(2), HOPS(3), XID(4), SECS(8), FLAGS(10), CIADDR(
12), YIADDR(16), SIDADDR(20), GIADDR(24), CHADDR(28), SNAME(44), FILE(
108), MAGIC(236), OPTIONS(240);
int offset;
DHCPPACKET(int i) {
offset = i;
}
int getValue() {
return offset;
}
}
private enum DHCPOPTIONTYPE {
PAD(0), MESSAGETYPE(53), REQUESTEDIP(50), END(255);
int type;
DHCPOPTIONTYPE(int i) {
type = i;
}
int getValue() {
return type;
}
}
private enum DHCPMSGTYPE {
DHCPDISCOVER(1), DHCPOFFER(2), DHCPREQUEST(3), DHCPDECLINE(4), DHCPACK(
5), DHCPNAK(6), DHCPRELEASE(7), DHCPINFORM(8);
int _type;
DHCPMSGTYPE(int type) {
_type = type;
}
int getValue() {
return _type;
}
public static DHCPMSGTYPE valueOf(int type) {
for (DHCPMSGTYPE t : values()) {
if (type == t.getValue()) {
return t;
}
}
return null;
}
}
private class DHCPMSG {
DHCPMSGTYPE msgType;
byte[] caddr;
byte[] yaddr;
byte[] chaddr;
byte[] requestedIP;
public DHCPMSG() {
caddr = new byte[4];
yaddr = new byte[4];
chaddr = new byte[6];
}
}
private PcapPacket _buffer;
private int _offset;
private int _len;
private DhcpSnooperImpl _manager;
public DhcpPacketParser(PcapPacket buffer, int offset, int len,
DhcpSnooperImpl manager) {
_buffer = buffer;
_offset = offset;
_len = len;
_manager = manager;
}
private int getPos(int pos) {
return _offset + pos;
}
private byte getByte(int offset) {
return _buffer.getByte(getPos(offset));
}
private void getByteArray(int offset, byte[] array) {
_buffer.getByteArray(getPos(offset), array);
}
private long getUInt(int offset) {
return _buffer.getUInt(getPos(offset));
}
private DHCPMSG getDhcpMsg() {
long magic = getUInt(DHCPPACKET.MAGIC.getValue());
if (magic != 0x63538263) {
return null;
}
DHCPMSG msg = new DHCPMSG();
int pos = DHCPPACKET.OPTIONS.getValue();
while (pos <= _len) {
int type = (int) getByte(pos++) & 0xff;
if (type == DHCPOPTIONTYPE.END.getValue()) {
break;
}
if (type == DHCPOPTIONTYPE.PAD.getValue()) {
continue;
}
int len = 0;
if (pos <= _len) {
len = ((int) getByte(pos++)) & 0xff;
}
if (type == DHCPOPTIONTYPE.MESSAGETYPE.getValue()
|| type == DHCPOPTIONTYPE.REQUESTEDIP.getValue()) {
/* Read data only if needed */
byte[] data = null;
if ((len + pos) <= _len) {
data = new byte[len];
getByteArray(pos, data);
}
if (type == DHCPOPTIONTYPE.MESSAGETYPE.getValue()) {
msg.msgType = DHCPMSGTYPE.valueOf((int) data[0]);
} else if (type == DHCPOPTIONTYPE.REQUESTEDIP.getValue()) {
msg.requestedIP = data;
}
}
pos += len;
}
if (msg.msgType == DHCPMSGTYPE.DHCPREQUEST) {
getByteArray(DHCPPACKET.CHADDR.getValue(), msg.chaddr);
getByteArray(DHCPPACKET.CIADDR.getValue(), msg.caddr);
} else if (msg.msgType == DHCPMSGTYPE.DHCPACK) {
getByteArray(DHCPPACKET.YIADDR.getValue(), msg.yaddr);
}
return msg;
}
private String formatMacAddress(byte[] mac) {
StringBuffer sb = new StringBuffer();
Formatter formatter = new Formatter(sb);
for (int i = 0; i < mac.length; i++) {
formatter.format("%02X%s", mac[i], (i < mac.length - 1) ? ":" : "");
}
return sb.toString();
}
private String getDestMacAddress() {
Ethernet ether = new Ethernet();
if (_buffer.hasHeader(ether)) {
byte[] destMac = ether.destination();
return formatMacAddress(destMac);
}
return null;
}
private InetAddress getDHCPServerIP() {
Ip4 ip = new Ip4();
if (_buffer.hasHeader(ip)) {
try {
return InetAddress.getByAddress(ip.source());
} catch (UnknownHostException e) {
s_logger.debug("Failed to get dhcp server ip address: "
+ e.toString());
}
}
return null;
}
@Override
public void run() {
DHCPMSG msg = getDhcpMsg();
if (msg == null) {
return;
}
if (msg.msgType == DHCPMSGTYPE.DHCPACK) {
InetAddress ip = null;
try {
ip = InetAddress.getByAddress(msg.yaddr);
String macAddr = getDestMacAddress();
_manager.setIPAddr(macAddr, ip, DHCPState.DHCPACKED,
getDHCPServerIP());
} catch (UnknownHostException e) {
}
} else if (msg.msgType == DHCPMSGTYPE.DHCPREQUEST) {
InetAddress ip = null;
if (msg.requestedIP != null) {
try {
ip = InetAddress.getByAddress(msg.requestedIP);
} catch (UnknownHostException e) {
}
}
if (ip == null) {
try {
ip = InetAddress.getByAddress(msg.caddr);
} catch (UnknownHostException e) {
}
}
if (ip != null) {
String macAddr = formatMacAddress(msg.chaddr);
_manager.setIPAddr(macAddr, ip, DHCPState.DHCPREQUESTED, null);
}
}
}
private void test() {
JPacket packet = new JMemoryPacket(
Ethernet.ID,
" 06fa 8800 00b3 0656 d200 0027 8100 001a 0800 4500 0156 64bf 0000 4011 f3f2 ac1a 6412 ac1a 649e 0043 0044 0001 0000 0001");
Ethernet eth = new Ethernet();
if (packet.hasHeader(eth)) {
System.out.print(" ether:" + eth);
}
IEEE802dot1q vlan = new IEEE802dot1q();
if (packet.hasHeader(vlan)) {
System.out.print(" vlan: " + vlan);
}
if (packet.hasHeader(Udp.ID)) {
System.out.print("has udp");
}
}
}

View File

@ -1,324 +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.agent.dhcp;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import javax.ejb.Local;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.jnetpcap.Pcap;
import org.jnetpcap.PcapBpfProgram;
import org.jnetpcap.PcapIf;
import org.jnetpcap.packet.PcapPacket;
import org.jnetpcap.packet.PcapPacketHandler;
import org.jnetpcap.protocol.tcpip.Udp;
import com.cloud.utils.Pair;
import com.cloud.utils.concurrency.NamedThreadFactory;
@Local(value = { DhcpSnooper.class })
public class DhcpSnooperImpl implements DhcpSnooper {
private static final Logger s_logger = Logger
.getLogger(DhcpSnooperImpl.class);
public enum DHCPState {
DHCPACKED, DHCPREQUESTED, DHCPRESET;
}
public class IPAddr {
String _vmName;
InetAddress _ip;
DHCPState _state;
public IPAddr(InetAddress ip, DHCPState state, String vmName) {
_ip = ip;
_state = state;
_vmName = vmName;
}
}
protected ExecutorService _executor;
protected Map<String, IPAddr> _macIpMap;
protected Map<InetAddress, String> _ipMacMap;
private DhcpServer _server;
protected long _timeout = 1200000;
protected InetAddress _dhcpServerIp;
public DhcpSnooperImpl(String bridge, long timeout) {
_timeout = timeout;
_executor = new ThreadPoolExecutor(10, 10 * 10, 1, TimeUnit.DAYS,
new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory(
"DhcpListener"));
_macIpMap = new ConcurrentHashMap<String, IPAddr>();
_ipMacMap = new ConcurrentHashMap<InetAddress, String>();
_server = new DhcpServer(this, bridge);
_server.start();
}
@Override
public InetAddress getIPAddr(String macAddr, String vmName) {
String macAddrLowerCase = macAddr.toLowerCase();
IPAddr addr = _macIpMap.get(macAddrLowerCase);
if (addr == null) {
addr = new IPAddr(null, DHCPState.DHCPRESET, vmName);
_macIpMap.put(macAddrLowerCase, addr);
} else {
addr._state = DHCPState.DHCPRESET;
}
synchronized (addr) {
try {
addr.wait(_timeout);
} catch (InterruptedException e) {
}
if (addr._state == DHCPState.DHCPACKED) {
addr._state = DHCPState.DHCPRESET;
return addr._ip;
}
}
return null;
}
public InetAddress getDhcpServerIP() {
return _dhcpServerIp;
}
@Override
public void cleanup(String macAddr, String vmName) {
try {
if (macAddr == null) {
return;
}
_macIpMap.remove(macAddr);
_ipMacMap.values().remove(macAddr);
} catch (Exception e) {
s_logger.debug("Failed to cleanup: " + e.toString());
}
}
@Override
public Map<String, InetAddress> syncIpAddr() {
Collection<IPAddr> ips = _macIpMap.values();
HashMap<String, InetAddress> vmIpMap = new HashMap<String, InetAddress>();
for (IPAddr ip : ips) {
if (ip._state == DHCPState.DHCPACKED) {
vmIpMap.put(ip._vmName, ip._ip);
}
}
return vmIpMap;
}
@Override
public void initializeMacTable(List<Pair<String, String>> macVmNameList) {
for (Pair<String, String> macVmname : macVmNameList) {
IPAddr ipAdrr = new IPAddr(null, DHCPState.DHCPRESET,
macVmname.second());
_macIpMap.put(macVmname.first(), ipAdrr);
}
}
protected void setIPAddr(String macAddr, InetAddress ip, DHCPState state,
InetAddress dhcpServerIp) {
String macAddrLowerCase = macAddr.toLowerCase();
if (state == DHCPState.DHCPREQUESTED) {
IPAddr ipAddr = _macIpMap.get(macAddrLowerCase);
if (ipAddr == null) {
return;
}
_ipMacMap.put(ip, macAddr);
} else if (state == DHCPState.DHCPACKED) {
_dhcpServerIp = dhcpServerIp;
String destMac = macAddrLowerCase;
if (macAddrLowerCase.equalsIgnoreCase("ff:ff:ff:ff:ff:ff")) {
destMac = _ipMacMap.get(ip);
if (destMac == null) {
return;
}
}
IPAddr addr = _macIpMap.get(destMac);
if (addr != null) {
addr._ip = ip;
addr._state = state;
synchronized (addr) {
addr.notify();
}
}
}
}
/*
* (non-Javadoc)
*
* @see com.cloud.agent.dhcp.DhcpSnooper#stop()
*/
@Override
public boolean stop() {
_executor.shutdown();
_server.StopServer();
return true;
}
private class DhcpServer extends Thread {
private DhcpSnooperImpl _manager;
private String _bridge;
private Pcap _pcapedDev;
private boolean _loop;
public DhcpServer(DhcpSnooperImpl mgt, String bridge) {
_manager = mgt;
_bridge = bridge;
_loop = true;
}
public void StopServer() {
_loop = false;
_pcapedDev.breakloop();
_pcapedDev.close();
}
private Pcap initializePcap() {
try {
List<PcapIf> alldevs = new ArrayList<PcapIf>();
StringBuilder errBuf = new StringBuilder();
int r = Pcap.findAllDevs(alldevs, errBuf);
if (r == Pcap.NOT_OK || alldevs.isEmpty()) {
return null;
}
PcapIf dev = null;
for (PcapIf device : alldevs) {
if (device.getName().equalsIgnoreCase(_bridge)) {
dev = device;
break;
}
}
if (dev == null) {
s_logger.debug("Pcap: Can't find device: " + _bridge
+ " to listen on");
return null;
}
int snaplen = 64 * 1024;
int flags = Pcap.MODE_PROMISCUOUS;
int timeout = 10 * 1000;
Pcap pcap = Pcap.openLive(dev.getName(), snaplen, flags,
timeout, errBuf);
if (pcap == null) {
s_logger.debug("Pcap: Can't open " + _bridge);
return null;
}
PcapBpfProgram program = new PcapBpfProgram();
String expr = "dst port 68 or 67";
int optimize = 0;
int netmask = 0xFFFFFF00;
if (pcap.compile(program, expr, optimize, netmask) != Pcap.OK) {
s_logger.debug("Pcap: can't compile BPF");
return null;
}
if (pcap.setFilter(program) != Pcap.OK) {
s_logger.debug("Pcap: Can't set filter");
return null;
}
return pcap;
} catch (Exception e) {
s_logger.debug("Failed to initialized: " + e.toString());
}
return null;
}
public void run() {
while (_loop) {
try {
_pcapedDev = initializePcap();
if (_pcapedDev == null) {
return;
}
PcapPacketHandler<String> jpacketHandler = new PcapPacketHandler<String>() {
public void nextPacket(PcapPacket packet, String user) {
Udp u = new Udp();
if (packet.hasHeader(u)) {
int offset = u.getOffset() + u.getLength();
_executor.execute(new DhcpPacketParser(packet,
offset, u.length() - u.getLength(),
_manager));
}
}
};
s_logger.debug("Starting DHCP snooping on " + _bridge);
int retValue = _pcapedDev.loop(-1, jpacketHandler,
"pcapPacketHandler");
if (retValue == -1) {
s_logger.debug("Pcap: failed to set loop handler");
} else if (retValue == -2 && !_loop) {
s_logger.debug("Pcap: terminated");
return;
}
_pcapedDev.close();
} catch (Exception e) {
s_logger.debug("Pcap error:" + e.toString());
}
}
}
}
static public void main(String args[]) {
s_logger.addAppender(new org.apache.log4j.ConsoleAppender(
new org.apache.log4j.PatternLayout(), "System.out"));
final DhcpSnooperImpl manager = new DhcpSnooperImpl("cloudbr0", 10000);
s_logger.debug(manager.getIPAddr("02:00:4c:66:00:03", "i-2-5-VM"));
manager.stop();
}
@Override
public boolean configure(String name, Map<String, Object> params)
throws ConfigurationException {
// TODO configure timeout here
return true;
}
@Override
public boolean start() {
return true;
}
@Override
public String getName() {
return "DhcpSnooperImpl";
}
}

View File

@ -1,293 +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.agent.resource.computing;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.libvirt.Connect;
import org.libvirt.Domain;
import org.libvirt.LibvirtException;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.Command;
import com.cloud.agent.api.StartAnswer;
import com.cloud.agent.api.StartCommand;
import com.cloud.agent.api.StopAnswer;
import com.cloud.agent.api.StopCommand;
import com.cloud.agent.api.routing.SavePasswordCommand;
import com.cloud.agent.api.routing.VmDataCommand;
import com.cloud.agent.api.to.NicTO;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.agent.dhcp.DhcpSnooper;
import com.cloud.agent.dhcp.DhcpSnooperImpl;
import com.cloud.agent.resource.computing.LibvirtComputingResource;
import com.cloud.agent.resource.computing.LibvirtConnection;
import com.cloud.agent.resource.computing.LibvirtVMDef;
import com.cloud.agent.resource.computing.LibvirtVMDef.DiskDef;
import com.cloud.agent.resource.computing.LibvirtVMDef.InterfaceDef;
import com.cloud.agent.vmdata.JettyVmDataServer;
import com.cloud.agent.vmdata.VmDataServer;
import com.cloud.network.Networks.TrafficType;
import com.cloud.utils.Pair;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachine.State;
/**
* Logic specific to the Cloudzones feature
*
* }
**/
public class CloudZonesComputingResource extends LibvirtComputingResource {
private static final Logger s_logger = Logger
.getLogger(CloudZonesComputingResource.class);
protected DhcpSnooper _dhcpSnooper;
String _parent;
long _dhcpTimeout;
protected String _hostIp;
protected String _hostMacAddress;
protected VmDataServer _vmDataServer = new JettyVmDataServer();
private void setupDhcpManager(Connect conn, String bridgeName) {
_dhcpSnooper = new DhcpSnooperImpl(bridgeName, _dhcpTimeout);
List<Pair<String, String>> macs = new ArrayList<Pair<String, String>>();
try {
int[] domainIds = conn.listDomains();
for (int i = 0; i < domainIds.length; i++) {
Domain vm = conn.domainLookupByID(domainIds[i]);
if (vm.getName().startsWith("i-")) {
List<InterfaceDef> nics = getInterfaces(conn, vm.getName());
InterfaceDef nic = nics.get(0);
macs.add(new Pair<String, String>(nic.getMacAddress(), vm
.getName()));
}
}
} catch (LibvirtException e) {
s_logger.debug("Failed to get MACs: " + e.toString());
}
_dhcpSnooper.initializeMacTable(macs);
}
@Override
public boolean configure(String name, Map<String, Object> params)
throws ConfigurationException {
boolean success = super.configure(name, params);
if (!success) {
return false;
}
_parent = (String) params.get("mount.path");
try {
_dhcpTimeout = Long.parseLong((String) params.get("dhcp.timeout"));
} catch (Exception e) {
_dhcpTimeout = 1200000;
}
_hostIp = (String) params.get("host.ip");
_hostMacAddress = (String) params.get("host.mac.address");
try {
Connect conn;
conn = LibvirtConnection.getConnection();
setupDhcpManager(conn, _guestBridgeName);
} catch (LibvirtException e) {
s_logger.debug("Failed to get libvirt connection:" + e.toString());
return false;
}
_dhcpSnooper.configure(name, params);
_vmDataServer.configure(name, params);
return true;
}
@Override
protected synchronized StartAnswer execute(StartCommand cmd) {
VirtualMachineTO vmSpec = cmd.getVirtualMachine();
String vmName = vmSpec.getName();
LibvirtVMDef vm = null;
State state = State.Stopped;
Connect conn = null;
try {
conn = LibvirtConnection.getConnection();
synchronized (_vms) {
_vms.put(vmName, State.Starting);
}
vm = createVMFromSpec(vmSpec);
createVbd(conn, vmSpec, vmName, vm);
createVifs(conn, vmSpec, vm);
s_logger.debug("starting " + vmName + ": " + vm.toString());
startDomain(conn, vmName, vm.toString());
NicTO[] nics = vmSpec.getNics();
for (NicTO nic : nics) {
if (nic.isSecurityGroupEnabled()) {
if (vmSpec.getType() != VirtualMachine.Type.User) {
default_network_rules_for_systemvm(conn, vmName);
} else {
nic.setIp(null);
default_network_rules(conn, vmName, nic, vmSpec.getId());
}
}
}
// Attach each data volume to the VM, if there is a deferred
// attached disk
for (DiskDef disk : vm.getDevices().getDisks()) {
if (disk.isAttachDeferred()) {
attachOrDetachDevice(conn, true, vmName, disk.toString());
}
}
if (vmSpec.getType() == VirtualMachine.Type.User) {
for (NicTO nic : nics) {
if (nic.getType() == TrafficType.Guest) {
InetAddress ipAddr = _dhcpSnooper.getIPAddr(
nic.getMac(), vmName);
if (ipAddr == null) {
s_logger.debug("Failed to get guest DHCP ip, stop it");
StopCommand stpCmd = new StopCommand(vmName);
execute(stpCmd);
return new StartAnswer(cmd,
"Failed to get guest DHCP ip, stop it");
}
s_logger.debug(ipAddr);
nic.setIp(ipAddr.getHostAddress());
post_default_network_rules(conn, vmName, nic,
vmSpec.getId(), _dhcpSnooper.getDhcpServerIP(),
_hostIp, _hostMacAddress);
_vmDataServer.handleVmStarted(cmd.getVirtualMachine());
}
}
}
state = State.Running;
return new StartAnswer(cmd);
} catch (Exception e) {
s_logger.warn("Exception ", e);
if (conn != null) {
handleVmStartFailure(conn, vmName, vm);
}
return new StartAnswer(cmd, e.getMessage());
} finally {
synchronized (_vms) {
if (state != State.Stopped) {
_vms.put(vmName, state);
} else {
_vms.remove(vmName);
}
}
}
}
protected Answer execute(StopCommand cmd) {
final String vmName = cmd.getVmName();
Long bytesReceived = new Long(0);
Long bytesSent = new Long(0);
State state = null;
synchronized (_vms) {
state = _vms.get(vmName);
_vms.put(vmName, State.Stopping);
}
try {
Connect conn = LibvirtConnection.getConnection();
try {
Domain dm = conn.domainLookupByUUID(UUID
.nameUUIDFromBytes(vmName.getBytes()));
} catch (LibvirtException e) {
state = State.Stopped;
return new StopAnswer(cmd, null, 0, bytesSent, bytesReceived);
}
String macAddress = null;
if (vmName.startsWith("i-")) {
List<InterfaceDef> nics = getInterfaces(conn, vmName);
if (!nics.isEmpty()) {
macAddress = nics.get(0).getMacAddress();
}
}
destroy_network_rules_for_vm(conn, vmName);
String result = stopVM(conn, vmName, defineOps.UNDEFINE_VM);
try {
cleanupVnet(conn, cmd.getVnet());
_dhcpSnooper.cleanup(macAddress, vmName);
_vmDataServer.handleVmStopped(cmd.getVmName());
} catch (Exception e) {
}
state = State.Stopped;
return new StopAnswer(cmd, result, 0, bytesSent, bytesReceived);
} catch (LibvirtException e) {
return new StopAnswer(cmd, e.getMessage());
} finally {
synchronized (_vms) {
if (state != null) {
_vms.put(vmName, state);
} else {
_vms.remove(vmName);
}
}
}
}
@Override
public Answer executeRequest(Command cmd) {
if (cmd instanceof VmDataCommand) {
return execute((VmDataCommand) cmd);
} else if (cmd instanceof SavePasswordCommand) {
return execute((SavePasswordCommand) cmd);
}
return super.executeRequest(cmd);
}
protected Answer execute(final VmDataCommand cmd) {
return _vmDataServer.handleVmDataCommand(cmd);
}
protected Answer execute(final SavePasswordCommand cmd) {
return new Answer(cmd);
}
}

View File

@ -2483,7 +2483,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
ConsoleDef console = new ConsoleDef("pty", null, null, (short) 0);
devices.addDevice(console);
GraphicDef grap = new GraphicDef("vnc", (short) 0, true, null, null,
GraphicDef grap = new GraphicDef("vnc", (short) 0, true, vmTO.getVncAddr(), null,
null);
devices.addDevice(grap);
@ -2509,6 +2509,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
protected synchronized StartAnswer execute(StartCommand cmd) {
VirtualMachineTO vmSpec = cmd.getVirtualMachine();
vmSpec.setVncAddr(cmd.getHostIp());
String vmName = vmSpec.getName();
LibvirtVMDef vm = null;
@ -3952,24 +3953,11 @@ public class LibvirtComputingResource extends ServerResourceBase implements
if (!_can_bridge_firewall) {
return false;
}
List<InterfaceDef> intfs = getInterfaces(conn, vmName);
if (intfs.size() < 1) {
return false;
}
/* FIX ME: */
String brname = null;
if (vmName.startsWith("r-")) {
InterfaceDef intf = intfs.get(0);
brname = intf.getBrName();
} else {
InterfaceDef intf = intfs.get(intfs.size() - 1);
brname = intf.getBrName();
}
Script cmd = new Script(_securityGroupPath, _timeout, s_logger);
cmd.add("default_network_rules_systemvm");
cmd.add("--vmname", vmName);
cmd.add("--brname", brname);
cmd.add("--localbrname", _linkLocalBridgeName);
String result = cmd.execute();
if (result != null) {
return false;

View File

@ -717,11 +717,11 @@ public class LibvirtVMDef {
private final String _passwd;
private final String _keyMap;
public GraphicDef(String type, short port, boolean auotPort,
public GraphicDef(String type, short port, boolean autoPort,
String listenAddr, String passwd, String keyMap) {
_type = type;
_port = port;
_autoPort = auotPort;
_autoPort = autoPort;
_listenAddr = listenAddr;
_passwd = passwd;
_keyMap = keyMap;

View File

@ -17,11 +17,13 @@
package com.cloud.agent.api;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.host.Host;
/**
*/
public class StartCommand extends Command {
VirtualMachineTO vm;
String hostIp;
public VirtualMachineTO getVirtualMachine() {
return vm;
@ -38,4 +40,13 @@ public class StartCommand extends Command {
public StartCommand(VirtualMachineTO vm) {
this.vm = vm;
}
public StartCommand(VirtualMachineTO vm, Host host) {
this.vm = vm;
this.hostIp = host.getPrivateIpAddress();
}
public String getHostIp() {
return this.hostIp;
}
}

View File

@ -40,6 +40,7 @@ public class VirtualMachineTO {
boolean enableHA;
boolean limitCpuUse;
String vncPassword;
String vncAddr;
Map<String, String> params;
VolumeTO[] disks;
@ -192,6 +193,14 @@ public class VirtualMachineTO {
this.vncPassword = vncPassword;
}
public String getVncAddr() {
return this.vncAddr;
}
public void setVncAddr(String vncAddr) {
this.vncAddr = vncAddr;
}
public Map<String, String> getDetails() {
return params;
}

View File

@ -361,6 +361,10 @@ public class ApiConstants {
public static final String NETWORK = "network";
public static final String VPC_ID = "vpcid";
public static final String GATEWAY_ID = "gatewayid";
public static final String CAN_USE_FOR_DEPLOY = "canusefordeploy";
public static final String RESOURCE_IDS = "resourceids";
public static final String RESOURCE_ID = "resourceid";
public static final String CUSTOMER = "customer";
public enum HostDetails {
all, capacity, events, stats, min;

View File

@ -51,6 +51,7 @@ import com.cloud.projects.Project;
import com.cloud.projects.ProjectService;
import com.cloud.resource.ResourceService;
import com.cloud.server.ManagementService;
import com.cloud.server.TaggedResourceService;
import com.cloud.storage.StorageService;
import com.cloud.storage.snapshot.SnapshotService;
import com.cloud.template.TemplateService;
@ -131,6 +132,7 @@ public abstract class BaseCmd {
public static StorageNetworkService _storageNetworkService;
public static VpcService _vpcService;
public static NetworkACLService _networkACLService;
public static TaggedResourceService _taggedResourceService;
static void setComponents(ResponseGenerator generator) {
ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
@ -160,6 +162,7 @@ public abstract class BaseCmd {
_storageNetworkService = locator.getManager(StorageNetworkService.class);
_vpcService = locator.getManager(VpcService.class);
_networkACLService = locator.getManager(NetworkACLService.class);
_taggedResourceService = locator.getManager(TaggedResourceService.class);
}
public abstract void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException;

View File

@ -58,6 +58,7 @@ import com.cloud.api.response.ProviderResponse;
import com.cloud.api.response.RemoteAccessVpnResponse;
import com.cloud.api.response.ResourceCountResponse;
import com.cloud.api.response.ResourceLimitResponse;
import com.cloud.api.response.ResourceTagResponse;
import com.cloud.api.response.SecurityGroupResponse;
import com.cloud.api.response.ServiceOfferingResponse;
import com.cloud.api.response.ServiceResponse;
@ -124,6 +125,7 @@ import com.cloud.org.Cluster;
import com.cloud.projects.Project;
import com.cloud.projects.ProjectAccount;
import com.cloud.projects.ProjectInvitation;
import com.cloud.server.ResourceTag;
import com.cloud.storage.Snapshot;
import com.cloud.storage.StoragePool;
import com.cloud.storage.Swift;
@ -292,6 +294,7 @@ public interface ResponseGenerator {
Long getIdentiyId(String tableName, String token);
/**
<<<<<<< HEAD
* @param offering
* @return
*/
@ -320,4 +323,6 @@ public interface ResponseGenerator {
* @return
*/
StaticRouteResponse createStaticRouteResponse(StaticRoute result);
ResourceTagResponse createResourceTagResponse(ResourceTag resourceTag);
}

View File

@ -31,8 +31,10 @@ import com.cloud.api.ServerApiException;
import com.cloud.api.response.ClusterResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.exception.DiscoveryException;
import com.cloud.exception.ResourceInUseException;
import com.cloud.org.Cluster;
import com.cloud.user.Account;
import com.cloud.utils.IdentityProxy;
@Implementation(description="Adds a new cluster", responseObject=ClusterResponse.class)
public class AddClusterCmd extends BaseCmd {
@ -167,6 +169,13 @@ public class AddClusterCmd extends BaseCmd {
} catch (DiscoveryException ex) {
s_logger.warn("Exception: ", ex);
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
} catch (ResourceInUseException ex) {
s_logger.warn("Exception: ", ex);
ServerApiException e = new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
for (IdentityProxy proxyObj : ex.getIdProxyList()) {
e.addProxyObject(proxyObj.getTableName(), proxyObj.getValue(), proxyObj.getidFieldName());
}
throw e;
}
}
}

View File

@ -0,0 +1,131 @@
// Copyright 2012 Citrix Systems, Inc. Licensed under the
// Apache License, Version 2.0 (the "License"); you may not use this
// file except in compliance with the License. Citrix Systems, Inc.
// reserves all rights not expressly granted by 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.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.api.commands;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import com.cloud.api.ApiConstants;
import com.cloud.api.BaseAsyncCmd;
import com.cloud.api.BaseCmd;
import com.cloud.api.Implementation;
import com.cloud.api.Parameter;
import com.cloud.api.ServerApiException;
import com.cloud.api.response.SuccessResponse;
import com.cloud.event.EventTypes;
import com.cloud.server.ResourceTag;
import com.cloud.server.ResourceTag.TaggedResourceType;
/**
* @author Alena Prokharchyk
*/
@Implementation(description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "Burbank")
public class CreateTagsCmd extends BaseAsyncCmd{
public static final Logger s_logger = Logger.getLogger(CreateTagsCmd.class.getName());
private static final String s_name = "createtagsresponse";
// ///////////////////////////////////////////////////
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@Parameter(name = ApiConstants.TAGS, type = CommandType.MAP, required=true, description = "Map of tags (key/value pairs)")
private Map tag;
@Parameter(name=ApiConstants.RESOURCE_TYPE, type=CommandType.STRING, required=true, description="type of the resource")
private String resourceType;
@Parameter(name=ApiConstants.RESOURCE_IDS, type=CommandType.LIST, required=true,
collectionType=CommandType.STRING, description="list of resources to create the tags for")
private List<String> resourceIds;
@Parameter(name=ApiConstants.CUSTOMER, type=CommandType.STRING, description="identifies client specific tag. " +
"When the value is not null, the tag can't be used by cloudStack code internally")
private String customer;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
public TaggedResourceType getResourceType(){
return _taggedResourceService.getResourceType(resourceType);
}
public Map<String, String> getTags() {
Map<String, String> tagsMap = null;
if (!tag.isEmpty()) {
tagsMap = new HashMap<String, String>();
Collection<?> servicesCollection = tag.values();
Iterator<?> iter = servicesCollection.iterator();
while (iter.hasNext()) {
HashMap<String, String> services = (HashMap<String, String>) iter.next();
String key = services.get("key");
String value = services.get("value");
tagsMap.put(key, value);
}
}
return tagsMap;
}
public List<String> getResourceIds() {
return resourceIds;
}
public String getCustomer() {
return customer;
}
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public String getCommandName() {
return s_name;
}
@Override
public long getEntityOwnerId() {
//FIXME - validate the owner here
return 1;
}
@Override
public void execute() {
List<ResourceTag> tags = _taggedResourceService.createTags(getResourceIds(), getResourceType(), getTags(), getCustomer());
if (tags != null && !tags.isEmpty()) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create tags");
}
}
@Override
public String getEventType() {
return EventTypes.EVENT_TAGS_CREATE;
}
@Override
public String getEventDescription() {
return "creating tags";
}
}

View File

@ -0,0 +1,112 @@
// Copyright 2012 Citrix Systems, Inc. Licensed under the
package com.cloud.api.commands;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import com.cloud.api.ApiConstants;
import com.cloud.api.BaseAsyncCmd;
import com.cloud.api.BaseCmd;
import com.cloud.api.Implementation;
import com.cloud.api.Parameter;
import com.cloud.api.ServerApiException;
import com.cloud.api.response.SuccessResponse;
import com.cloud.event.EventTypes;
import com.cloud.server.ResourceTag;
import com.cloud.server.ResourceTag.TaggedResourceType;
/**
* @author Alena Prokharchyk
*/
@Implementation(description = "Deleting resource tag(s)", responseObject = SuccessResponse.class, since = "Burbank")
public class DeleteTagsCmd extends BaseAsyncCmd{
public static final Logger s_logger = Logger.getLogger(DeleteTagsCmd.class.getName());
private static final String s_name = "deleteTagsresponse";
// ///////////////////////////////////////////////////
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@Parameter(name = ApiConstants.TAGS, type = CommandType.MAP, description = "Delete tags matching key/value pairs")
private Map tag;
@Parameter(name=ApiConstants.RESOURCE_TYPE, type=CommandType.STRING, required=true, description="Delete tag by resource type")
private String resourceType;
@Parameter(name=ApiConstants.RESOURCE_IDS, type=CommandType.LIST, required=true,
collectionType=CommandType.STRING, description="Delete tags for resource id(s)")
private List<String> resourceIds;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
public TaggedResourceType getResourceType(){
return _taggedResourceService.getResourceType(resourceType);
}
public Map<String, String> getTags() {
Map<String, String> tagsMap = null;
if (tag != null && !tag.isEmpty()) {
tagsMap = new HashMap<String, String>();
Collection<?> servicesCollection = tag.values();
Iterator<?> iter = servicesCollection.iterator();
while (iter.hasNext()) {
HashMap<String, String> services = (HashMap<String, String>) iter.next();
String key = services.get("key");
String value = services.get("value");
tagsMap.put(key, value);
}
}
return tagsMap;
}
public List<String> getResourceIds() {
return resourceIds;
}
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public String getCommandName() {
return s_name;
}
@Override
public long getEntityOwnerId() {
//FIXME - validate the owner here
return 1;
}
@Override
public void execute() {
boolean success = _taggedResourceService.deleteTags(getResourceIds(), getResourceType(), getTags());
if (success) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete tags");
}
}
@Override
public String getEventType() {
return EventTypes.EVENT_TAGS_DELETE;
}
@Override
public String getEventDescription() {
return "Deleting tags";
}
}

View File

@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@ -252,9 +253,9 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
if ((networkIds != null || ipAddress != null) && ipToNetworkList != null) {
throw new InvalidParameterValueException("NetworkIds and ipAddress can't be specified along with ipToNetworkMap parameter");
}
Map<Long, String> ipToNetworkMap = null;
LinkedHashMap<Long, String> ipToNetworkMap = null;
if (ipToNetworkList != null && !ipToNetworkList.isEmpty()) {
ipToNetworkMap = new HashMap<Long, String>();
ipToNetworkMap = new LinkedHashMap<Long, String>();
Collection ipsCollection = ipToNetworkList.values();
Iterator iter = ipsCollection.iterator();
while (iter.hasNext()) {

View File

@ -63,10 +63,11 @@ public class ListNetworksCmd extends BaseListProjectAndAccountResourcesCmd {
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, description="list networks by physical network id")
private Long physicalNetworkId;
@Parameter(name=ApiConstants.SUPPORTED_SERVICES, type=CommandType.LIST, collectionType=CommandType.STRING, description="list network offerings supporting certain services")
@Parameter(name=ApiConstants.SUPPORTED_SERVICES, type=CommandType.LIST, collectionType=CommandType.STRING, description="list networks supporting certain services")
private List<String> supportedServices;
@Parameter(name=ApiConstants.RESTART_REQUIRED, type=CommandType.BOOLEAN, description="list networks by restartRequired")
private Boolean restartRequired;
@Parameter(name=ApiConstants.SPECIFY_IP_RANGES, type=CommandType.BOOLEAN, description="true if need to list only networks which support specifying ip ranges")
@ -76,6 +77,9 @@ public class ListNetworksCmd extends BaseListProjectAndAccountResourcesCmd {
@Parameter(name=ApiConstants.VPC_ID, type=CommandType.LONG, description="List networks by VPC")
private Long vpcId;
@Parameter(name=ApiConstants.CAN_USE_FOR_DEPLOY, type=CommandType.BOOLEAN, description="list networks available for vm deployment")
private Boolean canUseForDeploy;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@ -124,6 +128,10 @@ public class ListNetworksCmd extends BaseListProjectAndAccountResourcesCmd {
return vpcId;
}
public Boolean canUseForDeploy() {
return canUseForDeploy;
}
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////

View File

@ -0,0 +1,94 @@
// Copyright 2012 Citrix Systems, Inc. Licensed under the
// Apache License, Version 2.0 (the "License"); you may not use this
// file except in compliance with the License. Citrix Systems, Inc.
// reserves all rights not expressly granted by 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.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.api.commands;
import java.util.ArrayList;
import java.util.List;
import com.cloud.api.ApiConstants;
import com.cloud.api.BaseListProjectAndAccountResourcesCmd;
import com.cloud.api.Implementation;
import com.cloud.api.Parameter;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.ResourceTagResponse;
import com.cloud.server.ResourceTag;
/**
* @author Alena Prokharchyk
*/
@Implementation(description = "List resource tag(s)", responseObject = ResourceTagResponse.class, since = "Burbank")
public class ListTagsCmd extends BaseListProjectAndAccountResourcesCmd{
private static final String s_name = "listtagsresponse";
@Parameter(name=ApiConstants.RESOURCE_TYPE, type=CommandType.STRING, description="list by resource type")
private String resourceType;
@Parameter(name=ApiConstants.RESOURCE_ID, type=CommandType.STRING, description="list by resource id")
private String resourceId;
@Parameter(name=ApiConstants.KEY, type=CommandType.STRING, description="list by key")
private String key;
@Parameter(name=ApiConstants.VALUE, type=CommandType.STRING, description="list by value")
private String value;
@Parameter(name=ApiConstants.CUSTOMER, type=CommandType.STRING, description="list by customer name")
private String customer;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@Override
public void execute() {
List<? extends ResourceTag> tags = _taggedResourceService.listTags(this);
ListResponse<ResourceTagResponse> response = new ListResponse<ResourceTagResponse>();
List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();
for (ResourceTag tag : tags) {
ResourceTagResponse tagResponse = _responseGenerator.createResourceTagResponse(tag);
tagResponses.add(tagResponse);
}
response.setResponses(tagResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
public String getResourceType() {
return resourceType;
}
public String getResourceId() {
return resourceId;
}
public String getKey() {
return key;
}
public String getValue() {
return value;
}
@Override
public String getCommandName() {
return s_name;
}
public String getCustomer() {
return customer;
}
}

View File

@ -134,6 +134,9 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
@SerializedName(ApiConstants.VPC_ID) @Param(description="VPC the network belongs to")
private IdentityProxy vpcId = new IdentityProxy("vpc");
@SerializedName(ApiConstants.CAN_USE_FOR_DEPLOY) @Param(description="list networks available for vm deployment")
private Boolean canUseForDeploy;
public void setId(Long id) {
this.id.setValue(id);
}
@ -279,4 +282,8 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
public void setVpcId(Long vpcId) {
this.vpcId.setValue(vpcId);
}
public void setCanUseForDeploy(Boolean canUseForDeploy) {
this.canUseForDeploy = canUseForDeploy;
}
}

View File

@ -0,0 +1,100 @@
// Copyright 2012 Citrix Systems, Inc. Licensed under the
// Apache License, Version 2.0 (the "License"); you may not use this
// file except in compliance with the License. Citrix Systems, Inc.
// reserves all rights not expressly granted by 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.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.api.response;
import com.cloud.api.ApiConstants;
import com.cloud.serializer.Param;
import com.cloud.utils.IdentityProxy;
import com.google.gson.annotations.SerializedName;
/**
* @author Alena Prokharchyk
*/
@SuppressWarnings("unused")
public class ResourceTagResponse extends BaseResponse implements ControlledEntityResponse{
@SerializedName(ApiConstants.KEY) @Param(description="tag key name")
private String key;
@SerializedName(ApiConstants.VALUE) @Param(description="tag value")
private String value;
@SerializedName(ApiConstants.RESOURCE_TYPE) @Param(description="resource type")
private String resourceType;
@SerializedName(ApiConstants.RESOURCE_ID) @Param(description="id of the resource")
private String id;
@SerializedName(ApiConstants.ACCOUNT)
@Param(description = "the account associated with the tag")
private String accountName;
@SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id the tag belongs to")
private IdentityProxy projectId = new IdentityProxy("projects");
@SerializedName(ApiConstants.PROJECT) @Param(description="the project name where tag belongs to")
private String projectName;
@SerializedName(ApiConstants.DOMAIN_ID)
@Param(description = "the ID of the domain associated with the tag")
private IdentityProxy domainId = new IdentityProxy("domain");
@SerializedName(ApiConstants.DOMAIN)
@Param(description = "the domain associated with the tag")
private String domainName;
@SerializedName(ApiConstants.CUSTOMER) @Param(description="customer associated with the tag")
private String customer;
public void setKey(String key) {
this.key = key;
}
public void setValue(String value) {
this.value = value;
}
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
public void setId(String id) {
this.id = id;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public void setDomainId(Long domainId) {
this.domainId.setValue(domainId);
}
public void setDomainName(String domainName) {
this.domainName = domainName;
}
@Override
public void setProjectId(Long projectId) {
this.projectId.setValue(projectId);
}
@Override
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public void setCustomer(String customer) {
this.customer = customer;
}
}

View File

@ -278,4 +278,9 @@ public class EventTypes {
// Static routes
public static final String EVENT_STATIC_ROUTE_CREATE = "STATIC.ROUTE.CREATE";
public static final String EVENT_STATIC_ROUTE_DELETE = "STATIC.ROUTE.DELETE";
// tag related events
public static final String EVENT_TAGS_CREATE = "CREATE_TAGS";
public static final String EVENT_TAGS_DELETE = "DELETE_TAGS";
}

View File

@ -168,5 +168,9 @@ public interface NetworkService {
Network createPrivateNetwork(String networkName, String displayText, long physicalNetworkId, String vlan,
String startIp, String endIP, String gateway, String netmask, long networkOwnerId)
throws ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException;
/**
* @param network
* @return
*/
boolean canUseForDeploy(Network network);
}

View File

@ -31,6 +31,7 @@ import com.cloud.api.commands.UpdateHostCmd;
import com.cloud.api.commands.UpdateHostPasswordCmd;
import com.cloud.exception.DiscoveryException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceInUseException;
import com.cloud.host.Host;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.org.Cluster;
@ -61,7 +62,7 @@ public interface ResourceService {
* @throws IllegalArgumentException
* @throws DiscoveryException
*/
List<? extends Cluster> discoverCluster(AddClusterCmd cmd) throws IllegalArgumentException, DiscoveryException;
List<? extends Cluster> discoverCluster(AddClusterCmd cmd) throws IllegalArgumentException, DiscoveryException, ResourceInUseException;
boolean deleteCluster(DeleteClusterCmd cmd);

View File

@ -0,0 +1,66 @@
// Copyright 2012 Citrix Systems, Inc. Licensed under the
// Apache License, Version 2.0 (the "License"); you may not use this
// file except in compliance with the License. Citrix Systems, Inc.
// reserves all rights not expressly granted by 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.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.server;
import com.cloud.acl.ControlledEntity;
/**
* @author Alena Prokharchyk
*/
public interface ResourceTag extends ControlledEntity{
public enum TaggedResourceType {
UserVm,
Template,
ISO,
Volume,
Snapshot,
Network,
LoadBalancer,
PortForwardingRule,
FirewallRule,
SecurityGroup,
PublicIpAddress
}
/**
* @return
*/
long getId();
/**
* @return
*/
String getKey();
/**
* @return
*/
String getValue();
/**
* @return
*/
long getResourceId();
/**
* @return
*/
TaggedResourceType getResourceType();
/**
* @return
*/
String getCustomer();
}

View File

@ -0,0 +1,57 @@
// Copyright 2012 Citrix Systems, Inc. Licensed under the
// Apache License, Version 2.0 (the "License"); you may not use this
// file except in compliance with the License. Citrix Systems, Inc.
// reserves all rights not expressly granted by 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.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.server;
import java.util.List;
import java.util.Map;
import com.cloud.api.commands.ListTagsCmd;
import com.cloud.server.ResourceTag.TaggedResourceType;
/**
* @author Alena Prokharchyk
*/
public interface TaggedResourceService {
TaggedResourceType getResourceType (String resourceTypeStr);
/**
* @param resourceIds TODO
* @param resourceType
* @param tags
* @param customer TODO
* @return
*/
List<ResourceTag> createTags(List<String> resourceIds, TaggedResourceType resourceType, Map<String, String> tags, String customer);
/**
* @param resourceId
* @param resourceType
* @return
*/
String getUuid(String resourceId, TaggedResourceType resourceType);
/**
* @param listTagsCmd
* @return
*/
List<? extends ResourceTag> listTags(ListTagsCmd listTagsCmd);
/**
* @param resourceIds
* @param resourceType
* @param tags
* @return
*/
boolean deleteTags(List<String> resourceIds, TaggedResourceType resourceType, Map<String, String> tags);
}

View File

@ -23,6 +23,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.URLEncoder;
import java.security.KeyStore;
import java.security.SignatureException;
import java.security.cert.Certificate;
@ -178,7 +179,7 @@ public class EC2RestServlet extends HttpServlet {
}
String keystore = EC2Prop.getProperty( "keystore" );
keystorePassword = EC2Prop.getProperty( "keystorePass" );
wsdlVersion = EC2Prop.getProperty( "WSDLVersion", "2009-11-30" );
wsdlVersion = EC2Prop.getProperty( "WSDLVersion", "2010-11-15" );
version = EC2Prop.getProperty( "cloudbridgeVersion", "UNKNOWN VERSION" );
String installedPath = System.getenv("CATALINA_HOME");
@ -1710,13 +1711,32 @@ public class EC2RestServlet extends HttpServlet {
restAuth.setHostHeader( request.getHeader( "Host" ));
String requestUri = request.getRequestURI();
//If forwarded from another basepath:
// If forwarded from another basepath:
String forwardedPath = (String) request.getAttribute("javax.servlet.forward.request_uri");
if(forwardedPath!=null){
requestUri=forwardedPath;
}
restAuth.setHTTPRequestURI( requestUri);
restAuth.setQueryString( request.getQueryString());
String queryString = request.getQueryString();
// getQueryString returns null (does it ever NOT return null for these),
// we need to construct queryString to avoid changing the auth code...
if (queryString == null) {
// construct our idea of a queryString with parameters!
Enumeration<?> params = request.getParameterNames();
if (params != null) {
while(params.hasMoreElements()) {
String paramName = (String) params.nextElement();
// exclude the signature string obviously. ;)
if (paramName.equalsIgnoreCase("Signature")) continue;
if (queryString == null)
queryString = paramName + "=" + request.getParameter(paramName);
else
queryString = queryString + "&" + paramName + "=" + URLEncoder.encode(request.getParameter(paramName), "UTF-8");
}
}
}
restAuth.setQueryString(queryString);
if ( restAuth.verifySignature( request.getMethod(), cloudSecretKey, signature, sigMethod )) {
UserContext.current().initContext( cloudAccessKey, cloudSecretKey, cloudAccessKey, "REST request", null );

View File

@ -18,13 +18,16 @@ package com.cloud.bridge.service.core.ec2;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import com.cloud.bridge.service.UserContext;
import com.cloud.bridge.service.exception.EC2ServiceException;
import com.cloud.bridge.util.DateHelper;
import com.cloud.bridge.util.EC2RestAuth;
public class EC2SnapshotFilterSet {
@ -121,7 +124,12 @@ public class EC2SnapshotFilterSet {
}
else if (filterName.equalsIgnoreCase( "status" ))
{
if ( snap.getState().equalsIgnoreCase("backedup"))
return containsString( "completed", valueSet );
else if (snap.getState().equalsIgnoreCase("creating") || snap.getState().equalsIgnoreCase("backingup"))
return containsString( "pending", valueSet );
else
return containsString( "error", valueSet );
}
else if (filterName.equalsIgnoreCase( "volume-id" ))
{
@ -160,11 +168,14 @@ public class EC2SnapshotFilterSet {
private boolean containsTime( Calendar lookingFor, String[] set ) throws ParseException
{
lookingFor.setTimeZone(TimeZone.getTimeZone("GMT"));
Date lookingForDate = lookingFor.getTime();
for (String s : set) {
//System.out.println( "contsinsCalendar: " + lookingFor + " " + set[i] );
Calendar toMatch = Calendar.getInstance();
toMatch.setTime( DateHelper.parseISO8601DateString( s ));
if (0 == lookingFor.compareTo( toMatch )) return true;
Calendar toMatch = EC2RestAuth.parseDateString(s);
toMatch.setTimeZone(TimeZone.getTimeZone("GMT"));
Date toMatchDate = toMatch.getTime();
if ( 0 == lookingForDate.compareTo(toMatchDate)) return true;
}
return false;
}

View File

@ -285,7 +285,6 @@
</copy>
</target>
<target name="build-ovm" depends="compile-ovm" />
<target name="build-server" depends="compile-server">
<mkdir dir="${server.dist.dir}" />
@ -480,7 +479,7 @@
<target name="build-servers" depends="-init, build-server" />
<target name="build-opensource" depends="-init, build-server, build-agent, build-scripts, build-ui, build-ovm, package-oss-systemvm-iso">
<target name="build-opensource" depends="-init, build-server, build-agent, build-scripts, build-ui, build-console-proxy, build-ovm, package-oss-systemvm-iso, build-netscaler, build-f5, build-srx, build-dp-user-dispersing, build-dp-user-concentrated-pod, build-host-allocator-random, build-user-authenticator-ldap">
<copy overwrite="true" todir="${dist.dir}">
<fileset dir="${base.dir}/build/deploy/">
<include name="deploy-agent.sh" />
@ -587,23 +586,58 @@
<delete dir="${unittest.dir}"/>
</target>
<!-- ===================== Ovm.Jar ===================== -->
<property name="ovm.jar" value="cloud-ovm.jar" />
<property name="ovm.dir" location="${base.dir}/ovm" />
<property name="ovm-scripts.dir" location="${ovm.dir}/scripts" />
<path id="ovm.classpath" >
<path refid="deps.classpath" />
<path refid="dist.classpath" />
</path>
<target name="compile-ovm" depends="-init, compile-server" description="Compile OVM">
<compile-java jar.name="${ovm.jar}" top.dir="${ovm.dir}" classpath="ovm.classpath" />
</target>
<target name="compile-all" description="Compile all of the jars" depends="compile-utils, compile-api, compile-core, compile-server, compile-ovm"/>
<target name="compile-all" description="Compile all of the jars" depends="compile-utils, compile-api, compile-core, compile-server, compile-ovm, compile-netscaler, compile-f5, compile-srx, compile-dp-user-dispersing, compile-dp-user-concentrated-pod, compile-host-allocator-random, compile-host-allocator-random"/>
<target name="clean-all" depends="clean, clean-awsapi" description="Clean all of the generated files, including dependency cache and javadoc">
<delete dir="${target.dir}" />
</target>
<!-- ===================== Ovm.Jar ===================== -->
<target name="compile-ovm" depends="-init, compile-server" description="Compile OVM">
<ant antfile="${base.dir}/plugins/hypervisors/ovm/build.xml" target="build"/>
</target>
<target name="build-ovm" depends="compile-ovm" />
<!-- =====================cloud-dp-user-dispersing.Jar ===================== -->
<target name="compile-dp-user-dispersing" depends="-init, compile-server" description="Compile dp-user-dispersing">
<ant antfile="${base.dir}/plugins/deployment-planners/user-dispersing/build.xml" target="build"/>
</target>
<target name="build-dp-user-dispersing" depends="compile-dp-user-dispersing" />
<!-- =====================cloud-dp-user-concentrated-pod.Jar ===================== -->
<target name="compile-dp-user-concentrated-pod" depends="-init, compile-server" description="Compile ">
<ant antfile="${base.dir}/plugins/deployment-planners/user-concentrated-pod/build.xml" target="build"/>
</target>
<target name="build-dp-user-concentrated-pod" depends="compile-dp-user-concentrated-pod" />
<!-- =====================cloud-host-allocator-random.jar ===================== -->
<target name="compile-host-allocator-random" depends="-init, compile-server" description="Compile ">
<ant antfile="${base.dir}/plugins/host-allocators/random/build.xml" target="build"/>
</target>
<target name="build-host-allocator-random" depends="compile-host-allocator-random" />
<!-- =====================cloud-user-authenticator-ldap.jar ===================== -->
<target name="compile-user-authenticator-ldap" depends="-init, compile-server" description="Compile ">
<ant antfile="${base.dir}/plugins/user-authenticators/ldap/build.xml" target="build"/>
</target>
<target name="build-user-authenticator-ldap" depends="compile-user-authenticator-ldap" />
<!-- ===================== Cloud-Plugin-Netscaler.Jar ===================== -->
<target name="compile-netscaler" depends="-init, compile-server" description="Compile NetScaler plugin">
<ant antfile="${base.dir}/plugins/network-elements/netscaler/build.xml" target="build"/>
</target>
<target name="build-netscaler" depends="compile-netscaler"/>
<!-- ===================== Cloud-Plugin-F5.Jar ===================== -->
<target name="compile-f5" depends="-init, compile-server" description="Compile F5 plugin">
<ant antfile="${base.dir}/plugins/network-elements/f5/build.xml" target="build"/>
</target>
<target name="build-f5" depends="compile-f5"/>
<!-- ===================== Cloud-Plugin-Srx.Jar ===================== -->
<target name="compile-srx" depends="-init, compile-server" description="Compile SRX plugin">
<ant antfile="${base.dir}/plugins/network-elements/juniper-srx/build.xml" target="build"/>
</target>
<target name="build-srx" depends="compile-srx"/>
</project>

View File

@ -73,7 +73,7 @@
<manifest>
<attribute name="Class-Path" value="" />
<attribute name="Built-By" value="${built.by}" />
<attribute name="Specification-Title" value="VMOps Cloud Stack" />
<attribute name="Specification-Title" value="Apache Cloud Stack" />
<attribute name="Specification-Version" value="${impl.version}" />
<attribute name="Specification-Vendor" value="${company.name}" />
<attribute name="Implementation-Title" value="@{jar.name}" />

View File

@ -36,8 +36,6 @@
<property name="unittest.target.dir" location="${unittest.dir}/classes"/>
<property name="unittest.jar.dir" location="${unittest.dir}/jar"/>
<property name="ovm.dir" location="${base.dir}/ovm" />
<property name="ovm-scripts.dir" location="${ovm.dir}/scripts" />
<!-- directories for api doc -->
<property name="api.docs.dir" location="${dist.dir}/apidocs" />
@ -163,11 +161,7 @@
</target>
<target name="deploy-ovm" >
<copy todir="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/scripts">
<fileset dir="${ovm-scripts.dir}">
<include name="**/*"/>
</fileset>
</copy>
<ant antfile="${base.dir}/plugins/hypervisors/ovm/build.xml" target="deploy-ovm"/>
</target>
<target name="deploy-server" depends="deploy-common, deploy-ovm, deploy-awsapi" >

View File

@ -226,6 +226,7 @@
<include name="${api.jar}" />
<include name="${vmware-base.jar}" />
</zipfileset>
<zipfileset dir="${console-proxy.dist.dir}" filemode="555"/>
<zipfileset dir="${scripts.dir}/storage/secondary" prefix="scripts/storage/secondary" filemode="555">
<exclude name="**/.project" />
<exclude name="**/.classpath" />

View File

@ -1,10 +0,0 @@
DBUSER=cloud
DBPW=cloud
MSLOG=vmops.log
APISERVERLOG=api.log
DBHOST=localhost
AGENTLOGDIR=logs
AGENTLOG=logs/agent.log
MSMNTDIR=/mnt
COMPONENTS-SPEC=components-premium.xml
AWSAPILOG=awsapi.log

View File

@ -333,6 +333,7 @@ addNetworkDevice=com.cloud.api.commands.AddNetworkDeviceCmd;1
listNetworkDevice=com.cloud.api.commands.ListNetworkDeviceCmd;1
deleteNetworkDevice=com.cloud.api.commands.DeleteNetworkDeviceCmd;1
<<<<<<< HEAD
### Network Devices commands
addNetworkDevice=com.cloud.api.commands.AddNetworkDeviceCmd;1
listNetworkDevice=com.cloud.api.commands.ListNetworkDeviceCmd;1
@ -365,3 +366,8 @@ listNetworkACLs=com.cloud.api.commands.ListNetworkACLsCmd;15
createStaticRoute=com.cloud.api.commands.CreateStaticRouteCmd;15
deleteStaticRoute=com.cloud.api.commands.DeleteStaticRouteCmd;15
listStaticRoutes=com.cloud.api.commands.ListStaticRoutesCmd;15
#### Tags commands
createTags=com.cloud.api.commands.CreateTagsCmd;15
deleteTags=com.cloud.api.commands.DeleteTagsCmd;15
listTags=com.cloud.api.commands.ListTagsCmd;15

View File

@ -160,6 +160,10 @@
<adapter name="BasicAgentAuthorizer" class="com.cloud.agent.manager.authn.impl.BasicAgentAuthManager"/>
</adapters>
<pluggableservice name="VirtualRouterElementService" key="com.cloud.network.element.VirtualRouterElementService" class="com.cloud.network.element.VirtualRouterElement"/>
<pluggableservice name="NetscalerExternalLoadBalancerElementService" key="com.cloud.network.element.NetscalerLoadBalancerElementService" class="com.cloud.network.element.NetscalerElement"/>
<pluggableservice name="F5ExternalLoadBalancerElementService" key="com.cloud.network.element.F5ExternalLoadBalancerElementService" class="com.cloud.network.element.F5ExternalLoadBalancerElement"/>
<pluggableservice name="JuniperSRXFirewallElementService" key="com.cloud.network.element.JuniperSRXFirewallElementService" class="com.cloud.network.element.JuniperSRXExternalFirewallElement"/>
<dao name="NetScalerPodDao" class="com.cloud.network.dao.NetScalerPodDaoImpl" singleton="false"/>
</management-server>
<configuration-server class="com.cloud.server.ConfigurationServerImpl">

View File

@ -9,7 +9,7 @@
<!-- A time/date based rolling appender -->
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="cloud.log"/>
<param name="File" value="/var/log/cloud/systemvm.log"/>
<param name="Append" value="true"/>
<param name="Threshold" value="DEBUG"/>

View File

@ -1133,6 +1133,27 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
return cdromVBD;
}
protected void destroyPatchVbd(Connection conn, String vmName) throws XmlRpcException, XenAPIException {
try {
if( !vmName.startsWith("r-") && !vmName.startsWith("s-") && !vmName.startsWith("v-") ) {
return;
}
Set<VM> vms = VM.getByNameLabel(conn, vmName);
for ( VM vm : vms ) {
Set<VBD> vbds = vm.getVBDs(conn);
for( VBD vbd : vbds ) {
if (vbd.getType(conn) == Types.VbdType.CD ) {
vbd.eject(conn);
vbd.destroy(conn);
break;
}
}
}
} catch (Exception e) {
s_logger.debug("Cannot destory CD-ROM device for VM " + vmName + " due to " + e.toString(), e);
}
}
protected CheckSshAnswer execute(CheckSshCommand cmd) {
Connection conn = getConnection();
String vmName = cmd.getName();
@ -1148,6 +1169,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
if (result != null) {
return new CheckSshAnswer(cmd, "Can not ping System vm " + vmName + "due to:" + result);
}
destroyPatchVbd(conn, vmName);
} catch (Exception e) {
return new CheckSshAnswer(cmd, e);
}
@ -2712,7 +2734,15 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
callHostPlugin(conn, "vmopsSnapshot", "unmountSnapshotsDir", "dcId", dcId.toString());
setupLinkLocalNetwork(conn);
// try to destroy CD-ROM device for all system VMs on this host
try {
Host host = Host.getByUuid(conn, _host.uuid);
Set<VM> vms = host.getResidentVMs(conn);
for ( VM vm : vms ) {
destroyPatchVbd(conn, vm.getNameLabel(conn));
}
} catch (Exception e) {
}
try {
boolean result = cleanupHaltedVms(conn);
if (!result) {

View File

@ -39,7 +39,6 @@ import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.params.HttpMethodParams;
import org.apache.log4j.Logger;
import org.jnetpcap.util.resolver.Resolver.ResolverType;
import com.cloud.agent.api.storage.DownloadCommand.Proxy;
import com.cloud.agent.api.storage.DownloadCommand.ResourceType;

View File

2
debian/control vendored
View File

@ -142,7 +142,7 @@ Provides: vmops-agent
Conflicts: vmops-agent
Replaces: vmops-agent
Architecture: any
Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-agent-deps (= ${source:Version}), python, cloud-python (= ${source:Version}), cloud-agent-libs (= ${source:Version}), cloud-agent-scripts (= ${source:Version}), libcommons-httpclient-java, libcommons-collections-java, libcommons-dbcp-java, libcommons-pool-java, libcommons-logging-java, libvirt0, cloud-daemonize, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, jnetpcap, ebtables, vlan, libcglib-java, libcommons-httpclient-java, libservlet2.5-java, liblog4j1.2-java, libjna-java, wget
Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-agent-deps (= ${source:Version}), python, cloud-python (= ${source:Version}), cloud-agent-libs (= ${source:Version}), cloud-agent-scripts (= ${source:Version}), libcommons-httpclient-java, libcommons-collections-java, libcommons-dbcp-java, libcommons-pool-java, libcommons-logging-java, libvirt0, cloud-daemonize, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, ebtables, vlan, libcglib-java, libcommons-httpclient-java, libservlet2.5-java, liblog4j1.2-java, libjna-java, wget
Description: CloudStack agent
The CloudStack agent is in charge of managing shared computing resources in
a CloudStack Cloud Stack-powered cloud. Install this package if this computer

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/api"/>
<classpathentry combineaccessrules="false" kind="src" path="/core"/>
<classpathentry combineaccessrules="false" kind="src" path="/server"/>
<classpathentry combineaccessrules="false" kind="src" path="/utils"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>user-concentrated-pod-dp</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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 name="Cloud Stack User Concentrated Pod Deployment Planner" default="help" basedir=".">
<description>
Cloud Stack ant build file
</description>
<dirname property="dp-user-concentrated-pod.base.dir" file="${ant.file.Cloud Stack User Concentrated Pod Deployment Planner}/"/>
<!-- This directory must be set -->
<property name="top.dir" location="${dp-user-concentrated-pod.base.dir}/../../.."/>
<property name="build.dir" location="${top.dir}/build"/>
<echo message="build.dir=${build.dir}; top.dir=${top.dir}; dp-user-concentrated-pod.base.dir=${dp-user-concentrated-pod.base.dir}"/>
<!-- Import anything that the user wants to set-->
<!-- Import properties files and environment variables here -->
<property environment="env" />
<condition property="build-cloud.properties.file" value="${build.dir}/override/build-cloud.properties" else="${build.dir}/build-cloud.properties">
<available file="${build.dir}/override/build-cloud.properties" />
</condition>
<condition property="cloud.properties.file" value="${build.dir}/override/cloud.properties" else="${build.dir}/cloud.properties">
<available file="${build.dir}/override/cloud.properties" />
</condition>
<condition property="override.file" value="${build.dir}/override/replace.properties" else="${build.dir}/replace.properties">
<available file="${build.dir}/override/replace.properties" />
</condition>
<echo message="Using build parameters from ${build-cloud.properties.file}" />
<property file="${build-cloud.properties.file}" />
<echo message="Using company info from ${cloud.properties.file}" />
<property file="${cloud.properties.file}" />
<echo message="Using override file from ${override.file}" />
<property file="${override.file}" />
<property file="${build.dir}/build.number" />
<!-- In case these didn't get defined in the build-cloud.properties -->
<property name="branding.name" value="default" />
<property name="deprecation" value="off" />
<property name="target.compat.version" value="1.6" />
<property name="source.compat.version" value="1.6" />
<property name="debug" value="true" />
<property name="debuglevel" value="lines,source"/>
<echo message="target.dir=${target.dir}; top.dir=${top.dir}"/>
<!-- directories for build and distribution -->
<property name="target.dir" location="${top.dir}/target" />
<property name="classes.dir" location="${target.dir}/classes" />
<property name="jar.dir" location="${target.dir}/jar" />
<property name="dep.cache.dir" location="${target.dir}/dep-cache" />
<property name="build.log" location="${target.dir}/ant_verbose.txt" />
<property name="deps.dir" location="${top.dir}/deps" />
<property name="dp-user-concentrated-pod.jar" value="cloud-dp-user-concentrated-pod.jar" />
<property name="dp-user-concentrated-pod-scripts.dir" location="${dp-user-concentrated-pod.base.dir}/scripts" />
<import file="${build.dir}/build-common.xml"/>
<echo message="target.dir=${target.dir}; top.dir=${top.dir}"/>
<!-- This section needs to be replaced by some kind of dependency library-->
<path id="deps.classpath">
<!--filelist files="${deps.classpath}" /-->
<fileset dir="${deps.dir}" erroronmissingdir="false">
<include name="*.jar" />
</fileset>
</path>
<path id="cloudstack.classpath">
<fileset dir="${jar.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="dp-user-concentrated-pod.classpath">
<path refid="deps.classpath"/>
<path refid="cloudstack.classpath"/>
</path>
<!-- This section needs to be replaced by some kind of dependency library-->
<target name="init" description="Initialize binaries directory">
<mkdir dir="${classes.dir}/${user-concentrated-pod.jar}"/>
<mkdir dir="${jar.dir}"/>
</target>
<target name="compile-dp-user-concentrated-pod" depends="init" description="Compile user-concentrated-pod">
<compile-java jar.name="${dp-user-concentrated-pod.jar}" top.dir="${dp-user-concentrated-pod.base.dir}" classpath="dp-user-concentrated-pod.classpath" />
</target>
<target name="help" description="help">
<echo level="info" message="This is the build file for dp-user-concentrated-pod."/>
<echo level="info" message="You can do a build by doing ant build or clean by ant clean" />
</target>
<target name="clean-dp-user-concentrated-pod">
<delete dir="${classes.dir}/${dp-user-concentrated-pod.jar}"/>
</target>
<target name="build" depends="compile-dp-user-concentrated-pod"/>
<target name="clean" depends="clean-dp-user-concentrated-pod"/>
</project>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/api"/>
<classpathentry combineaccessrules="false" kind="src" path="/core"/>
<classpathentry combineaccessrules="false" kind="src" path="/server"/>
<classpathentry combineaccessrules="false" kind="src" path="/utils"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>user-dispersing</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,12 @@
#Tue Jun 19 15:34:37 PDT 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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 name="Cloud Stack User Dispersing Deployment Planner" default="help" basedir=".">
<description>
Cloud Stack ant build file
</description>
<dirname property="dp-user-dispersing.base.dir" file="${ant.file.Cloud Stack User Dispersing Deployment Planner}/"/>
<!-- This directory must be set -->
<property name="top.dir" location="${dp-user-dispersing.base.dir}/../../.."/>
<property name="build.dir" location="${top.dir}/build"/>
<echo message="build.dir=${build.dir}; top.dir=${top.dir}; dp-user-dispersing.base.dir=${dp-user-dispersing.base.dir}"/>
<!-- Import anything that the user wants to set-->
<!-- Import properties files and environment variables here -->
<property environment="env" />
<condition property="build-cloud.properties.file" value="${build.dir}/override/build-cloud.properties" else="${build.dir}/build-cloud.properties">
<available file="${build.dir}/override/build-cloud.properties" />
</condition>
<condition property="cloud.properties.file" value="${build.dir}/override/cloud.properties" else="${build.dir}/cloud.properties">
<available file="${build.dir}/override/cloud.properties" />
</condition>
<condition property="override.file" value="${build.dir}/override/replace.properties" else="${build.dir}/replace.properties">
<available file="${build.dir}/override/replace.properties" />
</condition>
<echo message="Using build parameters from ${build-cloud.properties.file}" />
<property file="${build-cloud.properties.file}" />
<echo message="Using company info from ${cloud.properties.file}" />
<property file="${cloud.properties.file}" />
<echo message="Using override file from ${override.file}" />
<property file="${override.file}" />
<property file="${build.dir}/build.number" />
<!-- In case these didn't get defined in the build-cloud.properties -->
<property name="branding.name" value="default" />
<property name="deprecation" value="off" />
<property name="target.compat.version" value="1.6" />
<property name="source.compat.version" value="1.6" />
<property name="debug" value="true" />
<property name="debuglevel" value="lines,source"/>
<echo message="target.dir=${target.dir}; top.dir=${top.dir}"/>
<!-- directories for build and distribution -->
<property name="target.dir" location="${top.dir}/target" />
<property name="classes.dir" location="${target.dir}/classes" />
<property name="jar.dir" location="${target.dir}/jar" />
<property name="dep.cache.dir" location="${target.dir}/dep-cache" />
<property name="build.log" location="${target.dir}/ant_verbose.txt" />
<property name="deps.dir" location="${top.dir}/deps" />
<property name="dp-user-dispersing.jar" value="cloud-dp-user-dispersing.jar" />
<property name="dp-user-dispersing-scripts.dir" location="${dp-user-dispersing.base.dir}/scripts" />
<import file="${build.dir}/build-common.xml"/>
<echo message="target.dir=${target.dir}; top.dir=${top.dir}"/>
<!-- This section needs to be replaced by some kind of dependency library-->
<path id="deps.classpath">
<!--filelist files="${deps.classpath}" /-->
<fileset dir="${deps.dir}" erroronmissingdir="false">
<include name="*.jar" />
</fileset>
</path>
<path id="cloudstack.classpath">
<fileset dir="${jar.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="dp-user-dispersing.classpath">
<path refid="deps.classpath"/>
<path refid="cloudstack.classpath"/>
</path>
<!-- This section needs to be replaced by some kind of dependency library-->
<target name="init" description="Initialize binaries directory">
<mkdir dir="${classes.dir}/${dp-user-dispersing.jar}"/>
<mkdir dir="${jar.dir}"/>
</target>
<target name="compile-dp-user-dispersing" depends="init" description="Compile dp-user-dispersing">
<compile-java jar.name="${dp-user-dispersing.jar}" top.dir="${dp-user-dispersing.base.dir}" classpath="dp-user-dispersing.classpath" />
</target>
<target name="help" description="help">
<echo level="info" message="This is the build file for dp-user-dispersing"/>
<echo level="info" message="You can do a build by doing ant build or clean by ant clean" />
</target>
<target name="clean-dp-user-dispersing">
<delete dir="${classes.dir}/${dp-user-dispersing.jar}"/>
</target>
<target name="build" depends="compile-dp-user-dispersing"/>
<target name="clean" depends="clean-dp-user-dispersing"/>
</project>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/api"/>
<classpathentry combineaccessrules="false" kind="src" path="/core"/>
<classpathentry combineaccessrules="false" kind="src" path="/server"/>
<classpathentry combineaccessrules="false" kind="src" path="/utils"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>random-host-allocator</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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 name="Cloud Stack Random Host Allocator" default="help" basedir=".">
<description>
Cloud Stack ant build file
</description>
<dirname property="host-allocator-random.base.dir" file="${ant.file.Cloud Stack Random Host Allocator}/"/>
<!-- This directory must be set -->
<property name="top.dir" location="${host-allocator-random.base.dir}/../../.."/>
<property name="build.dir" location="${top.dir}/build"/>
<echo message="build.dir=${build.dir}; top.dir=${top.dir}; host-allocator-random.base.dir=${host-allocator-random.base.dir}"/>
<!-- Import anything that the user wants to set-->
<!-- Import properties files and environment variables here -->
<property environment="env" />
<condition property="build-cloud.properties.file" value="${build.dir}/override/build-cloud.properties" else="${build.dir}/build-cloud.properties">
<available file="${build.dir}/override/build-cloud.properties" />
</condition>
<condition property="cloud.properties.file" value="${build.dir}/override/cloud.properties" else="${build.dir}/cloud.properties">
<available file="${build.dir}/override/cloud.properties" />
</condition>
<condition property="override.file" value="${build.dir}/override/replace.properties" else="${build.dir}/replace.properties">
<available file="${build.dir}/override/replace.properties" />
</condition>
<echo message="Using build parameters from ${build-cloud.properties.file}" />
<property file="${build-cloud.properties.file}" />
<echo message="Using company info from ${cloud.properties.file}" />
<property file="${cloud.properties.file}" />
<echo message="Using override file from ${override.file}" />
<property file="${override.file}" />
<property file="${build.dir}/build.number" />
<!-- In case these didn't get defined in the build-cloud.properties -->
<property name="branding.name" value="default" />
<property name="deprecation" value="off" />
<property name="target.compat.version" value="1.6" />
<property name="source.compat.version" value="1.6" />
<property name="debug" value="true" />
<property name="debuglevel" value="lines,source"/>
<echo message="target.dir=${target.dir}; top.dir=${top.dir}"/>
<!-- directories for build and distribution -->
<property name="target.dir" location="${top.dir}/target" />
<property name="classes.dir" location="${target.dir}/classes" />
<property name="jar.dir" location="${target.dir}/jar" />
<property name="dep.cache.dir" location="${target.dir}/dep-cache" />
<property name="build.log" location="${target.dir}/ant_verbose.txt" />
<property name="deps.dir" location="${top.dir}/deps" />
<property name="host-allocator-random.jar" value="cloud-host-allocator-random.jar" />
<property name="host-allocator-random-scripts.dir" location="${host-allocator-random.base.dir}/scripts" />
<import file="${build.dir}/build-common.xml"/>
<echo message="target.dir=${target.dir}; top.dir=${top.dir}"/>
<!-- This section needs to be replaced by some kind of dependency library-->
<path id="deps.classpath">
<!--filelist files="${deps.classpath}" /-->
<fileset dir="${deps.dir}" erroronmissingdir="false">
<include name="*.jar" />
</fileset>
</path>
<path id="cloudstack.classpath">
<fileset dir="${jar.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="host-allocator-random.classpath">
<path refid="deps.classpath"/>
<path refid="cloudstack.classpath"/>
</path>
<!-- This section needs to be replaced by some kind of dependency library-->
<target name="init" description="Initialize binaries directory">
<mkdir dir="${classes.dir}/${host-allocator-random.jar}"/>
<mkdir dir="${jar.dir}"/>
</target>
<target name="compile-host-allocator-random" depends="init" description="Compile host-allocator-random">
<compile-java jar.name="${host-allocator-random.jar}" top.dir="${host-allocator-random.base.dir}" classpath="host-allocator-random.classpath" />
</target>
<target name="help" description="help">
<echo level="info" message="This is the build file for host-allocator-random"/>
<echo level="info" message="You can do a build by doing ant build or clean by ant clean" />
</target>
<target name="clean-host-allocator-random">
<delete dir="${classes.dir}/${host-allocator-random.jar}"/>
</target>
<target name="build" depends="compile-host-allocator-random"/>
<target name="clean" depends="clean-host-allocator-random"/>
</project>

0
ovm/.classpath → plugins/hypervisors/ovm/.classpath Normal file → Executable file
View File

136
plugins/hypervisors/ovm/build.xml Executable file
View File

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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 name="Cloud Stack OVM" default="help" basedir=".">
<description>
Cloud Stack ant build file
</description>
<dirname property="ovm.base.dir" file="${ant.file.Cloud Stack OVM}/"/>
<!-- This directory must be set -->
<property name="top.dir" location="${ovm.base.dir}/../../.."/>
<property name="build.dir" location="${top.dir}/build"/>
<echo message="build.dir=${build.dir}; top.dir=${top.dir}; ovm.base.dir=${ovm.base.dir}"/>
<!-- Import anything that the user wants to set-->
<!-- Import properties files and environment variables here -->
<property environment="env" />
<condition property="build-cloud.properties.file" value="${build.dir}/override/build-cloud.properties" else="${build.dir}/build-cloud.properties">
<available file="${build.dir}/override/build-cloud.properties" />
</condition>
<condition property="cloud.properties.file" value="${build.dir}/override/cloud.properties" else="${build.dir}/cloud.properties">
<available file="${build.dir}/override/cloud.properties" />
</condition>
<condition property="override.file" value="${build.dir}/override/replace.properties" else="${build.dir}/replace.properties">
<available file="${build.dir}/override/replace.properties" />
</condition>
<echo message="Using build parameters from ${build-cloud.properties.file}" />
<property file="${build-cloud.properties.file}" />
<echo message="Using company info from ${cloud.properties.file}" />
<property file="${cloud.properties.file}" />
<echo message="Using override file from ${override.file}" />
<property file="${override.file}" />
<property file="${build.dir}/build.number" />
<!-- In case these didn't get defined in the build-cloud.properties -->
<property name="branding.name" value="default" />
<property name="deprecation" value="off" />
<property name="target.compat.version" value="1.6" />
<property name="source.compat.version" value="1.6" />
<property name="debug" value="true" />
<property name="debuglevel" value="lines,source"/>
<echo message="target.dir=${target.dir}; top.dir=${top.dir}"/>
<!-- directories for build and distribution -->
<property name="target.dir" location="${top.dir}/target" />
<property name="classes.dir" location="${target.dir}/classes" />
<property name="jar.dir" location="${target.dir}/jar" />
<property name="dep.cache.dir" location="${target.dir}/dep-cache" />
<property name="build.log" location="${target.dir}/ant_verbose.txt" />
<property name="deps.dir" location="${top.dir}/deps" />
<property name="ovm.jar" value="cloud-ovm.jar" />
<property name="ovm-scripts.dir" location="${base.dir}/plugins/hypervisors/ovm/scripts" />
<import file="${build.dir}/build-common.xml"/>
<echo message="target.dir=${target.dir}; top.dir=${top.dir}"/>
<!-- This section needs to be replaced by some kind of dependency library-->
<path id="deps.classpath">
<!--filelist files="${deps.classpath}" /-->
<fileset dir="${deps.dir}" erroronmissingdir="false">
<include name="*.jar" />
</fileset>
</path>
<path id="cloudstack.classpath">
<fileset dir="${jar.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="ovm.classpath">
<path refid="deps.classpath"/>
<path refid="cloudstack.classpath"/>
</path>
<!-- This section needs to be replaced by some kind of dependency library-->
<target name="deploy-ovm" >
<echo level="info" message="Copying OVM scripts from ${ovm-scripts.dir} to ${server.deploy.to.dir}/webapps/client/WEB-INF/lib/scripts" />
<copy todir="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/scripts">
<fileset dir="${ovm-scripts.dir}">
<include name="**/*"/>
</fileset>
</copy>
</target>
<target name="init" description="Initialize binaries directory">
<mkdir dir="${classes.dir}/${ovm.jar}"/>
<mkdir dir="${jar.dir}"/>
</target>
<target name="compile-ovm" depends="init" description="Compile OVM">
<compile-java jar.name="${ovm.jar}" top.dir="${ovm.base.dir}" classpath="ovm.classpath" />
</target>
<target name="help" description="help">
<echo level="info" message="This is the build file for OVM"/>
<echo level="info" message="You can do a build by doing ant build or clean by ant clean" />
</target>
<target name="clean-ovm">
<delete dir="${classes.dir}/${ovm.jar}"/>
</target>
<target name="build" depends="compile-ovm"/>
<target name="clean" depends="clean-ovm"/>
</project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/api"/>
<classpathentry combineaccessrules="false" kind="src" path="/core"/>
<classpathentry combineaccessrules="false" kind="src" path="/server"/>
<classpathentry combineaccessrules="false" kind="src" path="/utils"/>
<classpathentry combineaccessrules="false" kind="src" path="/deps"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>testClient</name>
<name>f5</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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 name="Cloud Stack F5 network element" default="help" basedir=".">
<description>
Cloud Stack ant build file
</description>
<dirname property="f5.base.dir" file="${ant.file.Cloud Stack F5 network element}/"/>
<!-- This directory must be set -->
<property name="top.dir" location="${f5.base.dir}/../../.."/>
<property name="build.dir" location="${top.dir}/build"/>
<echo message="build.dir=${build.dir}; top.dir=${top.dir}; f5.base.dir=${f5.base.dir}"/>
<!-- Import anything that the user wants to set-->
<!-- Import properties files and environment variables here -->
<property environment="env" />
<condition property="build-cloud.properties.file" value="${build.dir}/override/build-cloud.properties" else="${build.dir}/build-cloud.properties">
<available file="${build.dir}/override/build-cloud.properties" />
</condition>
<condition property="cloud.properties.file" value="${build.dir}/override/cloud.properties" else="${build.dir}/cloud.properties">
<available file="${build.dir}/override/cloud.properties" />
</condition>
<condition property="override.file" value="${build.dir}/override/replace.properties" else="${build.dir}/replace.properties">
<available file="${build.dir}/override/replace.properties" />
</condition>
<echo message="Using build parameters from ${build-cloud.properties.file}" />
<property file="${build-cloud.properties.file}" />
<echo message="Using company info from ${cloud.properties.file}" />
<property file="${cloud.properties.file}" />
<echo message="Using override file from ${override.file}" />
<property file="${override.file}" />
<property file="${build.dir}/build.number" />
<!-- In case these didn't get defined in the build-cloud.properties -->
<property name="branding.name" value="default" />
<property name="deprecation" value="off" />
<property name="target.compat.version" value="1.6" />
<property name="source.compat.version" value="1.6" />
<property name="debug" value="true" />
<property name="debuglevel" value="lines,source"/>
<echo message="target.dir=${target.dir}; top.dir=${top.dir}"/>
<!-- directories for build and distribution -->
<property name="target.dir" location="${top.dir}/target" />
<property name="classes.dir" location="${target.dir}/classes" />
<property name="jar.dir" location="${target.dir}/jar" />
<property name="dep.cache.dir" location="${target.dir}/dep-cache" />
<property name="build.log" location="${target.dir}/ant_verbose.txt" />
<property name="deps.dir" location="${top.dir}/deps" />
<property name="cloud-plugin-f5.jar" value="cloud-plugin-f5.jar" />
<import file="${build.dir}/build-common.xml"/>
<echo message="target.dir=${target.dir}; top.dir=${top.dir}"/>
<!-- This section needs to be replaced by some kind of dependency library-->
<path id="deps.classpath">
<!--filelist files="${deps.classpath}" /-->
<fileset dir="${deps.dir}" erroronmissingdir="false">
<include name="*.jar" />
</fileset>
</path>
<path id="cloudstack.classpath">
<fileset dir="${jar.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="f5.classpath">
<path refid="deps.classpath"/>
<path refid="cloudstack.classpath"/>
</path>
<!-- This section needs to be replaced by some kind of dependency library-->
<target name="deploy-f5" >
</target>
<target name="init" description="Initialize binaries directory">
<mkdir dir="${classes.dir}/${cloud-plugin-f5.jar}"/>
<mkdir dir="${jar.dir}"/>
</target>
<target name="compile-f5" depends="init" description="Compile F5">
<compile-java jar.name="${cloud-plugin-f5.jar}" top.dir="${f5.base.dir}" classpath="f5.classpath" />
</target>
<target name="clean-f5">
<delete dir="${classes.dir}/${cloud-plugin-f5.jar}"/>
</target>
<target name="build" depends="compile-f5"/>
<target name="clean" depends="clean-f5"/>
<target name="help" description="help">
<echo level="info" message="This is the build file for F5 network element plugin"/>
<echo level="info" message="You can do a build by doing ant build or clean by doing ant clean" />
</target>
</project>

Some files were not shown because too many files have changed in this diff Show More