我使用VirtualBox的詹金斯插件,推出不同的建立从Git的获取来源。 我想每个VM环境通过启动他们为构建之前恢复快照是干净的。
我试了好东西https://wiki.jenkins-ci.org/display/JENKINS/Slave+Setup+Plugin 。 最后,我不认为这是因为它是git仓库被克隆后,被称为一个好的解决办法。但是我也试图“通过对主机的指令的执行”,这需要作为参数的名称推出从VM并调用该脚本:
VBoxManage registervm "C:\Users\mfauvet\VirtualBox VMs\%1\%1.vbox
VBoxManage controlvm %1 poweroff
VBoxManage snapshot %1 restore SetEnvironment
VBoxManage startvm %1
ssh 192.168.120.1 -p 1310
但是,我有以下错误:
C:\Program Files (x86)\Jenkins>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" registervm "C:\Users\mfauvet\VirtualBox VMs\Jenkins-Ubuntu13.10\Jenkins-Ubuntu13.10.vbox"
VBoxManage.exe: error: Trying to open a VM config 'C:\Users\mfauvet\VirtualBox VMs\Jenkins-Ubuntu13.10\Jenkins-Ubuntu13.10.vbox' which has the same UUID as an existing virtual machine
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component Machine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "OpenMachine(Bstr(a->argv[0]).raw(), machine.asOutParam())" at line 88 of file VBoxManageMisc.cpp
C:\Program Files (x86)\Jenkins>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm Jenkins-Ubuntu13.10 poweroff
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
C:\Program Files (x86)\Jenkins>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" snapshot Jenkins-Ubuntu13.10 restore SetEnvironment
0%...10%...20%...30%...40%...50%...
Progress object failure: RPC_S_SERVER_UNAVAILABLE 0x800706BA
Restoring snapshot 7f7cc1a3-7128-426a-bf74-9ffb0b3fbca8
C:\Program Files (x86)\Jenkins>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" startvm Jenkins-Ubuntu13.10
VBoxManage.exe: error: Could not find a registered machine named 'Jenkins-Ubuntu13.10'
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee IUnknown
VBoxManage.exe: error: Context: "FindMachine(Bstr(pszVM).raw(), machine.asOutParam())" at line 575 of file VBoxManageMisc.cpp
是否有人知道我怎么能解决这个问题? 还是有更好的方式通过詹金斯推出之前恢复对我的虚拟机快照? 谢谢阅读