【问题标题】:Using a Windows VM from Jenkins through vsphere通过 vsphere 使用来自 Jenkins 的 Windows VM
【发布时间】:2016-09-13 03:51:00
【问题描述】:

我正在尝试在 Jenkins 作业期间重置并启动 Windows VM(在 vsphere 中)。我成功安装了vSphere Cloud Plugin。我已经按照instructions 将 Windows 机器设置为 jenkins-mvn-slave,并将其设置为作为服务运行。

如果我在 Jenkins 中单击 Launch Slave Agent 的按钮,我可以看到(在 vsphere 中)VM 执行 revert snapshot,然后执行 power on virtual machine。如果我附加到机器上,我可以看到 Jenkins 服务自动启动。然而,回到詹金斯,它告诉我Slave did not come online in allowed time

我的奴隶的一些关键设置: Force VM launch: Checked Wait for VMTools: Not checked Delay between launch and boot complete: 120 Secondary launch method: Launch slave agents view Java Web Start

版本: Jenkins: 1.596.2 vSphere: 5.5.0 Windows: Server 2012 R2 Standard, Build 9600 vSphere plugin: 2.7

我错过了什么?

【问题讨论】:

    标签: windows jenkins jenkins-plugins vsphere


    【解决方案1】:

    自从我发布以来,我做了很多乱七八糟的事情,但我认为以下是我做错的事情。我首先让虚拟机作为普通的从代理工作。完成该工作后,我尝试设置与 vsphere-cloud-slave-agent 相同的设置。我没有意识到将主机设置为从代理是“特定于代理名称的”。

    于是,我卸载了Jenkins服务,启动了“vsphere cloud slave agent”,登录机器,运行javaws(前面提到的instructions指定。

    我遇到的其他一些问题(与最初的帖子无关,但可能与阅读本文的人有关):

    1. 我最初使用密码管理器安装了 git。不幸的是,由于 jenkins 作业不是交互式的,因此它挂在 git clone 命令上。我尝试卸载并重新安装 git,但对于 jenkins slave 运行的任何用户,它都没有解决问题。我最终不得不恢复到以前的从映像并从那里安装 git。 (我可能还可以找出运行 jenkins slave 的用户,并在那里输入所需的密码。)

    2. 我想为每个作业运行一个干净的 VM。我从来没想过这个。如果我将Availability 设置为Take this slave on-line when in demand and off-line when idle,这是一个好的开始。但是,如果我将时间设置为 0 和 0,则机器会不断重启。如果我将时间设置为 1 和 1,那么机器主要执行我想要的操作,除非有背靠背作业排队运行。

    【讨论】:

    猜你喜欢
    • 2014-07-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-08
    • 1970-01-01
    • 2021-06-21
    相关资源
    最近更新 更多