public Server deployVirtualMachine(String serviceOfferingId, String templateId, String zoneId,
			CreateServerOptions options) throws Exception
	{
		CloudStackApiClient client = new CloudStackApiClient(DEPLOY_VIRTUALMACHINE, apiKey, secretKey, apiUrl);
		client.addParam("serviceofferingid", serviceOfferingId);
		client.addParam("templateid", templateId);
		client.addParam("zoneid", zoneId);
		client.addParam("account", options.getAccount());
		client.addParam("diskofferingid", options.getDiskOfferingId());
		client.addParam("displayname", options.getDisplayName());
		client.addParam("domainid", options.getDomainId());
		client.addParam("group", options.getGroup());
		client.addParam("hostid", options.getHostId());
		client.addParam("hypervisor", options.getHypervisor());
		client.addParam("ipaddress", options.getIpAddress());
		
		client.addParam("keyboard", options.getKeyboard());
		client.addParam("keypair", options.getKeyPair());
		client.addParam("name", options.getName());
		client.addParam("networkids", options.getNetWorkIds());
		client.addParam("projectid", options.getProjectId());
		client.addParam("securitygroupids", options.getSecurityGroupIds());
		client.addParam("securitygroupnames", options.getSize());
		client.addParam("userdata", options.getUserData());
		client.addParam("size", options.getSize());

		int i = 0;
		
		for(Map.Entry<String, String> entry: options.getIpToNetworkList().entrySet())
		{
			client.addParam("iptonetworklist[" + i + "].ip", entry.getKey());
			client.addParam("iptonetworklist[" + i + "].networkid", entry.getValue());
			i++;
		}
		
		String response = client.execute();

		if (containsErrorMessage(response))
		{
			throw new Exception("Error deploying virtual machine. Response: " + getErrorMessage(response));
		}

		Document doc = stringToXmlDocument(response);
		String id = doc.getElementsByTagName("id").item(0).getTextContent().trim();

		Server server = new Server();
		server.setId(id);
		return server;
	}