You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2020/10/04 18:44:00 UTC
[libcloud] branch trunk updated (0616c2e -> 41874c9)
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git.
from 0616c2e Add additional test case, use better method name.
add 326166f Merge branch 'mistio-trunk' into tempTrunk
add 7058390 Merge branch 'vSphere' into trunk
add 220cd78 Add tests to driver
add 42aea70 Fix tests
add f57c046 Merge remote-tracking branch 'upstream/trunk' into vSphere-drv
add 7a867fe Change node driver name from 6_7 to REST since it works for vSphere 7 as well, remove **kwargs, remove mutables from arguments, make a separate async_list_nodes for rest driver
add 6aeca82 Fix flake8
add 929205a Remove async_ argument from any list_nodes call
new 2c0d42c Merge branch 'vSphere-drv' of https://github.com/Eis-D-Z/libcloud into Eis-D-Z-vSphere-drv
new bc7b6fe Add missing changes.
new c690a0e Add missing driver argument to LibcloudError class.
new 41874c9 Add changelog entry.
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
CHANGES.rst | 8 +
libcloud/compute/drivers/vsphere.py | 2004 ++++++++++++++++++++
libcloud/compute/providers.py | 2 +
libcloud/compute/types.py | 2 +
.../compute/fixtures/vsphere/list_clusters.json | 1 +
.../test/compute/fixtures/vsphere/list_hosts.json | 3 +
.../compute/fixtures/vsphere/list_interfaces.json | 4 +
.../test/compute/fixtures/vsphere/list_nodes.json | 3 +
.../test/compute/fixtures/vsphere/node_80.json | 55 +
.../compute/fixtures/vsphere/session_token.json | 1 +
libcloud/test/compute/test_vsphere.py | 150 ++
11 files changed, 2233 insertions(+)
create mode 100644 libcloud/compute/drivers/vsphere.py
create mode 100644 libcloud/test/compute/fixtures/vsphere/list_clusters.json
create mode 100644 libcloud/test/compute/fixtures/vsphere/list_hosts.json
create mode 100644 libcloud/test/compute/fixtures/vsphere/list_interfaces.json
create mode 100644 libcloud/test/compute/fixtures/vsphere/list_nodes.json
create mode 100644 libcloud/test/compute/fixtures/vsphere/node_80.json
create mode 100644 libcloud/test/compute/fixtures/vsphere/session_token.json
create mode 100644 libcloud/test/compute/test_vsphere.py
[libcloud] 01/04: Merge branch 'vSphere-drv' of
https://github.com/Eis-D-Z/libcloud into Eis-D-Z-vSphere-drv
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 2c0d42cd79c8798859723c5391d2c9b3372ab4f5
Merge: 0616c2e 929205a
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Sun Oct 4 19:58:15 2020 +0200
Merge branch 'vSphere-drv' of https://github.com/Eis-D-Z/libcloud into Eis-D-Z-vSphere-drv
libcloud/compute/drivers/vsphere.py | 1993 ++++++++++++++++++++
.../compute/fixtures/vsphere/list_clusters.json | 1 +
.../test/compute/fixtures/vsphere/list_hosts.json | 3 +
.../compute/fixtures/vsphere/list_interfaces.json | 4 +
.../test/compute/fixtures/vsphere/list_nodes.json | 3 +
.../test/compute/fixtures/vsphere/node_80.json | 55 +
.../compute/fixtures/vsphere/session_token.json | 1 +
libcloud/test/compute/test_vsphere.py | 150 ++
8 files changed, 2210 insertions(+)
[libcloud] 03/04: Add missing driver argument to LibcloudError
class.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit c690a0efb333062e6ec3e79cfc86f4e131648868
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Sun Oct 4 20:37:00 2020 +0200
Add missing driver argument to LibcloudError class.
---
libcloud/compute/drivers/vsphere.py | 35 +++++++++++++++++++++++------------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/libcloud/compute/drivers/vsphere.py b/libcloud/compute/drivers/vsphere.py
index d083f44..0fa6d5c 100644
--- a/libcloud/compute/drivers/vsphere.py
+++ b/libcloud/compute/drivers/vsphere.py
@@ -117,10 +117,12 @@ class VSphereNodeDriver(NodeDriver):
if 'connection refused' in error_message or 'is not a vim server' \
in error_message:
raise LibcloudError('Check that the host provided is a '
- 'vSphere installation')
+ 'vSphere installation',
+ driver=self)
if 'name or service not known' in error_message:
raise LibcloudError(
- 'Check that the vSphere host is accessible')
+ 'Check that the vSphere host is accessible',
+ driver=self)
if 'certificate verify failed' in error_message:
# bypass self signed certificates
try:
@@ -137,7 +139,8 @@ class VSphereNodeDriver(NodeDriver):
)
atexit.register(connect.Disconnect, self.connection)
else:
- raise LibcloudError('Cannot connect to vSphere')
+ raise LibcloudError('Cannot connect to vSphere',
+ driver=self)
def list_locations(self, ex_show_hosts_in_drs=True):
"""
@@ -734,7 +737,8 @@ class VSphereNodeDriver(NodeDriver):
vm = self.find_by_uuid(node.id)
if not vm.snapshot:
raise LibcloudError(
- "Remove snapshot failed. No snapshots for node %s" % node.name)
+ "Remove snapshot failed. No snapshots for node %s" % node.name,
+ driver=self)
snapshots = recurse_snapshots(vm.snapshot.rootSnapshotList)
if not snapshot_name:
snapshot = snapshots[-1].snapshot
@@ -744,7 +748,8 @@ class VSphereNodeDriver(NodeDriver):
snapshot = s.snapshot
break
else:
- raise LibcloudError("Snapshot `%s` not found" % snapshot_name)
+ raise LibcloudError("Snapshot `%s` not found" % snapshot_name,
+ driver=self)
return self.wait_for_task(snapshot.RemoveSnapshot_Task(
removeChildren=remove_children))
@@ -756,7 +761,8 @@ class VSphereNodeDriver(NodeDriver):
vm = self.find_by_uuid(node.id)
if not vm.snapshot:
raise LibcloudError("Revert failed. No snapshots "
- "for node %s" % node.name)
+ "for node %s" % node.name,
+ driver=self)
snapshots = recurse_snapshots(vm.snapshot.rootSnapshotList)
if not snapshot_name:
snapshot = snapshots[-1].snapshot
@@ -766,7 +772,8 @@ class VSphereNodeDriver(NodeDriver):
snapshot = s.snapshot
break
else:
- raise LibcloudError("Snapshot `%s` not found" % snapshot_name)
+ raise LibcloudError("Snapshot `%s` not found" % snapshot_name,
+ driver=self)
return self.wait_for_task(snapshot.RevertToSnapshot_Task())
def _find_template_by_uuid(self, template_uuid):
@@ -785,9 +792,11 @@ class VSphereNodeDriver(NodeDriver):
if vm.config.instanceUuid == template_uuid:
template = vm
except Exception as exc:
- raise LibcloudError("Error while searching for template, ", exc)
+ raise LibcloudError("Error while searching for template: %s" % exc,
+ driver=self)
if not template:
- raise LibcloudError("Unable to locate VirtualMachine.")
+ raise LibcloudError("Unable to locate VirtualMachine.",
+ driver=self)
return template
@@ -801,7 +810,8 @@ class VSphereNodeDriver(NodeDriver):
# perhaps it is a moid
vm = self._get_item_by_moid('VirtualMachine', node_uuid)
if not vm:
- raise LibcloudError("Unable to locate VirtualMachine.")
+ raise LibcloudError("Unable to locate VirtualMachine.",
+ driver=self)
return vm
def find_custom_field_key(self, key_id):
@@ -845,14 +855,15 @@ class VSphereNodeDriver(NodeDriver):
if (time.time() - start_time >= timeout):
raise LibcloudError('Timeout while waiting '
'for import task Id %s'
- % task.info.id)
+ % task.info.id,
+ driver=self)
if task.info.state == 'success':
if task.info.result and str(task.info.result) != 'success':
return task.info.result
return True
if task.info.state == 'error':
- raise LibcloudError(task.info.error.msg)
+ raise LibcloudError(task.info.error.msg, driver=self)
time.sleep(interval)
def create_node(self, name, image, size, location=None, ex_cluster=None,
[libcloud] 04/04: Add changelog entry.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 41874c92eaefb74ed4856f3918e0c4d26d253690
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Sun Oct 4 20:42:00 2020 +0200
Add changelog entry.
---
CHANGES.rst | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/CHANGES.rst b/CHANGES.rst
index 0c72a17..48366ba 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -45,6 +45,14 @@ Compute
(GITHUB-1497, GITHUB-1495)
[David Tomaschik - Matir]
+- [VSphere] Add new VMware VSphere driver which utilizes ``pyvmomi`` library
+ and works under Python 3.
+
+ If you want to use this driver, you need to install ``pyvmomi`` dependency -
+ ``pip install pyvmomi``
+ (GITHUB-1481)
+ [Eis D. Zaster - @Eis-D-Z]
+
Changes in Apache Libcloud 3.2.0
--------------------------------
[libcloud] 02/04: Add missing changes.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit bc7b6fe2c1b01d088232ad52d4bc478c9e88cc3c
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Sun Oct 4 20:00:21 2020 +0200
Add missing changes.
---
libcloud/compute/providers.py | 2 ++
libcloud/compute/types.py | 2 ++
2 files changed, 4 insertions(+)
diff --git a/libcloud/compute/providers.py b/libcloud/compute/providers.py
index 8ecd205..7679296 100644
--- a/libcloud/compute/providers.py
+++ b/libcloud/compute/providers.py
@@ -128,6 +128,8 @@ DRIVERS = {
('libcloud.compute.drivers.outscale', 'OutscaleNodeDriver'),
Provider.PROFIT_BRICKS:
('libcloud.compute.drivers.profitbricks', 'ProfitBricksNodeDriver'),
+ Provider.VSPHERE:
+ ('libcloud.compute.drivers.vsphere', 'VSphereNodeDriver'),
Provider.VULTR:
('libcloud.compute.drivers.vultr', 'VultrNodeDriver'),
Provider.AURORACOMPUTE:
diff --git a/libcloud/compute/types.py b/libcloud/compute/types.py
index 2211f55..c7d3f3c 100644
--- a/libcloud/compute/types.py
+++ b/libcloud/compute/types.py
@@ -88,6 +88,7 @@ class Provider(Type):
:cvar VCL: VCL driver
:cvar VCLOUD: vmware vCloud
:cvar VPSNET: VPS.net
+ :cvar VSphere: VSphere driver.
:cvar VULTR: vultr driver.
"""
AZURE = 'azure'
@@ -159,6 +160,7 @@ class Provider(Type):
VCLOUD = 'vcloud'
VOXEL = 'voxel'
VPSNET = 'vpsnet'
+ VSPHERE = 'vsphere'
VULTR = 'vultr'
# OpenStack based providers