Giter Site home page Giter Site logo

ansible-vsphere's People

Contributors

dalcouffe avatar gcoffey avatar gianlu avatar ozans avatar smoscetti avatar tkinz27 avatar zeroem 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

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

ansible-vsphere's Issues

Attempting snapshot: 'NoneType object has no attribute 'rootSnapshotList'

I downloaded this module and added to my '.library' for snapshot and template testing. Even when following the exact format that you have laid out I'm still getting the following:

viasnap-output

My playbook looks like this:
viasat-playbook

I was looking into the module source but nothing is jumping out to me hence the lack of a pull request so my initial thought was that it was my playbook but like I stated it is an exact copy of what I saw in your documentation. Am I doing something incorrect here?

ESXi 5.5
pyvmomi 5.5.0-2014.1.1
ansible 1.9

Unable to use loops

Hi guys. I'm trying to use a loop to upgrade the vmware-tools of some vms in my vsphere cluster.
That's my playbook:

hosts: localhost
gather_facts: no
vars_files:
- vars/upgrade_vmware-tools.yml

*tasks: *

- name: Upgrade VmwareTools
local_action:
module: vsphere
host: "{{ vcenter_host }}"
login: '{{ vcenter_user }}'
password: "{{ vcenter_password }}"
timeout: 60
guest:
name: '{{ item.vmname }}'
state: "{{ item.state }}"
action: "{{ item.action }}"
with_items:
- { vmname: 'vm-001', state: 'running', action: 'upgrade_tools' }
- { vmname: 'vm-002', state: 'running', action: 'upgrade_tools' }
- { vmname: 'vm-003', state: 'running', action: 'upgrade_tools' }
- { vmname: 'vm-004', state: 'running', action: 'upgrade_tools' }
- { vmname: 'vm-005', state: 'running', action: 'upgrade_tools' }
- { vmname: 'vm-006', state: 'running', action: 'upgrade_tools' }
- { vmname: 'vm-007', state: 'running', action: 'upgrade_tools' }
- { vmname: 'vm-008', state: 'running', action: 'upgrade_tools' }

But sadly the playbook run fails miserably with this error ๐Ÿ’ฅ :

PLAY [localhost] **************************************************************

TASK: [Upgrade VmwareTools] ***************************************************
fatal: [localhost -> 127.0.0.1] => One or more undefined variables: 'item' is undefined

FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
to retry, use: --limit @/root/upgrade_vmware-toolsNEW.retry

localhost : ok=0 changed=0 unreachable=1 failed=0

Example of deviceChange?

I'm looking for an example of how to fill in the information for deviceChange (for the spec in a VM clone). In particular, I'd like to be able to modify the NIC settings. I understand how to do this in pyvmoni but I'm not sure what the YAML is supposed to look like in the playbook. If there's another example that you have outside of the NIC, that would probably be helpful too.

I've tried the following as an example:

              config:
                VirtualMachineConfigSpec:
                  name: "testName"
                  memoryMB: 2048
                  numCPUs: 1
                  deviceChange:
                    files: {
                      VirtualMachineFileInfo: {
                        vmPathName: "[datastore]testname"
                      }
                    }

This always ends up with:
TypeError: For "deviceChange" expected type vim.vm.device.VirtualDeviceSpec, but got str

Add a virtual network device with a distributed virtual port group backing

Hi,

As far as I could gather, it isn't possible to have a distributed virtual port group as backing for a network device with this plugin. Please advise if this is not true.

In order to set it up, one needs to create a DistributedVirtualSwitchPortConnection whose attributes portgroupKey and switchUuid need to be fetched from a ManagedObjectReference to a DistributedVirtualPortGroup. Is this even possible with this plugin?

Here is some code for pyvmomi below that can accomplish this. Please let me know about the complexity of adding such a feature into the plugin.

--Ozan

            nicspec = vim.vm.device.VirtualDeviceSpec()
            nicspec.operation = vim.vm.device.VirtualDeviceSpec.Operation.add
            nicspec.device = nic_type
            nicspec.device.wakeOnLanEnabled = True
            nicspec.device.deviceInfo = vim.Description()

            #Configuration for DVPortgroups
            pg_obj = self.get_obj(content, [vim.dvs.DistributedVirtualPortgroup], net_name)
            dvs_port_connection = vim.dvs.PortConnection()
            dvs_port_connection.portgroupKey= pg_obj.key
            dvs_port_connection.switchUuid= pg_obj.config.distributedVirtualSwitch.uuid
            nicspec.device.backing = vim.vm.device.VirtualEthernetCard.DistributedVirtualPortBackingInfo()
            nicspec.device.backing.port = dvs_port_connection

change spec for existing VM

Hi

we would like to use the module vsphere and to change the IP, CPU , Mem for existing VM
and we struggle to knpw which task to use

could help us here? is the module support it? if yes could you send eaxmple?

ansible-doc fails to print module documentation

ansible-doc seem to fail to process the colons in documentation string of the module:

#  ansible-doc vsphere
Traceback (most recent call last):
  File "/home/vikentiik/.pyenv/versions/infi/lib/python2.7/site-packages/ansible-1.8.2-py2.7.egg/ansible/utils/module_docs.py", line 54, in get_docstring
    doc = yaml.safe_load(child.value.s)
  File "build/bdist.linux-x86_64/egg/yaml/__init__.py", line 93, in safe_load
    return load(stream, SafeLoader)
  File "build/bdist.linux-x86_64/egg/yaml/__init__.py", line 71, in load
    return loader.get_single_data()
  File "build/bdist.linux-x86_64/egg/yaml/constructor.py", line 37, in get_single_data
    node = self.get_single_node()
  File "build/bdist.linux-x86_64/egg/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "build/bdist.linux-x86_64/egg/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "build/bdist.linux-x86_64/egg/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "build/bdist.linux-x86_64/egg/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "build/bdist.linux-x86_64/egg/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "build/bdist.linux-x86_64/egg/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "build/bdist.linux-x86_64/egg/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "build/bdist.linux-x86_64/egg/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "build/bdist.linux-x86_64/egg/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "build/bdist.linux-x86_64/egg/yaml/composer.py", line 110, in compose_sequence_node
    while not self.check_event(SequenceEndEvent):
  File "build/bdist.linux-x86_64/egg/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "build/bdist.linux-x86_64/egg/yaml/parser.py", line 382, in parse_block_sequence_entry
    if self.check_token(BlockEntryToken):
  File "build/bdist.linux-x86_64/egg/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "build/bdist.linux-x86_64/egg/yaml/scanner.py", line 220, in fetch_more_tokens
    return self.fetch_value()
  File "build/bdist.linux-x86_64/egg/yaml/scanner.py", line 580, in fetch_value
    self.get_mark())
ScannerError: mapping values are not allowed here
  in "<string>", line 32, column 38:
     ...          Accepted parameters are:
                                         ^
ERROR: module vsphere missing documentation (or could not parse documentation)

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.