Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
added thumbprint for vmware 6.5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Renout Gerrits committed Oct 16, 2017
1 parent be5637b commit 79cf642
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 14 additions & 1 deletion vadp_dumper/bareos_vadp_dumper.cpp
Expand Up @@ -23,6 +23,7 @@
* VADP Dumper - vStorage APIs for Data Protection Dumper program.
*
* Marco van Wieringen, July 2014
* Renout Gerrits, Oct 2017, added thumbprint
*/
#include <stdio.h>
#include <stdint.h>
Expand Down Expand Up @@ -52,7 +53,7 @@
#define VIXDISKLIB_VERSION_MAJOR 5
#define VIXDISKLIB_VERSION_MINOR 5

#define VSPHERE_DEFAULT_ADMIN_PORT 902
#define VSPHERE_DEFAULT_ADMIN_PORT 0

/*
* VixDiskLib does all processing in sectors of 512 bytes.
Expand All @@ -71,6 +72,7 @@
#define CON_PARAMS_KEY "ConnParams"
#define CON_PARAMS_VM_MOREF_KEY "VmMoRef"
#define CON_PARAMS_HOST_KEY "VsphereHostName"
#define CON_PARAMS_THUMBPRINT_KEY "VsphereThumbPrint"
#define CON_PARAMS_USERNAME_KEY "VsphereUsername"
#define CON_PARAMS_PASSWORD_KEY "VspherePassword"
#define CON_PARAMS_SNAPSHOT_MOREF_KEY "VsphereSnapshotMoRef"
Expand Down Expand Up @@ -525,6 +527,16 @@ static inline void do_vixdisklib_connect(const char *key, json_t *connect_params
goto bail_out;
}

object = json_object_get(connect_params, CON_PARAMS_THUMBPRINT_KEY);
if (object) {

cnxParams.thumbPrint = strdup(json_string_value(object));
if (!cnxParams.thumbPrint) {
fprintf(stderr, "Failed to allocate memory for holding %s\n", CON_PARAMS_USERNAME_KEY);
goto bail_out;
}
}

object = json_object_get(connect_params, CON_PARAMS_USERNAME_KEY);
if (!object) {
fprintf(stderr, "Failed to find %s in JSON definition of object %s\n", CON_PARAMS_USERNAME_KEY, key);
Expand All @@ -537,6 +549,7 @@ static inline void do_vixdisklib_connect(const char *key, json_t *connect_params
goto bail_out;
}


object = json_object_get(connect_params, CON_PARAMS_PASSWORD_KEY);
if (!object) {
fprintf(stderr, "Failed to find %s in JSON definition of object %s\n", CON_PARAMS_PASSWORD_KEY, key);
Expand Down
4 changes: 3 additions & 1 deletion vmware_plugin/BareosFdPluginVMware.py
Expand Up @@ -20,6 +20,7 @@
# 02110-1301, USA.
#
# Author: Stephan Duehr
# Renout Gerrits, Oct 2017, added thumbprint
#
# Bareos python class for VMware related backup and restore
#
Expand Down Expand Up @@ -76,7 +77,7 @@ def __init__(self, context, plugindef):
self.events.append(bEventType['bEventStartBackupJob'])
self.events.append(bEventType['bEventStartRestoreJob'])
bareosfd.RegisterEvents(context, self.events)
self.mandatory_options_default = ['vcserver', 'vcuser', 'vcpass']
self.mandatory_options_default = ['vcserver', 'vcuser', 'vcpass', 'vcthumbprint']
self.mandatory_options_vmname = ['dc', 'folder', 'vmname']

self.vadp = BareosVADPWrapper()
Expand Down Expand Up @@ -1035,6 +1036,7 @@ def cbt2json(self, context):
cbt_data['ConnParams']['VsphereHostName'] = self.options['vcserver']
cbt_data['ConnParams']['VsphereUsername'] = self.options['vcuser']
cbt_data['ConnParams']['VspherePassword'] = self.options['vcpass']
cbt_data['ConnParams']['VsphereThumbPrint'] = self.options['vcthumbprint'].replace(" ", ":")
cbt_data['ConnParams'][
'VsphereSnapshotMoRef'] = self.create_snap_result._moId

Expand Down

0 comments on commit 79cf642

Please sign in to comment.