Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Increase Memory (RAM) in KVM without reboot
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Increase Memory (RAM) in KVM without reboot

danitfkdanitfk Member

Hello fellows :)


What is your suggestion about upgrade RAM in Linux-KVm for a VM without reboot or power off ?


Is it possible any way?

Danke :)

Thanked by 1vpsGOD

Comments

  • Nope.

  • SadySady Member

    Not possible, Period.

  • not linux, but can be done with hyper-v

  • From memory, you need the virtio_balloon driver running

    You can hotplug CPUs and increase/decrease RAM

  • Should work if the host has virtio_balloon enabled and your VM has the kernel module loaded (modprobe while running does not work).

  • XsltelXsltel Member, Host Rep

    its possible . but you will need to create KVM with max-memory capability with virt-install

    virt-install .... --memory 512,maxmemory=1024

    and you can use virsh to increase decrease memory using :

    virsh setmem kvm-name 1024M --live


    if KVM is already created then you can set max-memory but you will need to reboot KVM only once and then you can increase/decrease memory as you want . to set max mem on already created KVM use below virsh commands

    virsh destroy kvm-name #stop kvm-name

    virsh setmaxmem kvm-name 2048M --config #set max memory and save to config

    virsh start kvm-name #start kvm

    virsh setmem kvm-name 512M --live #set memory to 512M

    virsh setmem kvm-name 1024M --live #increase memory to 1024M without reboot.

    Thanked by 1perennate
  • Fwiw, it works great in Xen :)

  • smansman Member

    Works great on OpenVZ too. You can change all resources on the fly no reboots necessary. Including reducing storage size. Yet another reason I love OpenVZ.

  • AdventureTimeAdventureTime Member
    edited March 2015

    I have removed the script in order to prevent more people overreacting to it. Have a great day.

  • AdventureTime said: It is easy.

    Just OMG!

  • perennateperennate Member, Host Rep
    edited March 2015

    AdventureTime said: It is easy.

    I don't get it, are you trolling? Your script seems to just dump the buffers / filesystem cache and drop swap.

    I'm asking because OP's question was serious and valid, so if you're trolling then I don't understand why you would decide to troll in this topic.

  • Well, if you just read the title "Increase Memory (RAM) in KVM without reboot", maybe that answer is valid in some way

  • perennateperennate Member, Host Rep

    yomero said: Well, if you just read the title "Increase Memory (RAM) in KVM without reboot", maybe that answer is valid in some way

    Sure, if you define the total virtual RAM of your VM as the memory minus buffers minus cache, which is not how people usually define RAM and certainly not what the OP was asking. Like, I might find AdventureTime's comment funny if OP was demanding that the cached and buffer memory be freed for use by his or her processes, but that's not the case here.

    Thanked by 1yomero
  • @AdventureTime said:
    It is easy.

    Create a bash script, example /etc/freememory.sh and enter the following if you are using a root account.

    Also, this method only works in KVM-based servers.

    This is not right

  • @MarkTurner said:
    Just OMG!

    Oh sorry.

    @perennate said:
    I'm asking because OP's question was serious and valid, so if you're trolling then I don't understand why you would decide to troll in this topic.

    My sincere apologies. I thought the thread is like the user wants to empty out the memory or something. I was sleepy a few hours ago, I was awake for more than 24 hours. So, I thought the words "Increase RAM" means to "empty them out" or something. I mean no harm. And for the nth time, I'm not trolling, that word is not in my vocabulary.

    @yomero said:
    Well, if you just read the title "Increase Memory (RAM) in KVM without reboot", maybe that answer is valid in some way

    Yes, my fault, my bad.

    @perennate said:
    Sure, if you define the total virtual RAM of your VM as the memory minus buffers minus cache, which is not how people usually define RAM and certainly not what the OP was asking. Like, I might find AdventureTime's comment funny if OP was demanding that the cached and buffer memory be freed for use by his or her processes, but that's not the case here.

    YES, I WAS WRONG. CHILL PEOPLE.

    @xDragonZ said:
    This is not right

    Are you guys like totally perfect and never made a single mistake in your lives? I misread the thread title. Move on.

    Thanked by 1perennate
  • @AdventureTime Well, some people are talking about how you misread the title/post.. but the rest aren't sure if you're trolling or not.. why.. why would you run something like that on a cron? You're doing more harm than good dumping caches every minute.

    Let your system manage memory.. the caches are there to speed things up with unused memory. There's no benefit to having 'free ram', your OS knows this and does what it can to make sure it's all utilized.

    Thanked by 1perennate
  • @AdventureTime it's not about you misread, is the method you are using is not right.

  • @xDragonZ said:
    AdventureTime it's not about you misread, is the method you are using is not right.

    I always use it by feeing memory.

  • FalzoFalzo Member

    ...the one who will later complain about rubbish running vps, slow connections and the urgent need of mutliple caches cdn and such. probably one can do overconfiguring a system a lot ;-)

  • Ok , Possible If virtio_balloon enabled.
    Thanks

  • AdventureTimeAdventureTime Member
    edited March 2015

    @Falzo said:
    ...the one who will later complain about rubbish running vps, slow connections and the urgent need of mutliple caches cdn and such. probably one can do overconfiguring a system a lot ;-)

    One of the reasons why I joined here is because you guys can provide straight to the point answers regarding servers, cloud computing, CDNs etc... I have so much respect for the members here and expecting them to be more professional and matured. I just realized, people from reddit are more friendlier and loves to explain things to newbies and make them feel they are welcome. I guess I was wrong then.

    Is there a moderator or an admin here? May I request my account to be deleted?

  • wychwych Member

    AdventureTime said: Is there a moderator or an admin here? May I request my account to be deleted?

    Well that escalated quickly.

    There are a few, flag the post and then one of them will read it.

  • Me_BMe_B Member

    @TarZZ92 said:
    not linux, but can be done with hyper-v

    on hyper-v it crash centos/linux despite the claim ballooning working fine. I had to disable it.

    M B

  • mikhomikho Member, Host Rep

    @AdventureTime said:
    Is there a moderator or an admin here? May I request my account to be deleted?

    We usually don't delete accounts, to much trouble cleaning all threads you posted in.
    Never log in again and problem solved.
    I can ban your account if that makes you feel better.

    Thanked by 1AdventureTime
  • Me_B said: on hyper-v it crash centos/linux despite the claim ballooning working fine. I had to disable it.

    not in my case.. seems to work fine (providing you have the latest hyper-v drivers)

  • FalzoFalzo Member

    afaik you can't set a higher maximum without rebooting the guest on kvm, even with ballooning enabled... you can change minimum though, within given limits.

  • You can not downgrade/upgrade ram or cpu withour rebooting.

Sign In or Register to comment.