Index: src/zabbix_server/poller/checks_simple.c
===================================================================
--- src/zabbix_server/poller/checks_simple.c	(revision 54668)
+++ src/zabbix_server/poller/checks_simple.c	(working copy)
@@ -52,6 +52,7 @@
 	{"hv.datastore.discovery", VMCHECK_FUNC(check_vcenter_hv_datastore_discovery)},
 	{"hv.datastore.read", VMCHECK_FUNC(check_vcenter_hv_datastore_read)},
 	{"hv.datastore.write", VMCHECK_FUNC(check_vcenter_hv_datastore_write)},
+	{"hv.datastore.size", VMCHECK_FUNC(check_vcenter_hv_datastore_size)},
 	{"hv.discovery", VMCHECK_FUNC(check_vcenter_hv_discovery)},
 	{"hv.fullname", VMCHECK_FUNC(check_vcenter_hv_fullname)},
 	{"hv.hw.cpu.num", VMCHECK_FUNC(check_vcenter_hv_hw_cpu_num)},
Index: src/zabbix_server/poller/checks_simple_vmware.c
===================================================================
--- src/zabbix_server/poller/checks_simple_vmware.c	(revision 54668)
+++ src/zabbix_server/poller/checks_simple_vmware.c	(working copy)
@@ -1567,6 +1567,95 @@
 	return ret;
 }
 
+int	check_vcenter_hv_datastore_size(AGENT_REQUEST *request, const char *username, const char *password,
+		AGENT_RESULT *result)
+{
+	const char		*__function_name = "check_vcenter_hv_datastore_size";
+
+#define		ZBX_DATASTORE_SIZE_MODE_TOTAL		0
+#define		ZBX_DATASTORE_SIZE_MODE_FREE		1
+#define		ZBX_DATASTORE_SIZE_MODE_PFREE		2
+	char			*url, *path, *uuid, *datastore_name, *mode;
+	zbx_vmware_service_t	*service;
+	zbx_vmware_hv_t		*hv;
+	int			i, ret = SYSINFO_RET_FAIL, size_mode;
+
+	zabbix_log(LOG_LEVEL_DEBUG, "In %s()", __function_name);
+
+	if (3 > request->nparam || request->nparam > 4)
+	{
+		SET_MSG_RESULT(result, zbx_strdup(NULL, "Invalid number of parameters."));
+		goto out;
+	}
+
+	url = get_rparam(request, 0);
+	uuid = get_rparam(request, 1);
+	datastore_name = get_rparam(request, 2);
+	mode = get_rparam(request, 3);
+
+	if (NULL == mode || '\0' == *mode || 0 == strcmp(mode, "total"))
+	{
+		size_mode = ZBX_DATASTORE_SIZE_MODE_TOTAL;
+	}
+	else if (0 == strcmp(mode, "free"))
+	{
+		size_mode = ZBX_DATASTORE_SIZE_MODE_FREE;
+	}
+	else if (0 == strcmp(mode, "pfree"))
+	{
+		size_mode = ZBX_DATASTORE_SIZE_MODE_PFREE;
+	}
+	else
+	{
+		SET_MSG_RESULT(result, zbx_strdup(NULL, "Invalid fourth parameter."));
+		goto out;
+	}
+
+	zbx_vmware_lock();
+
+	if (NULL == (service = get_vmware_service(url, username, password, result, &ret)))
+		goto unlock;
+
+	if (NULL == (hv = hv_get(&service->data->hvs, uuid)))
+	{
+		SET_MSG_RESULT(result, zbx_strdup(NULL, "Unknown hypervisor uuid."));
+		goto unlock;
+	}
+
+	for (i = 0; i < hv->datastores.values_num; i++)
+	{
+		zbx_vmware_datastore_t	*datastore = hv->datastores.values[i];
+
+		if (0 == strcmp(datastore_name, datastore->name))
+		{
+			switch (size_mode)
+			{
+				case ZBX_DATASTORE_SIZE_MODE_TOTAL:
+					SET_UI64_RESULT(result, datastore->capacity);
+					break;
+				case ZBX_DATASTORE_SIZE_MODE_FREE:
+					SET_UI64_RESULT(result, datastore->freeSpace);
+					break;
+				case ZBX_DATASTORE_SIZE_MODE_PFREE:
+					SET_UI64_RESULT(result, (double)datastore->freeSpace / datastore->capacity *
+							100);
+					break;
+			}
+
+			ret = SYSINFO_RET_OK;
+			goto unlock;
+		}
+	}
+
+	SET_MSG_RESULT(result, zbx_strdup(NULL, "Unknown datastore name"));
+unlock:
+	zbx_vmware_unlock();
+out:
+	zabbix_log(LOG_LEVEL_DEBUG, "End of %s():%s", __function_name, sysinfo_ret_string(ret));
+
+	return ret;
+}
+
 int	check_vcenter_hv_perfcounter(AGENT_REQUEST *request, const char *username, const char *password,
 		AGENT_RESULT *result)
 {
Index: src/zabbix_server/poller/checks_simple_vmware.h
===================================================================
--- src/zabbix_server/poller/checks_simple_vmware.h	(revision 54668)
+++ src/zabbix_server/poller/checks_simple_vmware.h	(working copy)
@@ -47,6 +47,8 @@
 		AGENT_RESULT *result);
 int	check_vcenter_hv_discovery(AGENT_REQUEST *request, const char *username, const char *password,
 		AGENT_RESULT *result);
+int	check_vcenter_hv_datastore_size(AGENT_REQUEST *request, const char *username, const char *password,
+		AGENT_RESULT *result);
 int	check_vcenter_hv_fullname(AGENT_REQUEST *request, const char *username, const char *password,
 		AGENT_RESULT *result);
 int	check_vcenter_hv_hw_cpu_num(AGENT_REQUEST *request, const char *username, const char *password,
Index: src/zabbix_server/vmware/vmware.c
===================================================================
--- src/zabbix_server/vmware/vmware.c	(revision 54668)
+++ src/zabbix_server/vmware/vmware.c	(working copy)
@@ -613,6 +613,8 @@
 	datastore = __vm_mem_malloc_func(NULL, sizeof(zbx_vmware_datastore_t));
 	datastore->uuid = vmware_shared_strdup(src->uuid);
 	datastore->name = vmware_shared_strdup(src->name);
+	datastore->capacity = src->capacity;
+	datastore->freeSpace = src->freeSpace;
 
 	return datastore;
 }
@@ -1652,9 +1654,9 @@
 		ZBX_POST_VSPHERE_FOOTER
 
 	const char		*__function_name = "vmware_service_create_datastore";
-
-	char			tmp[MAX_STRING_LEN], *uuid = NULL, *name = NULL, *url;
+	char			tmp[MAX_STRING_LEN], *uuid = NULL, *name = NULL, *url, *value = NULL;
 	zbx_vmware_datastore_t	*datastore = NULL;
+	zbx_uint64_t		capacity = 0, freeSpace = 0;
 
 	zabbix_log(LOG_LEVEL_DEBUG, "In %s() datastore:'%s'", __function_name, id);
 
@@ -1673,6 +1675,14 @@
 
 	name = zbx_xml_read_value(page.data, ZBX_XPATH_DATASTORE("name"));
 
+	if (NULL != (value = zbx_xml_read_value(page.data, ZBX_XPATH_DATASTORE("capacity"))))
+		is_uint64(value, &capacity);
+	zbx_free(value);
+
+	if (NULL != (value = zbx_xml_read_value(page.data, ZBX_XPATH_DATASTORE("freeSpace"))))
+		is_uint64(value, &freeSpace);
+	zbx_free(value);
+
 	if (NULL != (url = zbx_xml_read_value(page.data, ZBX_XPATH_DATASTORE("url"))))
 	{
 		if ('\0' != *url)
@@ -1696,6 +1706,8 @@
 	datastore = zbx_malloc(NULL, sizeof(zbx_vmware_datastore_t));
 	datastore->name = (NULL != name) ? name : zbx_strdup(NULL, id);
 	datastore->uuid = uuid;
+	datastore->capacity = capacity;
+	datastore->freeSpace = freeSpace;
 
 	zabbix_log(LOG_LEVEL_DEBUG, "End of %s()", __function_name);
 
Index: src/zabbix_server/vmware/vmware.h
===================================================================
--- src/zabbix_server/vmware/vmware.h	(revision 54668)
+++ src/zabbix_server/vmware/vmware.h	(working copy)
@@ -69,6 +69,9 @@
 {
 	char	*name;
 	char	*uuid;
+
+	zbx_uint64_t	capacity;
+	zbx_uint64_t	freeSpace;
 }
 zbx_vmware_datastore_t;
 
