linux - 测试厨房卡在 "creating virtual machine"

标签 linux chef-infra hyper-v chef-recipe test-kitchen

使用 hyperv 在 Windows 10 上运行 chefdk

我可以使用 kitchen create 创建 Windows VM,它工作正常,但我刚刚尝试了 Linux VM,但我遇到了这个错误:

PS> kitchen create
-----> Starting Kitchen (v1.10.0)
-----> Creating <default-centos-72>...
       Creating differencing disk for default-centos-72.
       Created differencing disk for default-centos-72.
       Checking for existing virtual machine.
       Creating virtual machine for default-centos-72.
       Created virtual machine for default-centos-72.

QBiA...AA== -outputformat Text ----
STDOUT:
STDERR: #< CLIXML
---- End output of c:\windows\sysnative\windowspowershell\v1.0\powershell.exe -noprofile -executionpolicy bypass -encodedcommand LgAg...AA== -outputformat Text ----

ProcessId: 18780
app_name: c:\windows\sysnative\windowspowershell\v1.0\powershell.exe
command_line: c:\windows\sysnative\windowspowershell\v1.0\powershell.exe -noprofile -executionpolicy bypass -encodedcommand LgAgAEM...BjADC0ASgBzAG8AbgAKAA== -outputformat Text
timeout: 600] on default-centos-72
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

现在它确实创建了一个 VM,我可以通过 PuTTY 手动 ssh 或通过 Windows 的 openssh 从 cmd 手动进入,所以我不知道为什么它挂起 - 看起来它无法访问它。

这是我的.kitchen.yml:

---
driver:
  name: hyperv
  parent_vhd_folder: c:\HyperV\VHDs\
  parent_vhd_name: CentOS-7.vhdx
  vm_switch: NAT
  memory_startup_bytes: 2GB

provisioner:
  name: chef_zero

transport:
  password: MyPassw1!@#

platforms:
  - name: centos-7.2

suites:
  - name: default
    run_list:
      - recipe[myrecipe::default]
    attributes:

编辑-更多信息: 服务器配置为 DHCP 当我查看 .kitchen 文件夹时,日志为空 .kitche\default-centos-72.yml 只列出一个 id(不知道那是否应该像 rdp 文件一样在其中包含管理员名称和 IP? 我还尝试在 .kitchen.yml 中指向一个静态 IP

最佳答案

@red888 虚拟机是否有最新的 guest 组件? Hyper-V 管理器是否看到与虚拟机网卡关联的 IP 地址?您可以在 hyper-v 管理器中或通过 Powershell 进行检查

(get-vm '你的虚拟机名称').networkadapters[0].ipaddresses

如果是,请在 https://github.com/test-kitchen/kitchen-hyperv 提交问题我很乐意深入挖掘。

您需要最新的集成组件(我认为 4.1 是最新的 - https://www.microsoft.com/en-us/download/details.aspx?id=51612)

关于linux - 测试厨房卡在 "creating virtual machine",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38783630/

相关文章:

linux - 32 位守护进程可以在 64 位 linux 上运行吗

environment-variables - Chef Recipe - 重新加载路径

azure - Windows Phone 模拟器错误、Hyper-V 组件未运行、Windows Azure 中托管的 Windows 8.1

windows - Windows 上的同居 Docker 和 VirtualBox

android - 适用于 Android 的 Visual Studio 模拟器 - 模拟设备运行需要内部虚拟网络交换机

linux - 如何生成与模式不匹配的字符串元素?

c - 使用 "syscall"而不是直接调用函数的原因是什么?

docker - 来自守护程序的错误响应:容器f88566c370dd未运行

sql - 使用 Chef 运行所有 sql 文件

c - 对于 pthread,如何从主线程中杀死子线程