vmware-archive / vmware-vcenter

VMware vCenter Module
Other
87 stars 102 forks source link

Creating new vmknics #151

Closed noesberger closed 10 years ago

noesberger commented 10 years ago

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)

rbbrown commented 10 years ago

You wrote in part "creating a completly new vmknic fails. It seems that it has problems to create the portgroup."

Perhaps I misunderstand what you are doing. It seems that you are using the 'esx_vmknic' resource to create a vmknic and expecting that a new portgroup will be created automatically. This doesn't work. In fact, the portgroup must be created before the esx_vmknic resource is used.

Please see the manifest tests/cluster-123-go.pp for an example showing how to create a dvswitch with portgroups, then create vmknics that use those portgroups.

rbbrown commented 10 years ago

Please see the manifest tests/cluster-123-go.pp for an example showing how to create a dvswitch with portgroups, then create vmknics that use those portgroups.

Of course, you may also create the portgroups using the GUI to allow a quick test of your esx_vmknic manifest.

noesberger commented 10 years ago

Hi, thanks for the fast answer. But we're using for most of the vmknics standard switches and not dvs. Is there a solution for creating standard switches and portgroups for them.

rbbrown commented 10 years ago

I know of no existing solution for standard switches in puppet.

There are a few choices (perl SDK, ESXi CLI; perhaps Power CLI) that can be used to write scripts to configure almost all properties of standard switches. Those wouldn't be good tools to write a fully-generalized data-driven configuration system like puppet, but they are adequate for replicating standardized configurations to specific instances. For such purposes, using these tools would probably be a lot easier than adding new types and providers to vmware-vcenter.

perl SDK http://pubs.vmware.com/vsphere-55/topic/com.vmware.sdk.doc/GUID-2F1B2F72-92F1-442C-8283-CF5736392DEA.html vSphere CLI, PowerCLI http://pubs.vmware.com/vsphere-55/topic/com.vmware.vsphere.scripting.doc/GUID-7F7C5D15-9599-4423-821D-7B1FE87B3A96.html

noesberger commented 10 years ago

At the moment I'm using PowerCli Scripts or vCenter Orchestrator for configuring the ESXi Servers. I'm evaluating what I'm could do with puppet. I wouldn't like to mix puppet and Powercli to much.

For managing/configuring the windows servers I'm testing at the moment Powershell DSC. It could also a good solution to write DSC Modules for configuring the ESX Servers and deploy them with puppet. With this solution I can use the benefits of puppet with hiera and can easy write DSC module with the use of vSphere PowerCLI.

Thanks for your answer.

rbbrown commented 10 years ago

Thanks for bringing up Powershell DSC. I had not heard of it.

Since ESXi doesn't run on Windows :-) you will need to write DSC providers that run in what puppet calls 'proxy' mode. That means simply that the module uses a network API to gather data on the current state of the system and to make required changes. Most of our vSphere and vShield providers run in puppet's proxy mode; they may help you understand the concepts.

Good luck. I will close this issue; feel free to reopen if DSC doesn't work out, or open a new issue if you have other needs.