cancel
Showing results for 
Search instead for 
Did you mean: 
rehman0288
Mission Specialist
Mission Specialist
  • 7,576 Views

Ansible proxmox_kvm module

Jump to solution

Hi Everyone,

Can someone help me in how to use proxmox_kvm module ? I want to create VM's using this module but was unable to understant how to use it. I have gone through the ansible-doc but unable to create a correct playbook for that. If some can share me the working it will be a great help.

Labels (3)
0 Kudos
1 Solution

Accepted Solutions
Lisenet
Starfighter Starfighter
Starfighter
  • 7,502 Views

Having looked at the error message closely, it might actually be an issue with SSL and not the firewall. Do you use a self-signed Proxmox certificate? If so, then you may need to tell urllib3 to ignore "invalid" SSL certificates.

I had a similar issue when using a dynamic Proxmox inventory, it refused to work with a self-signed certificate. Adding an option to ignore an invalid SSL certificate solved it for me.

View solution in original post

6 Replies
Lisenet
Starfighter Starfighter
Starfighter
  • 7,562 Views

When you say that you are unable to create a playbook, how far did you get and what exactly does not work? If you explain the problem, then it's more likely that somebody will be able to help you. Also, there are examples available that show how to create new VMs with minimal options. Have you tried these, and if so, which part did not work?

0 Kudos
rehman0288
Mission Specialist
Mission Specialist
  • 7,555 Views

Hi @Lisenet,  thanks for replying.

I have tried by using the example provided in the ansible-doc, can you please guide me where I am doing wrong. Below is my play.

name: create new vm with minimal packages
proxmox_kvm:
   api_user : root@pam
   api_password: redhat
   api_host : 192.168.0.11       #(ip of my local host)
   name : test1
   node : control-node          #(local host)

And I am getting this error:

"msg": "authorization on proxmox cluster failed with exception: HTTPSConnectionPool(host='192.168.0.11', port=8006): Max retries exceeded with url: /api2/json/access/ticket (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f0847f2f650>: Failed to establish a new connection: [Errno 111] Connection refused'

0 Kudos
Lisenet
Starfighter Starfighter
Starfighter
  • 7,531 Views

Is communication on a TCP port 8006 allowed between your ansible host and Proxmox? The error message says that the connection was refused. Check the firewall.

0 Kudos
rehman0288
Mission Specialist
Mission Specialist
  • 7,506 Views

Yup I have added port 8006 in firewalld, but still it showing same error.

0 Kudos
Lisenet
Starfighter Starfighter
Starfighter
  • 7,503 Views

Having looked at the error message closely, it might actually be an issue with SSL and not the firewall. Do you use a self-signed Proxmox certificate? If so, then you may need to tell urllib3 to ignore "invalid" SSL certificates.

I had a similar issue when using a dynamic Proxmox inventory, it refused to work with a self-signed certificate. Adding an option to ignore an invalid SSL certificate solved it for me.

rehman0288
Mission Specialist
Mission Specialist
  • 7,476 Views

Hi @Lisenet, Thanks a lot for the solution. After ignoring "invalid" in urllib3 it worked.

0 Kudos
Join the discussion
You must log in to join this conversation.