Skip to content
Maxime C edited this page Feb 18, 2022 · 5 revisions

Jenkins Proxmox Plugin

Use Proxmox virtual machines as slaves in Jenkins

Configuration from Web Interface

Datacenter cloud

To add a new Proxmox datacenter cloud, click on "Manage Jenkins" then "Configure System". In the "Cloud" section click "Add cloud" and select "Datacenter".

Virtual machine slaves

To add slaves click on "Manage Jenkins" then "Manage Nodes". Select the node type "Slave virtual machine running on a Proxmox datacenter." and enter a name for the node.

Configuration as Code

jenkins:
  systemMessage: "Hello World"
  agentProtocols:
    - "JNLP4-connect"
  clouds:
    - datacenter:
        hostname: "company-proxmox"
        ignoreSSL: true
        password: "proxmox-pass"
        realm: "pve"
        username: "proxmox-user"
  nodes:
    - virtualMachineSlave:
        datacenterDescription: "proxmox-user@pve - company-proxmox"
        datacenterNode: "proxmox-node"
        launcher:
          jnlp
        labelString: "proxmox-label"
        mode: EXCLUSIVE
        name: "proxmox-vm"
        numExecutors: 1
        remoteFS: "/home/jenkins"
        retentionStrategy:
          demand:
            idleDelay: 1
            inDemandDelay: 0
        revertPolicy: BEFORE_JOB
        snapshotName: "proxmox-snapshot"
        startVM: true
        startupWaitingPeriodSeconds: 60
        virtualMachineId: 42

Proxmox node configuration options

Are defined here the parameters specific to a Proxmox VM Slave. For other parameters generic to all Slave types, please see https://javadoc.jenkins.io/hudson/model/Slave.html

datacenterNode - Datacenter Node

The proxmox server node to use

virtualMachineId - Virtual Machine

The virtual machine identifier on Proxmox node

snapshotName - Revert Snapshot

The snapshot to revert the virtual machine to when it is started.

startVM - Start Virtual Machine

The virtual machine will be started once the snapshot has been reverted. (Useful if the snapshot did not include RAM - and won't therefore be reverted in a running state).

revertPolicy - Revert policy

Snapshot revert can be done after every vm launch (connect etc.) or before every job.

  • AFTER_CONNECT: After connect to the virtual machine
  • BEFORE_JOB: Before every job executing on the virtual machine

startupWaitingPeriodSeconds - Startup Idle

Time to wait after revert before connect to virtual machine