Git Product home page Git Product logo

nutanix_vm_provisioner's People

Contributors

mbach04 avatar twling 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nutanix_vm_provisioner's Issues

Concatenate str

We are getting an error at the Stash the image task. Can you advice what is the purpose of default([])? from our understanding it seems that you are trying to set the variable image_uuids to the result of query: default([]) + [ {'name': item.spec.name, 'uuid': item.metadata.uuid but please correct me if I am wrong. I am trying to see if I can write another query to get the value and define the variable

Error:
fatal: [nutanixserver]: FAILED! => {"msg": "Unexpected templating type error occurred on ({{ image_uuids | default([]) + [ {'name': item.spec.name, 'uuid': item.metadata.uuid } ] }}): can only concatenate str (not "list") to str"}

  • name: Stash the image UUIDs
    set_fact:
    image_uuids: "{{ image_uuids | default([]) + [ {'name': item.spec.name, 'uuid': item.metadata.uuid } ] }}"

Unable to auth to cluster

Hi, thanks for creating this role ! I am currently testing and had a question. In the playbook you have in the example you list localhost, when I try on mine I can see:

TASK [nutanix_provisioner : Auth to the cluster] ********************************************************************************************************************************************************************************************
fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in "/tmp". Failed command was:

So I changed the localhost to an inventory list that has my NTNX cluster IP but failed to auth.

  • Are there any configs to be done on the NTNX side like adding ssh keys?
  • Are you running the roles inside the NTNX server?

Thanks!

Issue at task: Create fact with VM template

Hi Matt,

Getting an error when it gets to the task: Create fact with VM template. I'm also using python 3 as when I researched the error some people stated that python 3 removed dict.iteritems

ACTUAL RESULTS

TASK [nutanix_provisioner : Create fact with VM template contents] **************************************************************************************************************************************************************************

fatal: [10.71.30.80]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'iteritems'\n\nThe error appears to be in '/etc/ansible/roles/nutanix_provisioner/tasks/provision_vm.yml': line 11, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Create fact with VM template contents\n ^ here\n"}

Issue creating VM with disks in specific storage container

I've tried examining the API for creating a VM from the explorer on my Nutanix cluster, however several of the fields in vm-body.yml.j2 and the official field names in the REST API explorer are different, for example "nic_list" in the j2 file and "vm_nics" on the REST API explorer. I've attempted to include the storage_container_uuid: "string" in the vm-body.yml.j2 file and received the following error. We're trying to place the disks within a container that has compression and EC enabled and would really rather not use the default container with edits made to it's config. Any help would be appreciated, below is the contents of my vm-body.yml/j2 file.

api_version: '3.0'
metadata:
kind: vm
spec:
cluster_reference:
kind: cluster
uuid: {{ cluster_uuid }}
name: {{ vm.vm_name }}
resources:
disk_list:
- data_source_reference:
kind: image
uuid: {{ image_uuid }}
{% for disk in vm.vm_disk_list %}
{% for k,v in disk.items() %}
- {{ k }}: {{ v }}
{% endfor %}
{% endfor %}
memory_size_mib: {{ vm.vm_ram }}
nic_list:
{% if vm.vm_ip is defined %}
- ip_endpoint_list:
- ip: {{ vm.vm_ip }}
{% endif %}
{% if subnet_uuid is defined and vm.vm_ip is defined %}
subnet_reference:
kind: subnet
uuid: {{ subnet_uuid }}
{% elif subnet_uuid is defined and vm.vm_ip is not defined %}
- subnet_reference:
kind: subnet
uuid: {{ subnet_uuid }}
{% endif %}
num_sockets: {{ vm.vm_num_sockets }}
num_vcpus_per_socket: {{ vm.vm_num_cpu_per_socket }}
storage_container_uuid: {{ storage_cont_uuid }}
power_state: 'ON'
guest_customization:
cloud_init:
user_data: {{ lookup('template','cloud-init.yml.j2') | b64encode }}

Issue creating VM without guest customization

Hello!

We are trying to use Playbook without the guest customization at first, but are encountering error we cant seem to find a solution.

Playbook:

  • name: Provision some VMs
    hosts: localhost
    gather_facts: false
    vars:
    my_vms:
    - {vm_name: 'test', vm_ip: '10.0.0.0', vm_ram: 2048, vm_num_cpu_per_socket: 1, vm_num_sockets: 4, vm_disk_list: [disk_size_mib: 10000]}
    tasks:
    • name: Provision VMs on Nutanix
      include_role:
      name: nutanix
      vars:
      vm_defs: "{{ my_vms }}"

Removed the following lines from vm-body.yml.y2:
guest_customization:
cloud_init:
user_data: {{ lookup('template','cloud-init.yml.j2') | b64encode }}

Error is following:
TASK [nutanix : Debug | Print VM definitions] *********************************************************************************************************************************************************************************************************************
ok: [localhost] => {
"vm_defs": [
{
"vm_disk_list": [
{
"disk_size_mib": 10000
}
],
"vm_ip": "10.0.0.0",
"vm_name": "test",
"vm_num_cpu_per_socket": 1,
"vm_num_sockets": 4,
"vm_ram": 2048
}
]
}

TASK [nutanix : Create fact with VM template contents] ************************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "Unexpected templating type error occurred on ({{ lookup('template', 'vm-body.yml.j2') | from_yaml }}): a string or stream input is required"}

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.