【发布时间】:2015-07-07 16:27:31
【问题描述】:
编写运行版本 1.7.2 的 vagrantfile 并使用 hyperv 提供程序时出现错误:
不应存在以下设置:内存
当我设置时:
config.vm.provider :hyperv do |v|
v.memory = 4096
end
【问题讨论】:
编写运行版本 1.7.2 的 vagrantfile 并使用 hyperv 提供程序时出现错误:
不应存在以下设置:内存
当我设置时:
config.vm.provider :hyperv do |v|
v.memory = 4096
end
【问题讨论】:
这可以通过以下方式修复:https://github.com/mitchellh/vagrant/issues/5260#issuecomment-72576686
我还没有看到 1.7.3 的官方时间表。我环顾四周,决定不想等待正式发布。
因此,如果您不能等待(像我一样),那么您可以使用我在上面指出的提交中更新的文件手动更新(这些也已合并到主分支中)。
假设你已经为 windows 安装了 Vagrant 1.7.2,那么你可以在你的机器上更新以下 3 个文件: 1. C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.2\plugins\providers\hyperv\action\import.rb 2. C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.2\plugins\providers\hyperv\config.rb 1. C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.2\plugins\providers\hyperv\scripts\import_vm.ps1
您将从此处获取更新的文件内容: 1.https://raw.githubusercontent.com/mitchellh/vagrant/master/plugins/providers/hyperv/action/import.rb 2.https://raw.githubusercontent.com/mitchellh/vagrant/master/plugins/providers/hyperv/config.rb 3.https://raw.githubusercontent.com/mitchellh/vagrant/master/plugins/providers/hyperv/scripts/import_vm.ps1
可能有一种更正式的方式将这些最近的更改拉到你的机器上,但我所做的是将 .bak 作为文件扩展名添加到我机器上的 3 个文件中,然后转到 GitHub 上更新文件的原始页面在 mitchellh/vagrant 的主分支中,将它们复制并粘贴到新文件中。
完成后,我就能够在 hyperV 中使用自定义的 vmname、内存和 cpucount 成功创建 VM。
希望对您有所帮助。
【讨论】: