hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.21k stars 4.43k forks source link

I can`t attach more memory without destroy vm #13368

Open q000p opened 6 months ago

q000p commented 6 months ago

On my Vagrantfile I change config.vm.provider :libvirt do |libvirt| libvirt.cpus = 16 libvirt.memory = 18000 end to config.vm.provider :libvirt do |libvirt| libvirt.cpus = 24 libvirt.memory = 24576 end And after vagrant up I have an error: root@HyperVoz:/vmachines/vm/buildpc4# vagrant up Bringing machine 'pcforbuild' up with 'libvirt' provider... ==> pcforbuild: Removing virtiofs devices for shared folders... ==> pcforbuild: Configuring virtiofs devices for shared folders... ==> pcforbuild: Creating shared folders metadata... /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/start_domain.rb:39:inmemory=': Call to virDomainSetMemory failed: Requested operation is not valid: domain is not running (Libvirt::DefinitionError) from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/start_domain.rb:39:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/set_boot_order.rb:22:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/share_folders.rb:22:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/prepare_nfs_settings.rb:21:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/synced_folders.rb:90:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/delayed.rb:22:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/synced_folder_cleanup.rb:31:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/plugins/synced_folders/nfs/action_cleanup.rb:28:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/prepare_nfs_valid_ids.rb:14:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:117:in block in finalize_action' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builder.rb:183:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:inblock in run' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/util/busy.rb:22:in busy' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:inrun' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/call.rb:56:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:117:in block in finalize_action' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builder.rb:183:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:inblock in run' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/util/busy.rb:22:in busy' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:inrun' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/call.rb:56:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/create_networks.rb:98:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/resolve_disk_settings.rb:143:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/provision.rb:83:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /root/.vagrant.d/gems/3.1.4/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/cleanup_on_failure.rb:21:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:117:in block in finalize_action' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builder.rb:183:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:inblock in run' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/util/busy.rb:22:in busy' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:inrun' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/call.rb:56:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/box_check_outdated.rb:39:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builtin/config_validate.rb:28:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/warden.rb:38:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/builder.rb:183:in call' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:inblock in run' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/util/busy.rb:22:in busy' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/action/runner.rb:104:inrun' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/machine.rb:247:in action_raw' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/machine.rb:216:inblock in action' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/environment.rb:649:in lock' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/machine.rb:202:incall' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/machine.rb:202:in action' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/batch_action.rb:89:inblock (2 levels) in run' ` What the reason?

weiyuhang2011 commented 3 months ago

I met the same problem. But I solve it by virsh command line. For example, virsh setmem <domain> <memory-size>