Code Monkey home page Code Monkey logo

vmware-vcenter's Introduction

Build Status

VMware has ended active development of this project, this repository will no longer be updated.

VMware vCenter module

This module manages resources in VMware vCenter such as folders, datacenter, ESX host and clusters.

Description

VMware vCenter can be deployed either via an virtual appliance (vmware-vcsa module) or installed on a windows server. This module manages vCenter 5.1 resources via the vSphere API using rbvmomi gem:

+------------+         +---------+         +-----+
|            | vsphere | vCSA    |         | ESX |
|   Puppet   | +-----> +---------+ +-----> +-----+
| Management |   |                   |
|    Host    |   |     +---------+   |     +-----+
|            |    ---> | vCenter |    ---> | ESX |
+------------+         +---------+         +-----+
  • vCenter resources in this module are NOT compatible with PuppetLabs-vCenter module.
  • ESX resources operate on hosts once they are attached to vCenter.

Installation

$ puppet module install vmware/vcenter

Usage

Puppet management host (see diagram above) should install type/provider gem dependencies:

include vcenter::package

Warning: nokogiri gem is an implicit requirement:

  • Nokogiri package is shipped with Puppet Enterprise, but typically not installed by default on the agent. The platform appropriate PE nokogiri gem should be installed on the management host (rather than building the gem).

  • Open source puppet will automatically attempt to build nokogiri gem, but additional packages may be required for successful compilation (see tests/package.pp example and nokogiri installation documentation).

  • This module ships with a custom version of rbvmomi gem for Ruby 1.8.7 compatibility.

Transport resource specifies rbvmomi connectivity info (see VIM.connect method for additional options):

# The name of the transport is referenced by other resource:
transport { 'lab':
  username => 'root',
  password => 'vmware',
  server   => 'vcsa.lab',
  options  => { 'insecure' => true },
}

All vCenter resources use the transport metaparameter to specify the connectivity used to manage the resource:

vc_datacenter { 'dc1':
  path      => '/dc1',
  ensure    => present,
  transport => Transport['lab'],
}

vc_folder { '/dc1/folder1':
  ensure    => absent,
  transport => Transport['lab'],
}

An ESX host can be attached and managed indirectly via vSphere API:

vcenter::host { $esx1['hostname']:
  path      => '/dc1',
  username  => 'root',
  password  => 'password',
  dateTimeConfig => {
    'ntpConfig' => {
      'server' => 'us.pool.ntp.org',
    },
    'timeZone' => {
      'key' => 'UTC',
    },
  },
  transport => Transport['lab'],
}

See tests folder for additional examples.

ESXi resource types

esx_advanced_options

Parameters

  • transport: A resource reference to a transport type declared elsewhere. Eg: Transport['vcenter']
  • options: A hash containing a list of options:
options => {
"Vpx.Vpxa.config.log.level"  => "verbose",   # ChoiceOption  default "verbose"
"Config.HostAgent.log.level" => "verbose",   # ChoiceOption  default "verbose"
"Annotations.WelcomeMessage" => "",          # StringOption  default ""
"BufferCache.SoftMaxDirty"   => 15,          # LongOption    default 15
"CBRC.Enable"                => false,       # BoolOption    default false
"Config.GlobalSettings.guest.commands.sharedPolicyRefCount" => 0   # IntOption     default 0

esx_debug

Parameters

  • debug: true, false
  • transport: A resource reference to a transport type declared elsewhere. Eg: Transport['vcenter']

esx_firewall_ruleset

Parameters

  • ensure: enabled, disabled
  • name: Name of the firewall ruleset (namevar)
  • host: ESX host to configure (namevar)
  • path: Path to the datacenter where the host resides
  • allowed_hosts: Accepts a string value of "all" or an array of IP addresses and IP networks with prefixes
  • transport: A resource reference to a transport type declared elsewhere. Eg: Transport['vcenter']

Title pattern

Both name and host are namevars, by default the title will be used for name, but both may be specified in the title as host:name

esx_dnsconfig

Parameters

  • address: ['array','of','dns','values']
  • host_name: Hostname of ESXi server.
  • domain_name: Domain name of ESXi server.
  • search_domain: Search domain of ESXi server.
  • dhcp: true, false
  • transport: A resource reference to a transport type declared elsewhere. Eg: Transport['vcenter']

Further Documentation

VMware Docs

esx_ntpconfig

Parameters

  • server: ['array','of','ntp','servers']
  • transport: A resource reference to a transport type declared elsewhere. Eg: Transport['vcenter']

esx_powerpolicy

Parameters

  • current_policy: 'static','dynamic','low' static = High performance dynamic = Balanced low = Low Power
  • transport: A resource reference to a transport type declared elsewhere. Eg: Transport['vcenter']

esx_service

The service name should be in the form of: ESXi_hostname:<service name. Eg esx.example.com:ntpd

Parameters

  • running: true, false
  • policy: 'on','off','automatic'
  • transport: A resource reference to a transport type declared elsewhere. Eg: Transport['vcenter']

esx_syslog

Parameters

  • default_rotate: The maximum number of log files to keep locally on the ESXi host in the configured logDir. Does not affect remote syslog server retention. Defaults to 8
  • default_size: The maximum size, in kilobytes, of each local log file before it is rotated. Does not affect remote syslog server retention. Defaults to 1024 KB.
  • log_dir: A location on a local or remote datastore and path where logs are saved to. Has the format [DatastoreName] DirectoryName/Filename, which maps to /vmfs/volumes/DatastoreName/DirectoryName/Filename. The [DatastoreName] is case sensitive and if the specified DirectoryName does not exist, it will be created. If the datastore path field is blank, the logs are only placed in their default location. If /scratch is defined, the default is []/scratch/log.
  • log_host:A remote server where logs are sent using the syslog protocol. If the logHost field is blank, no logs are forwarded. Include the protocol and port, similar to tcp://hostname:514
  • log_dir_unique: A boolean option which controls whether a host-specific directory is created within the configured logDir. The directory name is the hostname of the ESXi host. A unique directory is useful if the same shared directory is used by multiple ESXi hosts. Defaults to false.
  • transport: A resource reference to a transport type declared elsewhere. Eg: Transport['vcenter']

esx_system_resource

Parameters

This resource allows the configuration of system resources of a host that are viewed und er the 'System Resource Allocation' section of the vSphere client

  • host:
  • system_resource:
  • cpu_limit: Can be set to a numerical value representing MHz, or "unlimited"
  • cpu_reservation:
  • cpu_expandable_reservation:
  • memory_limit: Can be set to a numerical value representing MB, or "unlimited"
  • memory_reservation:
  • memory_expandable_reservation:
  • transport: A resource reference to a transport type declared elsewhere. Eg: Transport['vcenter']

esx_timezone

Parameters

  • key: 3 letter time zone. Eg: 'GMT'
  • transport: A resource reference to a transport type declared elsewhere. Eg: Transport['vcenter']

esx_datastore

Manage vCenter esx hosts' datastore. The datastore name should be in the form of: ESXi_hostname:<datastore name>.

Parameters

  • ensure: present
  • type: vmfs, cifs, nfs
  • lun: LUN number of storage volume. Specify only for block storage.
  • remote_host: IP or DNS name of remote host.
  • remote_path: Path to directory/folder or remote host.
  • transport: A resource reference to a transport type declared elsewhere. Eg: Transport['vcenter']

esx_vmknic_type

Manages ESXi vmknic types - management, vmotion, faultToleranceLogging, or vSphereReplication The vmknic type should be in the form of: ESXi_hostname:<name of vmknic>.

Parameters

  • nic_type: 'faultToleranceLogging', 'management', 'vmotion', 'vSphereReplication'
  • transport: A resource reference to a transport type declared elsewhere. Eg: Transport['vcenter']

esx_license

Parameters

  • license_key: Namevar variable for puppet. Adds licenses to Vcenter pool. Does not assign them to managed entities (esxi, vcenter). Use esx_license_assignment to assign licenses to entities.

Usage

esx_license { 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX'
  ensure    => present,
  transport => Transport['vcenter']
}

or

esx_license { 'mylicense':
  license_key => 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX',
  ensure      => present,
  transport   => Transport['vcenter']
}

esx_license_assignment

Manage vsphere license assignment. entity_id should be the name of an esx host or vcenter. Licenses can only be assigned to one entity at a time.

Parameters

  • entity_id: Name of ESX or Virtual Center node associated with the license key
  • license_key: vSphere License Key

vCenter resource types

vc_role

Parameters

  • transport: A resource reference to a transport type declared elsewhere. Eg: Transport['vcenter']
  • name: The desired name for the role.
  • privileges: An array of privilege IDs to be assigned to the role. A list of privileges of privileges can be gathered via the Managed Object Browser (MOB). Simply navigate to https:///mob/?moid=AuthorizationManager&doPath=privilegeList. Use the privId value to add the privilege to the role.
  • force_delete: By default, a role will not be deleted if user or group permissions are associated with it. If force_delete is set to true, then the role will be deleted even if there are associated permissions
vc_role { 'Role Admin':
  ensure     => present,
  privileges => [ 'Authorization.ModifyRoles', 'Authorization.ReassignRolePermissions', 'Authorization.ModifyPermissions' ],
  transport  => Transport['vcenter']
}

or

vc_role { 'Role Admin':
  ensure       => absent,
  force_delete => true,
  transport    => Transport['vcenter']
}

vmware-vcenter's People

Contributors

athak avatar bodepd avatar chrrrles avatar crayfishx avatar dscherer avatar dstefka avatar dwoolger avatar gavin-scott avatar geauxvirtual avatar ggeldenhuis avatar harrypan avatar jakerobinson avatar klevron1 avatar maniacmurphy avatar nanliu avatar pittma avatar sholland avatar soylentgrn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vmware-vcenter's Issues

Error: Could not autoload puppet/provider/vc_*/default: undefined method `path' for nil:NilClass

When using the vcenter plugin with a puppet master we get this error:

Error: Could not autoload puppet/provider/vc_folder/default: undefined method path' for nil:NilClass Error: Could not autoload puppet/type/vc_folder: Could not autoload puppet/provider/vc_folder/default: undefined methodpath' for nil:NilClass
Error: Could not retrieve catalog from remote server: Could not intern from text/pson: Could not autoload puppet/type/vc_folder: Could not autoload puppet/provider/vc_folder/default: undefined method `path' for nil:NilClass
Warning: Not using cache on failed catalog

Its not only vc_folder, I have tried vc_host and vc_datacenter all have the same issue.

My first step was to install the rbvmomi (1.6.0.z1) gem on the puppet master. That had no effect on this issue.

I then tried to run puppet locally using puppet apply without a puppet master. That worked. (I put the modules and manifests in /etc/puppet/) After this success I tried running puppet with the puppet master and it magically started working ;)

I then removed the modules under /etc/puppet/modules/* that I put there so I could try puppet apply and then ran puppet using my puppet master and it Failed with the same error. This suggests a dependency that is not being provided via the manifest sent from the puppet master.

I narrowed it down to the vmware_lib module being required on the host. After I restored that single module to /etc/puppet/modules/vmware_lib then used the puppet master, it worked.

This is my manifest:

node default {' {
  include 'vcenter::package'
  class {'testing_vmware':}
}

This is the calls

class testing_vmware {

  transport { 'vcenter':
      username => 'esxpuppet',
      password => '**********!',
      server   => 'vcenter-lab-1d.testing.lab',
      options  => { 'insecure' => true }
  }

  vc_folder { 'folder_test':
    path => '/Lab02/test1',
    ensure    => present,
    transport => Transport['vcenter'],
  }
}

Thanks for your help!

Handle inconsistent data format

Gyoku doesn't always know the format of an attribute. If only a single value is returned it treats it as a hash, but for multiples an array. This is rather confusing:

data => { :val => 1 }

v.s.

data => [ {:val => 1}, {:val =>2} ]

Right now we don't really handle this pretty bluntly with an [].flatten. It might be better to check if it's an Array first. This requires some changes to providers in vShield.

esx_service fails with "Could not evaluate: host option required"

Hi,
I'm using the vcenter::host provided class. Manifest is almost identical to the host.pp test.

The agent errors 4 times, one per each service: ntpd, DCUI, TSM, TSM-SSH:

Esx_service[esx-01.athak.local:TSM-SSH]: Could not evaluate: host option required

Puppet master and agent are 3.1.0, Ubuntu 12.04.2.

Best,
Atha

Clarity required on domain and search settings for esx_dnsconfig type

The esx_dnsconfig allows you to set both:

  • domain_name
  • search_domain

On Ubuntu or CentOS the man page for resolv.conf reads:

The domain and search keywords are mutually exclusive. If more than one instance of these keywords is present, the last instance wins.

Knowing whether this is true in ESXi would be very useful. If this is the case the provider can ensure that the values are mutually exclusive and that you can't set both from puppet. Protecting you from yourself.

Enhance esx_syslog type to extend beyond Syslog.global

Currently the type only allows you to set Syslog.global settings. It would be useful to also use this type to set settings for hostd, vmkernel, fdm, vpxa and other as apply.
As an example being able to do the following:
esxcli system syslog config logger set --id=hostd --rotate=20 --size=2048
esxcli system syslog config logger set --id=vmkernel --rotate=20 --size=2048
esxcli system syslog config logger set --id=fdm --rotate=20
esxcli system syslog config logger set --id=vpxa --rotate=20

seconds or minutes

In the comments is states timeout values are in minutes... are you sure they are not really seconds?

There are 2 timeout settings you should enable to control ESXi shell sessions:
ESXi Shell Availability – ESXiShellTimeOut

  • How long the ESXi Shell and SSH services are allowed to run
    Idle ESXi Shell Sessions – ESXiShellInteractiveTimeOut
  • How long a shell session can remain inactive before being terminated.

The maximum timeout value allowed is 24 hours, 1440 minutes, or 86400 seconds.

require 'net/ssh' issues

We need to confine require 'net/ssh' to agent only and need some additional gems in the package.pp manifest:

/var/opt/lib/pe-puppet/lib/puppet/provider/vcsa_db/default.rb: no such file to load -- net/ssh

some types failing with cannot autoload file.

Hello,

Some types fail saying they cannot autoload a file. I want to assume it's trying to find rbvmomi under /var/lib/puppet/lib and cannot, but can't say for certain.

Example of failure:

  vcenter::dvswitch{ '/DC1/vDS':
    ensure    => present,
    transport => Transport['vcenter'],
    spec      => {}
  }

On puppet agent:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload puppet/type/vc_cluster_ha: no such file to load -- rbvmomi on node puppet.server.tld

On puppet master (using debug):

Error: Could not autoload puppet/type/vc_dvswitch: no such file to load -- rbvmomi
Error: Could not autoload puppet/type/vc_dvswitch: no such file to load -- rbvmomi on node puppet.server.tld
Error: Could not autoload puppet/type/vc_dvswitch: no such file to load -- rbvmomi on node puppet.server.tld
Error: Could not autoload puppet/type/vc_dvswitch: no such file to load -- rbvmomi on node puppet.server.tld

So far seen vc_dvswitch and vc_cluster_ha fail with this error while other vc_cluster types work as expected.

The thing these two types have in common that other working types don't are the following lines at the start of the file:

require 'set'

require 'pathname' # WORK_AROUND #14073 and #7788

vmware_module = Puppet::Module.find('vmware_lib', Puppet[:environment].to_s)
require File.join vmware_module.path, 'lib/puppet_x/vmware/util'
module_lib = Pathname.new(__FILE__).parent.parent.parent.parent
require File.join module_lib, 'puppet/provider/vcenter'
require File.join module_lib, 'puppet_x/vmware/mapper'

Other working types have the following at the start of the file:

provider_path = Pathname.new(__FILE__).parent.parent
require File.join(provider_path, 'vcenter')

Unfortunately don't know enough ruby to troubleshoot further, but replacing the former with the latter does not work :) and such have raised issue as I would imagine this affects more than just me.

Some additional info:

  • Puppet 3.2.3 master and agent
  • Ruby 1.9.3
  • Ubuntu Precise LTS

If there is any additional information I can provide please let me know.

Stephen

Vcenter provider private instance methods.

https://github.com/vmware/vmware-vcenter/blob/master/lib/puppet/provider/vcenter.rb#L30

Can someone tell me why all the methods in the Puppet::Provider::Vcenter class are private? I guess this depends on our definition of what constitutes the public API, I would argue that this class exposes functionality to the numerous providers that directly call it's methods therefore they constitute the public API and should be treated and tested accordingly. Any objection to removing the private keyword here?

Unable to use multiple hosts with the esx_service type

Using Hiera to create an array of hosts to be used in the recipe. Other types will loop through the array of hosts and apply the settings to all hosts, but the esx_service type isn't allowing me to do that, or I haven't been able to figure out the syntax.

For example, here is a working snippet for another type:

esx_ntpconfig { $esxi_servers:
server => $ntp_servers,
transport => Transport['vcenter'],
}

$esxi_servers is the array brought in from a hiera call above in the recipe. This approach works on multiple types, such as esx_syslog and esx_shells to name a few.

However the same approach doesn't work with the esx_service type because for some reason the service is jammed in with the host.

esx_service { "$esxi_servers:TSM-SSH":
running => true,
policy => 'on',
transport => Transport['vcenter'],
subscribe => Notify['trigger'],
}

We have tried multiple quotes placement and can never get it to work. Is it possible to do this with multiple hosts or does it only support 1 host per use?, If so, what is the syntax? And why put the service up there instead of as a normal parameter like running, policy, etc?

Unable to remove host from Datacenter

I am trying to add/remove a host to/from a Datacenter in vcenter. Using this module, i am able to add the host to the Datacenter but unable to remove the host from Datacenter.

Error: NotSupported: The operation is not supported on the object.
Error: RbVmomi::Fault

just FYI - i am able to add and remove a host to/from a cluster in vcenter. The issue is just in removing host from Datacenter.

Creating new vmknics

Error when creating a new vmknic. When it's already existing and I would like to change only the IP-Address it's working fine. But creating a completly new vmknic fails. It seems that it has problems to create the portgroup.

Error: Could not set 'present' on ensure: InvalidArgument: Ein angegebener Parameter war nicht korrekt.
Vim.Host.VirtualNic.Specification at 27:/etc/puppet/modules/vcenter/manifests/vmknic.pp
Error: Could not set 'present' on ensure: InvalidArgument: Ein angegebener Parameter war nicht korrekt.
Vim.Host.VirtualNic.Specification at 27:/etc/puppet/modules/vcenter/manifests/vmknic.pp
Wrapped exception:
InvalidArgument: Ein angegebener Parameter war nicht korrekt.
Vim.Host.VirtualNic.Specification
Error: /Stage[main]/Main/Vcenter::Vmknic[hvm-lab1ch-7.Mgmt.scCloudPoc.net:vmk1]/Esx_vmknic[hvm-lab1ch-7.Mgmt.scCloudPoc.net:vmk1]/ensure: change from absent to present failed: Could not set 'present' on ensure: InvalidArgument: Ein angegebener Parameter war nicht korrekt.
Vim.Host.VirtualNic.Specification at 27:/etc/puppet/modules/vcenter/manifests/vmknic.pp

in vCenter I can see the following error:
Add virtual NIC
A specified parameter was not correct.
Vim.Host.VirtualNic.Specification
VSPHERE.LOCAL\Administrator

Installed:
ruby -v
ruby 1.9.3p547 (2014-05-14 revision 45962) [x86_64-linux]

*** LOCAL GEMS ***
bigdecimal (1.1.0)
builder (3.2.2)
bundler (1.7.2)
bundler-unload (1.0.2)
executable-hooks (1.3.2)
facter (2.2.0)
gem-wrappers (1.2.5)
gyoku (1.0.0z2)
hashdiff (0.2.1, 0.0.6)
hiera (1.3.4)
io-console (0.3)
json (1.5.5)
json_pure (1.8.1)
mime-types (2.3)
mini_portile (0.6.0)
minitest (2.5.1)
net-ssh (2.7.0)
netrc (0.7.7)
nokogiri (1.6.3.1)
nori (1.1.5)
puppet (3.7.0)
rake (0.9.2.2)
rbvmomi (1.6.0.z1)
rdoc (3.9.5)
rest-client (1.7.2)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
trollop (2.0)

dvs_switch manifests can not be reapplied.

Currently dvs_switch host need to specify operation create/edit/remove. This results in a manifest that can not be re-applied:

host => [
  {
    host => "${esx1['hostname']}",
    operation => 'add',
    backing => {
      pnicSpec => [
        {pnicDevice => 'vmnic1', uplinkPortgroupKey => 'dvs1-uplink-pg'},
      ],
    },
    maxProxySwitchPorts => 128,
  }
]

We should consider hiding the API internals so the resource can behave more appropriately.

Better error reporting for failed license assigment

transport { 'vmware':
  username => 'administrator',
  password => 'password',
  server   => 'vcenter01.example.com',
  options  => { 'insecure' => true },
}

vc_datacenter { 'dc1':
  path      => '/dc1',
  ensure    => present,
  transport => Transport['vmware'],
}


esx_license { 'vcenter_license':
  ensure      => present,
  license_key => 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX',
  transport   => Transport['vmware'],
  require     => Transport['vmware'],
}

esx_license_assignment { 'vcenter.example.com':
  license_key => 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX',
  transport   => Transport['vmware'],
  require     => [ Transport['vmware'],
                   Esx_license['vcenter_license']],
}

The difference is rather small. If you try to assign a license to vcenter.example.com but the server is actually called vcenter01.example.com then you will get the following error:

Could not evaluate: undefined method `assignedLicense' for nil:NilClass

It would be good to encapsulate the license assignment in a try--except statement with a more detailed error telling you what you are trying to do.

Name parameter in esx_system_resource.

@maniacmurphy longer-term, I think we should discuss how we should model what is currently esx_system_resource.

In the code, we have the name attribute as the namevar, but by design it doesnt actually do anything...

  newparam(:name) do
    desc "A unique name that will allow for setting the same resource on multiple hosts 
or multiple resources on the same host through multiple resource calls within your
 puppet manifest."
  end

This, to me, feels like trying to have your cake and eat it. By grouping all the configurable elements into one resource type you lose the ability to manage individual elements from different resources. The workaround here is to make the namevar a non-configurable attribute that only serves to provide uniqueness to resource declarations in the catalog.

The purpose of uniqueness in Puppet is to make the managed entities unique, and this work around loses this thus also losing strict idempotency. Consider this....

esx_system_resource { 'foo':
   host => '192.168.2.11',
   cpu_limit => '4000',
   ....
  }

esx_system_resource { 'bar':
   host => '192.168.2.11',
   cpu_limit => '9999',
   ....
  }

We should not be able to do that in Puppet and it will result in unpredictable behaviour.

One possible workaround would be a generic esx_system_resource_setting type that would look something like;

esx_system_resource_setting { '192.168.2.11:cpu_limit':
   value => '4000',
}

Something like that - with title_patterns mapping the host and setting attributes from the title.

You'd have to validate the value depending on what the setting is, which isn't so bad.

You could then replicate existing behaviour by providing a defined resource type called vcenter::esx_system_resource that churns out esx_system_resource_setting types but maintains the uniqueness of each setting.

I'm not saying the above is definitely the solution, but I do think we need to re-think this type going forward.

Thoughts?

Transport resource not being found

When I install the module on a node and puppet apply the following code everything works fine.

transport{'vcenter':
	username => '[email protected]',
	password => $pass,
	server	 => 'vcenter.domain.local',
	options  => { 'insecure' => true },
}
vc_folder{'/DC1/Folder':
	ensure => present,
	transport => Transport['vcenter'],
}

When the code is moved to a master and a puppet agent -t is run, the following error is thrown.

Error: /Stage[main]/Profile::Vsphere/Vc_folder[/DC/Folder]: Could not evaluate: Invalid transport Transport[vcenter] provided for Vc_folder[/DC/Folder]

I'm unsure where to begin to troubleshoot this further. Is anyone else using this in a master, agent configuration? Has this error been seen before?

Rbvmomi 1.8.1 and deprecation for Ruby 1.8.7

Version 0.1.0 will be the last version supporting Ruby 1.8.7. We are targeting Ruby 1.9.3 (maybe 2.0.0) with the intention using rbvmomi ~1.8.0. We no longer plan to support the custom Rbvmomi 1.6.0z1 gem in this module.

esx_advanced_options not persistant

When using the esx_advanced_options type it does not appear to set values persistently. When running puppet apply with the following sudo code:

# hiera data 
pod::vcenter::esxi::esx_advanced_options:
  Config.HostAgent.plugins.solo.enableMob: false
  Security.AccountUnlockTime: 900
  Security.AccountLockFailures: 3
  UserVars.DcuiTimeOut: 600
  Security.PasswordQualityControl: "retry=3 min=disabled,disabled,disabled,7,7"
  UserVars.ESXiShellInteractiveTimeOut: 900
  UserVars.ESXiShellTimeOut: 900
  Mem.ShareForceSalting: 2
  DCUI.Access: root

# puppet code
        esx_advanced_options { $esxi_server_name:
          options   => $esx_advanced_options,
          require   => Vc_host[$esxi_server_name],
          transport => Transport['vcenter'],
        }

You get the following output on the command line:

Notice: /Stage[main]/Pod::Vcenter::Esxi/Esx_advanced_options[esx00002.pod0000x.sys00004.il2management.local]/options: options changed {'Config.HostAgent.plugins.solo.enableMob' => 'false', 'DCUI.Access' => 'root', 'Mem.ShareForceSalting' => '2', 'Security.AccountLockFailures' => '3', 'Security.AccountUnlockTime' => '900', 'Security.PasswordQualityControl' => 'retry=3 min=disabled,disabled,disabled,7,7', 'UserVars.DcuiTimeOut' => '600', 'UserVars.ESXiShellInteractiveTimeOut' => '900', 'UserVars.ESXiShellTimeOut' => '900'} to '{"Config.HostAgent.plugins.solo.enableMob"=>false, "Security.AccountUnlockTime"=>900, "Security.AccountLockFailures"=>3, "UserVars.DcuiTimeOut"=>600, "Security.PasswordQualityControl"=>"retry=3 min=disabled,disabled,disabled,7,7", "UserVars.ESXiShellInteractiveTimeOut"=>900, "UserVars.ESXiShellTimeOut"=>900, "Mem.ShareForceSalting"=>2, "DCUI.Access"=>"root"}'

If you run puppet apply immediately again, you will get the same output again. This seems to suggest that either the settings are not being applied persistently of the resource type/provider does not have a reliable way of determining and comparing the current settings.

Implement edit and remove API capability for dvswitch resource

When creating a dvswitch in the following manner:

    vcenter::dvswitch{ "${dvswitch_fqdn}:${esxServer}":
      ensure    => present,
      transport => Transport['vcenter'],
      spec => {
        host => [
          {
            host => $esxServer,
            operation => 'add',
          }
        ]
      }
    }

The operation is always add. This sorta breaks the idempotency concept in puppet and potentially if possibly the type/provider should take care of the operation type. The API also supports edit and remove.

vc_vm: existing portgroup will not be assigned

I´m using type vc_vm.rb to create new virtual machines with puppet in vcenter. Inside the manifest i have declared a existing portgroup, wich has been already configured in vcenter.
After completion of deployment process i notice that VM has no connectivity with used portgroup, cause a new one has been created instead of using the exisiting inside the distributed switch.

I´m using the network_interfaces paramter in vc_vm.rb.

Had someone experiences with applying existing portgroup for VM deplyoment? Should be used another paramater/type for assign portgroup and ip-address?

Resource type needed to set firewall settings

Currently firewall settings is set as follows in a kickstart file for esxi:

# enable firewall
esxcli network firewall set --default-action false --enabled yes

# services to enable by default
FIREWALL_SERVICES='syslog sshClient ntpClient updateManager httpClient netdump'
for SERVICE in ${FIREWALL_SERVICES}; do
    esxcli network firewall ruleset set --ruleset-id ${SERVICE} --enabled yes
done

It would be useful, to have a resource type that can be used to create firewall entries.

Creating VM folders

Is this even possible at the moment?

When using vc_folder - the folders are created as Yellow folders (Hosts and Clusters view)

Is it possible to create Blue folders (VM's and templates view)?

Update metadata.json

Hi,

Can you please update the metadata.json to include the "requirements" section that contains the Puppet Version requirements? Thanks!

Implement SNMP settings

It would be useful to extend the module to allow for the setting of SNMP community strings and other SNMP related settings as allowed by the API.

vc_dvportgroup creation failed | InvalidRequest: Unable to resolve WSDL method name CreateDVPortgroup_Task

When I try to create a portgroup on a existing distributed switch in vmware vcenter with puppet and the type vc_dvportgroup.rb (https://github.com/dell-asm/vmware-vcenter/blob/master/lib/puppet/type/vc_dvportgroup.rb) an error occurred with CreateDVPortgroup_Task, please see the full output listed below.
This behavior occurs only if a the new portgroup will be created. Once the portgroup exists already in vmware vcenter, the portgroup will be found and overwritten with the settings based on the manifest. Additionally I tried to create a dv_switch without any error.

I tried configurations /parameters in puppet manifest without any luck. I would be very pleased about an answer

error of dvportgroup creation:

Error: Could not set 'present' on ensure: InvalidRequest: Unable to resolve WSDL method name CreateDVPortgroup_Task for namespace name urn:vim25

while parsing SOAP body
at line 1, column 167

while parsing SOAP envelope
at line 1, column 0

while parsing HTTP request before method was determined
at line 1, column 0 (file: /etc/puppetlabs/code/environments/integration/site/vcenterconf/manifests/init.pp, line: 71)
Error: Could not set 'present' on ensure: InvalidRequest: Unable to resolve WSDL method name CreateDVPortgroup_Task for namespace name urn:vim25

while parsing SOAP body
at line 1, column 167

while parsing SOAP envelope
at line 1, column 0

while parsing HTTP request before method was determined
at line 1, column 0 (file: /etc/puppetlabs/code/environments/integration/site/vcenterconf/manifests/init.pp, line: 71)
Wrapped exception:
InvalidRequest: Unable to resolve WSDL method name CreateDVPortgroup_Task for namespace name urn:vim25

while parsing SOAP body
at line 1, column 167

while parsing SOAP envelope
at line 1, column 0

while parsing HTTP request before method was determined
at line 1, column 0
Error: /Stage[main]/Vcenterconf/Vc_dvportgroup[/BRM/TACN_VZDCN:pg_vlan]/ensure: change from 'absent' to 'present' failed: Could not set 'present' on ensure: InvalidRequest: Unable to resogroup_Task for namespace name urn:vim25

while parsing SOAP body
at line 1, column 167

while parsing SOAP envelope
at line 1, column 0

while parsing HTTP request before method was determined
at line 1, column 0 (file: /etc/puppetlabs/code/environments/integration/site/vcenterconf/manifests/init.pp, line: 71)

output of manifest vc_dvportgroup:

vc_dvportgroup { "/$datacenter/$vm_dvswitch:pg_vlan":
#dvportgroup_name => "/${datacenter}/$vm_dvswitch:$vm_vlan_name",
ensure => present,
transport => Transport['vcenter'],
num_ports => '8',
auto_expand => true,
type => 'earlyBinding',
policy_block_override_allowed => true,
policy_ipfix_override_allowed => false,
policy_live_port_moving_allowed => false,
policy_network_resource_pool_override_allowed => false,
policy_port_config_reset_at_disconnect => false,
policy_shaping_override_allowed => false,
policy_vendor_config_override_allowed => false,
default_port_config_vlan_type_vmware_distributed_virtual_switch_vlan_id_spec_inherited => false,
default_port_config_vlan_type_vmware_distributed_virtual_switch_vlan_id_spec_vlan_id => '1000',
default_port_config_network_resource_pool_key_inherited => false,
}

Cannot get the examples to work

I have tried to populate the sample-data.pp and cluster-12-setup.pp examples

I keep on getting the exact same error

Error: /Stage[main]//Vc_datacenter[/testdc1]: Could not evaluate: uninitialized constant RbVmomi

I have installed ruby through rbenv - I do not know if that has anything to do with it or not

More meaningfull error messages when Transport is not specified

When transport is not specified for a resource the error message can be a bit cryptic. Having a clearer message will help to more quickly get to the bottom of a problem in the catalogue. Typical error message would be:

Error: /Stage[main]/Main/Esx_vswitch[esx00001:testSwitch]: Could not evaluate: undefined method `server' for nil:NilClass

This is issue is intended for @crayfishx

New Resource Pool

I have been trying to create a new resource pool under a cluster. I cannot find the resource to do this. Is there something I am missing?

better validation for resources generated by PuppetX::VMware::Mapper

There's several resources generated using PuppetX::VMware::Mapper. Currently we validate the input only if it matches mapped property, but we don't actually check if the property hash is valid and don't raise any exceptions i.e the following is invalid but accepted and applied silently with no errors:

typeVMwareDistributedVirtualSwitchTrunkVlanSpec => { ... }

v.s.:

typeVmwareDistributedVirtualSwitchTrunkVlanSpec => { ... }

Create resource type to support vcenter advanced settings

Currently there appears to be no way of setting vcenter advanced settings, only esxi advanced settings. Typical settings to be set would be:

  • vpxd.certmgmt.certs.minutesBefore
  • VirtualCenter.ManagedIP

These settings would not appear on a cleanly installed vcenter but only after it is set.

The Screenshot gives an example of the default settings.
screen shot 2016-08-11 at 12 01 48

Please update Puppetforge

The version pulled from Puppet forge is dated 2013 and appears to differ from the code in github- notably the vc_dvswitch_migrate function is absent. Please push new version to Puppet forge.

esx_advanced_options is not idempotent

esx_advanced_options is not idempotent and updates the value even if there is no change.

transport { 'esxhost1':
  username => 'root',
  password => '12345',
  server   => '192.168.163.144',
  options  => { 'insecure' => true },
}

vcenter::syslog_loggers { "192.168.163.144":
  esxi_version     => 6,
  transport_string => "esxhost1", #use same string as transport
  logger_options   => {
    "Syslog.loggers.fdm.rotate"              =>  30,
    "Syslog.loggers.fdm.size"                =>  12096,
    "Syslog.loggers.hostd.rotate"            =>  30,
    "Syslog.loggers.hostd.size"              =>  12096,
    "Syslog.loggers.vsantraceUrgent.rotate"  =>  30,
    "Syslog.loggers.vsantraceUrgent.size"    =>  12096,
    "Syslog.loggers.vvold.rotate"            =>  30,
    "Syslog.loggers.vvold.size"              =>  12096,
  }
}

the above code is used to test it. it show all the options changed irrespective of whatever settings it has on the end server.

root@puppet:~# puppet apply -v vcenter_esx_test.pp 
Notice: Scope(Vcenter::Syslog_loggers[192.168.163.144]): Merged Hash: {Syslog.loggers.fdm.rotate => 30, Syslog.loggers.fdm.size => 12096, Syslog.loggers.hostd.rotate => 30, Syslog.loggers.hostd.size => 12096, Syslog.loggers.vsantraceUrgent.rotate => 30, Syslog.loggers.vsantraceUrgent.size => 12096, Syslog.loggers.vvold.rotate => 30, Syslog.loggers.vvold.size => 12096}
Notice: Compiled catalog for puppet.pod00099.sys00099.skyscape.cloud in environment production in 0.39 seconds
Info: Applying configuration version '1464172929'
Notice: /Stage[main]/Main/Vcenter::Syslog_loggers[192.168.163.144]/Esx_advanced_options[192.168.163.144]/options: options changed {'Syslog.loggers.fdm.rotate' => '30', 'Syslog.loggers.fdm.size' => '12096', 'Syslog.loggers.hostd.rotate' => '30', 'Syslog.loggers.hostd.size' => '12096', 'Syslog.loggers.vsantraceUrgent.rotate' => '30', 'Syslog.loggers.vsantraceUrgent.size' => '12096', 'Syslog.loggers.vvold.rotate' => '30', 'Syslog.loggers.vvold.size' => '12096'} to '{"Syslog.loggers.fdm.rotate"=>30, "Syslog.loggers.fdm.size"=>12096, "Syslog.loggers.hostd.rotate"=>30, "Syslog.loggers.hostd.size"=>12096, "Syslog.loggers.vsantraceUrgent.rotate"=>30, "Syslog.loggers.vsantraceUrgent.size"=>12096, "Syslog.loggers.vvold.rotate"=>30, "Syslog.loggers.vvold.size"=>12096}'
Notice: Applied catalog in 4.52 seconds


root@puppet:~# puppet apply -v vcenter_esx_test.pp 
Notice: Scope(Vcenter::Syslog_loggers[192.168.163.144]): Merged Hash: {Syslog.loggers.vvold.rotate => 30, Syslog.loggers.vvold.size => 12096, Syslog.loggers.fdm.rotate => 30, Syslog.loggers.fdm.size => 12096, Syslog.loggers.hostd.rotate => 30, Syslog.loggers.hostd.size => 12096, Syslog.loggers.vsantraceUrgent.rotate => 30, Syslog.loggers.vsantraceUrgent.size => 12096}
Notice: Compiled catalog for puppet.pod00099.sys00099.skyscape.cloud in environment production in 0.38 seconds
Info: Applying configuration version '1464173137'
Notice: /Stage[main]/Main/Vcenter::Syslog_loggers[192.168.163.144]/Esx_advanced_options[192.168.163.144]/options: options changed {'Syslog.loggers.fdm.rotate' => '30', 'Syslog.loggers.fdm.size' => '12096', 'Syslog.loggers.hostd.rotate' => '30', 'Syslog.loggers.hostd.size' => '12096', 'Syslog.loggers.vsantraceUrgent.rotate' => '30', 'Syslog.loggers.vsantraceUrgent.size' => '12096', 'Syslog.loggers.vvold.rotate' => '30', 'Syslog.loggers.vvold.size' => '12096'} to '{"Syslog.loggers.vvold.rotate"=>30, "Syslog.loggers.vvold.size"=>12096, "Syslog.loggers.fdm.rotate"=>30, "Syslog.loggers.fdm.size"=>12096, "Syslog.loggers.hostd.rotate"=>30, "Syslog.loggers.hostd.size"=>12096, "Syslog.loggers.vsantraceUrgent.rotate"=>30, "Syslog.loggers.vsantraceUrgent.size"=>12096}'
Notice: Applied catalog in 4.23 seconds

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.