Re: [OpenIndiana-discuss] KVM Failed to allocate memory: Resource temporarily unavailable

2015-12-10 Thread Fucai LiangBLCT
Thanks  for your help!

root@oi01:~# swap -sh
total: 8.1G allocated + 21M reserved = 8.1G used, 16G available
root@oi01:~#  swap -l
swapfile devswaplo   blocks free
/dev/zvol/dsk/rpool/swap 100,2 8 12574712 12574712
root@oi01:~#


16G swap , so KVM can locked 16G memory .

thanks again .


--
Fucai Liang 




On Dec 10, 2015, at 17:24, Jonathan Adams  wrote:

> how much swap do you have?
> 
> KVM automatically allocates the same amount of swap as memory when you
> start an instance, if you don't have the free swap it won't work.
> 
> Jon
> 
> On 10 December 2015 at 04:04, Fucai Liang (BLCT) 
> wrote:
> 
>> 
>> 
>> Hello, guys:
>> 
>> I has a server running oi_151.1.8, the server have 32G memory .
>> 
>> 
>> root@oi01:~# prtconf | grep Memory
>> Memory size: 32760 Megabytes
>> root@oi01:~# echo "::memstat" | mdb -k
>> Page SummaryPagesMB  %Tot
>>      
>> Kernel 451736  17645%
>> ZFS File Data   78429   3061%
>> Anon19849770%
>> Exec and libs 586 20%
>> Page cache   2170 80%
>> Free (cachelist)10432400%
>> Free (freelist)   7821076 30551   93%
>> 
>> Total 8384278 32751
>> Physical  8384277 32751
>> root@oi01:~#
>> 
>> 
>> I lauch a KVM  VM  by
>> 
>> 
>> #!/bin/sh
>> 
>> qemu-kvm \
>>-vnc 0.0.0.0:2 \
>>-cpu host \
>>-smp 2 \
>>-m 8192 \
>>-no-hpet \
>>-localtime \
>> -drive file=/dev/zvol/rdsk/rpool/svrinit,if=virtio,index=0 \
>>-net nic,vlan=0,name=e1000g0,model=e1000,macaddr=2:8:20:bd:ae:01 \
>>-net
>> vnic,vlan=0,name=e1000g0,ifname=vnic01,macaddr=2:8:20:bd:ae:01 \
>>-vga std \
>>-daemonize
>> 
>> 
>> root@oi01:~# echo "::memstat" | mdb -k
>> Page SummaryPagesMB  %Tot
>>      
>> Kernel 461061  18015%
>> ZFS File Data   78446   3061%
>> Anon  2131265  8325   25%
>> Exec and libs 918 30%
>> Page cache   2255 80%
>> Free (cachelist)10015390%
>> Free (freelist)   5700318 22266   68%
>> 
>> Total 8384278 32751
>> Physical  8384277 32751
>> root@oi01:~#
>> 
>> 
>> then I launch second  KVM VM,
>> 
>> #!/bin/sh
>> 
>> qemu-kvm \
>>-enable-kvm \
>>-vnc 0.0.0.0:3 \
>>-cpu host \
>>-smp 2 \
>>-m 8192 \
>>-no-hpet \
>>-localtime \
>> -drive file=/dev/zvol/rdsk/rpool/svr03,if=virtio,index=0 \
>>-net nic,vlan=0,name=e1000g0,model=e1000,macaddr=2:8:20:bd:ae:03 \
>>-net
>> vnic,vlan=0,name=e1000g0,ifname=vnic03,macaddr=2:8:20:bd:ae:03 \
>>-vga std \
>>-daemonize
>> 
>> 
>> 
>> I got err message  :
>> Failed to allocate memory: Resource temporarily unavailable
>> 
>> -bash: fork: Not enough space
>> 
>> .
>> 
>> the same ietmes happen on OmniOS , the following is a OmniOS-discuss  mail
>> .
>> 
>> That caused by availrmem not enough for memory locked .
>> 
>> Is that mean I can only use about 14G memory for KVM VM in a 32G memory
>> installed server?
>> OS can only locked about 14G memory .
>> 
>> ——FOLLOWING--
>> 
>> Hello, guys:
>> 
>> I has a server running OmniOS v11 r151016.  the server have 32G memory .
>> I star tow kvm virtual machines by running the following commands:
>> 
>> qemu-system-x86_64 -enable-kvm -vnc 0.0.0.0:12 -cpu host -smp 4 -m 8192
>> -no-hpe
>> 
>> 
>> qemu-system-x86_64 -enable-kvm -vnc 0.0.0.0:11 -cpu host -smp 2 -m 4096
>> -no-hpe
>> 
>> one use 8G memory and the other one use 4G memory.
>> 
>> now the memory usage of the system as following:
>> 
>> root@BLCC01:/root# prtconf | g

[OpenIndiana-discuss] KVM Failed to allocate memory: Resource temporarily unavailable

2015-12-09 Thread Fucai LiangBLCT


Hello, guys:

I has a server running oi_151.1.8, the server have 32G memory .  


root@oi01:~# prtconf | grep Memory
Memory size: 32760 Megabytes
root@oi01:~# echo "::memstat" | mdb -k
Page SummaryPagesMB  %Tot
     
Kernel 451736  17645%
ZFS File Data   78429   3061%
Anon19849770%
Exec and libs 586 20%
Page cache   2170 80%
Free (cachelist)10432400%
Free (freelist)   7821076 30551   93%

Total 8384278 32751
Physical  8384277 32751
root@oi01:~#


I lauch a KVM  VM  by


#!/bin/sh

qemu-kvm \
-vnc 0.0.0.0:2 \
-cpu host \
-smp 2 \
-m 8192 \
-no-hpet \
-localtime \
-drive file=/dev/zvol/rdsk/rpool/svrinit,if=virtio,index=0 \
-net nic,vlan=0,name=e1000g0,model=e1000,macaddr=2:8:20:bd:ae:01 \
-net vnic,vlan=0,name=e1000g0,ifname=vnic01,macaddr=2:8:20:bd:ae:01 \
-vga std \
-daemonize


root@oi01:~# echo "::memstat" | mdb -k
Page SummaryPagesMB  %Tot
     
Kernel 461061  18015%
ZFS File Data   78446   3061%
Anon  2131265  8325   25%
Exec and libs 918 30%
Page cache   2255 80%
Free (cachelist)10015390%
Free (freelist)   5700318 22266   68%

Total 8384278 32751
Physical  8384277 32751
root@oi01:~#


then I launch second  KVM VM,  

#!/bin/sh

qemu-kvm \
-enable-kvm \
-vnc 0.0.0.0:3 \
-cpu host \
-smp 2 \
-m 8192 \
-no-hpet \
-localtime \
-drive file=/dev/zvol/rdsk/rpool/svr03,if=virtio,index=0 \
-net nic,vlan=0,name=e1000g0,model=e1000,macaddr=2:8:20:bd:ae:03 \
-net vnic,vlan=0,name=e1000g0,ifname=vnic03,macaddr=2:8:20:bd:ae:03 \
-vga std \
-daemonize



I got err message  :
Failed to allocate memory: Resource temporarily unavailable  

-bash: fork: Not enough space

.

the same ietmes happen on OmniOS , the following is a OmniOS-discuss  mail .

That caused by availrmem not enough for memory locked . 

Is that mean I can only use about 14G memory for KVM VM in a 32G memory 
installed server? 
OS can only locked about 14G memory . 

——FOLLOWING--

Hello, guys:

I has a server running OmniOS v11 r151016.  the server have 32G memory .  
I star tow kvm virtual machines by running the following commands:

qemu-system-x86_64 -enable-kvm -vnc 0.0.0.0:12 -cpu host -smp 4 -m 8192 -no-hpe


qemu-system-x86_64 -enable-kvm -vnc 0.0.0.0:11 -cpu host -smp 2 -m 4096 -no-hpe

one use 8G memory and the other one use 4G memory.

now the memory usage of the system as following:

root@BLCC01:/root# prtconf | grep Memory
Memory size: 32760 Megabytes
root@BLCC01:/root#  echo "::memstat" | mdb -k
Page SummaryPagesMB  %Tot
     
Kernel 549618  21467%
ZFS File Data  668992  26138%
Anon  3198732 12495   38%
Exec and libs1411 50%
Page cache   4402170%
Free (cachelist)10578410%
Free (freelist)   3950545 15431   47%

Total 8384278 32751
Physical  8384277 32751
root@BLCC01:/root# swap -sh
total: 12G allocated + 35M reserved = 12G used, 6.8G available
root@BLCC01:/root# swap -l
swapfile devswaplo   blocks free
/dev/zvol/dsk/rpool/swap 263,2 8  8388600  8388600
root@BLCC01:/root#


root@BLCC01:/root# prctl $$

project.max-locked-memory
  usage   12.0GB
  system  16.0EBmax   deny -
project.max-port-ids
  privileged  8.19K   -   deny -
  system  65.5K max   deny -
project.max-shm-memory
  privileged  8.00GB  -   deny -
  system  16.0EBmax   deny -






#prstat -J

PROJIDNPROC  SWAP   RSS MEMORY  TIME  CPU PROJECT
   15   12G   12G38%   1:07:23 5.6% user.root
   0   43   72M   76M   0.2%   0:00:59 0.0% system
   35 4392K   14M   0.0%   0:00:00 0.0% default



then I start the third vm