<div dir="ltr"><div>By default, OpenVZ doesn't allow swap creation inside containers. And this is a good thing.<br><br></div>It is not good to use storage to act as memory, since the performance is really bad. When needing more memory, just upgrade the hardware profile of your VM with your provider.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 8, 2020 at 3:41 PM Jeffrey Walton <<a href="mailto:noloader@gmail.com">noloader@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Everyone,<br>
<br>
I'm trying to track down the cause of the error message below. It is<br>
encountered when we try to enable a swapfile for a low-end VM. The VPS<br>
provider uses OpenVZ.<br>
<br>
# ./vm-swapfile.sh<br>
Swapfile already allocated<br>
swapon: /swapfile: swapon failed: Operation not permitted<br>
Failed to enable swapfile<br>
<br>
The relevant command is:<br>
<br>
if ! swapon /swapfile; then<br>
echo "Failed to enable swapfile"<br>
fi<br>
<br>
Is this mkswap message from OpenVZ?<br>
<br>
Thanks in advance.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openvz.org" target="_blank">Users@openvz.org</a><br>
<a href="https://lists.openvz.org/mailman/listinfo/users" rel="noreferrer" target="_blank">https://lists.openvz.org/mailman/listinfo/users</a><br>
</blockquote></div>