Task error vm is locked create

How to Unlock a Proxmox VM From time to time, you’ll come across the need to kill a lock on your Proxmox server. Fear not, in today’s guide we’ll discuss the various lock errors you may face and how to unlock a Proxmox VM. Proxmox Locked VM Errors Error: VM is locked The «VM […]

Содержание

  1. How to Unlock a Proxmox VM
  2. Proxmox Locked VM Errors
  3. Error: VM is locked
  4. can’t lock file ‘/var/lock/qemu-server/lock- .conf’ – got timeout
  5. Proxmox Unlock VM Methods
  6. qm unlock
  7. Manually Deleting the Lock
  8. TASK ERROR: VM is locked (backup)
  9. jmjosebest
  10. jmjosebest
  11. PC Rescue
  12. RollMops
  13. fabian
  14. RollMops
  15. fabian
  16. RollMops
  17. TASK ERROR: VM is locked (snapshot)
  18. dison4linux
  19. t.lamprecht
  20. dison4linux
  21. t.lamprecht
  22. dison4linux
  23. dison4linux
  24. dietmar
  25. About
  26. Quick Navigation
  27. Get your subscription!
  28. Restore error
  29. omnia
  30. Richard
  31. omnia
  32. Attachments
  33. Richard
  34. omnia
  35. ldb1619
  36. Proxmox миграция с 1.7-1.9 на 5.2

How to Unlock a Proxmox VM

From time to time, you’ll come across the need to kill a lock on your Proxmox server. Fear not, in today’s guide we’ll discuss the various lock errors you may face and how to unlock a Proxmox VM.

Proxmox Locked VM Errors

Error: VM is locked

The «VM is locked» error is the most common circumstance in which you may want to kill a VM lock. This error has a lot of variants including:

  • Error: VM is locked (backup)
  • Error: VM is locked (snapshot)
  • Error: VM is locked (clone)

Error: VM is locked in Proxmox

As you can see, they all share the same «Error: VM is locked» root, but with a suffix that indicates the task that initiated the lock, whether that task be a backup, a snapshot, or clone. This can be useful for determining IF you should clear the lock. (i.e. if the backup job is still running, you probably shouldn’t clear the lock and just let the backup process complete).

can’t lock file ‘/var/lock/qemu-server/lock- .conf’ – got timeout

This is another common error, often seen when you’re trying to shutdown/stop a virtual machine or when qm unlock fails (see below).

Proxmox Unlock VM Methods

There are two main ways of clearing a lock on a Proxmox VM: 1) using the qm unlock command and 2) manually deleting the lock.

qm unlock

qm unlock should be your first choice for unlocking a Proxmox VM.

First, find your VM ID (it’s the number next to your VM in the Proxmox GUI). If you’re not using the WebGUI, you can obtain a list of your VM IDs with:

Unlock the VM/kill the lock with:

Now, this may not always work, and the command may fail with:

In that case, let’s move on to plan B: manually deleting the lock.

Manually Deleting the Lock

If you received the error message, «can’t lock file ‘/var/lock/qemu-server/lock- .conf’ — got timeout», you can fix this by manually deleting the lock at that location. Simply put, you can just run the following command:

Obviously, this should be a last resort. It’s generally not a great practice to go around killing locks, but sometimes you have no choice.

I hope this guide helped you out. Let me know if you have any questions or feel I left something out in the comments/forums below!

Источник

TASK ERROR: VM is locked (backup)

jmjosebest

Active Member

Hi, after a full host restart I get this error starting a virtual machine KVM.

TASK ERROR: VM is locked (backup)

/var/lib/vz/lock is empty.
How can I unlock?
Thanks

jmjosebest

Active Member

PC Rescue

New Member

RollMops

Active Member

fabian

Proxmox Staff Member

Best regards,
Fabian

Do you already have a Commercial Support Subscription? — If not, Buy now and read the documentation

RollMops

Active Member

fabian

Proxmox Staff Member

check the system logs around the time of the failed backup, try manually backing up the VM a couple of times and check for failure.

it might have been a one time fluke.

Best regards,
Fabian

Do you already have a Commercial Support Subscription? — If not, Buy now and read the documentation

RollMops

Active Member

I can provoke a system crash by manually starting a backup of the VE that I use to find in a locked state.
After 1 or 2 mins., process z_wr_iss takes 97% CPU and subsequently the server fails. It then automatically reboots, but the VE is still locked from the pending/failed backup process and does not automatically recover.
I attach a screenshot of the last state seen in «top».
Could this be prevented by adding some RAM to the box?

Источник

TASK ERROR: VM is locked (snapshot)

dison4linux

Active Member

Unable to take new snapshots/backups because there seems to be a snapshot in progress.
I’ve rebooted to the hypervisor, no change.
The snapshots tab shows a ‘vzdump’ snapshot with a status of ‘prepare’

t.lamprecht

Proxmox Staff Member

Best regards,
Thomas

Do you already have a Commercial Support Subscription? — If not, Buy now and read the documentation

dison4linux

Active Member

I think that got me a little further, but no joy on a new snapshot yet.

t.lamprecht

Proxmox Staff Member

Using our pct snapshot command works?

Best regards,
Thomas

Do you already have a Commercial Support Subscription? — If not, Buy now and read the documentation

dison4linux

Active Member

It works to create a new one, but not to remove the troublesome one.

dison4linux

Active Member

For what it’s worth the backup process seems unable to delete the snapshot as well:

dietmar

Proxmox Staff Member

Best regards,
Dietmar

Do you already have a Commercial Support Subscription? — If not, Buy now and read the documentation

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Quick Navigation

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Источник

Restore error

omnia

New Member

Hi there,
when I tried to restore a backup in Proxmox 6.0-4 I have the following error

VM is locked (create).

This happens from command line ad GUI.

The backup is from an older version of Proxmox.
Is that the problem?

Thanks for you attention.
bye.

Richard

Proxmox Staff Member

when I tried to restore a backup in Proxmox 6.0-4 I have the following error

VM is locked (create).

This happens from command line ad GUI.

The backup is from an older version of Proxmox.
Is that the problem?

No — «locked» is the result of another task at that VM which has not finished (yet). If you are sure that there is no task running at this VM unlock it by

Do you already have a Commercial Support Subscription? — If not, Buy now and read the documentation

omnia

New Member

The VM doesn’t exist, is created when I start the restore.
I unlocked the VM and restarted the restore, but the error is the same.
What’s my mistake?

Attachments

Richard

Proxmox Staff Member

The VM doesn’t exist, is created when I start the restore.
I unlocked the VM and restarted the restore, but the error is the same.
What’s my mistake?

Do you already have a Commercial Support Subscription? — If not, Buy now and read the documentation

omnia

New Member

Tried, but the error is the same. 🙁

I also have tried to create the VM first and than make restore, but nothing changed.

ldb1619

Member

Having the same, from an old 2.1-1 to 6.0-4.
Have 10 machines there, that I wanted to copy over via backup.
So started with a small openvpn-as machine, but same error as OP, and I also tried suggenstions here.

Made new vm and pointed to the (copied) disk, but vm says «not a bootable disk».

Источник

Proxmox миграция с 1.7-1.9 на 5.2

Добрый день Перетаскиваю на новый сервер виртуалки, крутящиеся на proxmox 1.7 и 1.9 Бэкаплю, причем как включенные, так и выключенные на общую nfs шару, в конфиге лок не прописан При попытке восстановления на версию 5.2 получаю ошибку:

TASK ERROR: VM is locked (create)

Ничего не нагуглил по этому поводу, сама виртуалка добавляется на новый хост, но без HDD в устройствах. Как бы правильно перетащить? Или из-за большой разницы в версиях никак, только через 3 проксмокс?

Уж очень большая разница в версиях, и я не берусь сказать получится ли через 3 прокс перекинуть. Как вариант, если виртуалок не много, перенести руками через создание новых виртуалок и заполнение дисков через dd.

Оно и с четвёртой на пятую не всегда нормально мигрирует. Возьми клонзиллу лучше. Создаёшь новую виртуалку на пятой версии, грузишь старую и новую с livecd клонзиллы, клонируешь диск по сети.

да я диск и так могу вытащить, но в LVM да и в линуксах не оч силён и начинаются пляски «как закинуть raw в LVM»

dd с lvm работать умеет?

Так зачем закидывать? Клонзилла тут уже внутри виртуалки работает, не зная ничего про lvm. Так можно и физические сервера перекидывать.

не очень понимаю, не работал с клонзиллой, и мне нужен не весь диск, а несколько виртуалок. А лежат они в rawе на LVM

ну и старую не особо могу остановить, на ней крутятся несколько рабочих серверов

Создаёшь новую виртуалку с диском(дисками) такого же (но лучше чуть большего) размера, как у старой. Грузишь обе виртуалки с livecd клонзиллы, настраиваешь сеть, чтобы они могли соединиться. Запускаешь клонирование старой на новую. То, где при этом лежат образы дисков виртуалок физически — неважно.

А, ну тогда смотря насколько критичен простой. Вообще можно просто остановить виртуалку, перенести её образ диска (не всю виртуалку!) и подключить его к новой виртуалке, созданной без диска. Но я такой вариант не проверял.

Я имел ввиду самый логически незамороченный варинт. Типа как перенос физической машины с диска на диск. Перенос с помощью остановки виртуалки и livecd.

спс, попробую так тогда

создавал на новом сервере идентичные машины. удалял из какталога, где лежат образы в формате raw, новые образы диска. перебрасывал со старого сервера только файлы-образы raw и переименовывал их как было в новой вм.

Источник

From time to time, you’ll come across the need to kill a lock on your Proxmox server. Fear not, in today’s guide we’ll discuss the various lock errors you may face and how to unlock a Proxmox VM.

Proxmox Locked VM Errors

Error: VM is locked

The «VM is locked» error is the most common circumstance in which you may want to kill a VM lock. This error has a lot of variants including:

  • Error: VM is locked (backup)
  • Error: VM is locked (snapshot)
  • Error: VM is locked (clone)

Error: VM is locked in Proxmox

Error: VM is locked in Proxmox

As you can see, they all share the same «Error: VM is locked» root, but with a suffix that indicates the task that initiated the lock, whether that task be a backup, a snapshot, or clone. This can be useful for determining IF you should clear the lock. (i.e. if the backup job is still running, you probably shouldn’t clear the lock and just let the backup process complete).

can’t lock file ‘/var/lock/qemu-server/lock-<VMID>.conf’ – got timeout

This is another common error, often seen when you’re trying to shutdown/stop a virtual machine or when qm unlock fails (see below).

Proxmox Unlock VM Methods

There are two main ways of clearing a lock on a Proxmox VM: 1) using the qm unlock command and 2) manually deleting the lock.

qm unlock

qm unlock should be your first choice for unlocking a Proxmox VM.

First, find your VM ID (it’s the number next to your VM in the Proxmox GUI). If you’re not using the WebGUI, you can obtain a list of your VM IDs with:

cat /etc/pve/.vmlist

Unlock the VM/kill the lock with:

qm unlock <VMID>

Now, this may not always work, and the command may fail with:

trying to acquire lock...
can't lock file '/var/lock/qemu-server/lock-<VMID>.conf' - got timeout

In that case, let’s move on to plan B: manually deleting the lock.

Manually Deleting the Lock

If you received the error message, «can’t lock file ‘/var/lock/qemu-server/lock-<VMID>.conf’ — got timeout», you can fix this by manually deleting the lock at that location. Simply put, you can just run the following command:

rm /var/lock/qemu-server/lock-<VMID>.conf

Obviously, this should be a last resort. It’s generally not a great practice to go around killing locks, but sometimes you have no choice.

I hope this guide helped you out. Let me know if you have any questions or feel I left something out in the comments/forums below!

  • #1

Hello,

I am having this problem and could not find any hint on this forum. I have also googled for a while without success.

I have a proxmox server 2.X with a few VMs running on it. Now I want to move the VMs to a 5.X Proxmox server. I did the following:

— create a backup on the old server using vzdump
— restore the backup on the new server using qmrestore as follows:
qmrestore /backup/vzdump-qemu-123-2019_11_04-18_35_26.tar.lzo 103 —unique —storage local

However qmrestore gave this error message:
VM is locked (create)

and the disk was not imported. I tried with various storage ids and vm ids, same result. The vm was created but without disk.

The backup is a tar file consisting of these files:
qemu-server.conf
vm-disk-virtio0.raw

and the content of qemu-server.conf is:
# cat qemu-server.conf
args: -vnc 127.0.0.1:3123,
boot: cdn
bootdisk: virtio0
cores: 2
ide2: cdrom,media=cdrom
lock: backup
memory: 512
name: bcv
net0: virtio=26:E1:90:0C:C6:2C,bridge=vmbr0
onboot: 1
ostype: l26
sockets: 1
virtio0: shared-storage-on-drbd:vm-123-disk-1
#vzdump#map:virtio0:vm-disk-virtio0.raw:8589934592:shared-storage-on-drbd:

Any hint what I can try?

Regards,
Tony

t.lamprecht


  • #2

Hi,

it seems that a previous restore or create of a VM/CT with VMID 103 failed, and thus the «create» lock is left over.

can you see if there’s an config: qm config 103

Another, free, VMID:

Code:

qmrestore /backup/vzdump-qemu-123-2019_11_04-18_35_26.tar.lzo "$(pvesh get /cluster/nextid)" --unique --storage local

  • #3

Hi Thomas,

thank you for your hint. I have tried the following:

Code:

 # qm config 103
Configuration file 'nodes/hn5/qemu-server/103.conf' does not exist
# pvesh get /cluster/nextid
103

I have also tried with various IDs, but the result is always the same: vm created but disk not imported.

Yesterday I tried to create a VM and then import the raw file:

Code:

 qm importdisk 102 ./vm-disk-virtio0.raw lvm-thin-ssd

after that the disk was imported, and I could boot the VM (with some extra steps, since the device has changed from /dev/vda to /dev/sdb)

btw, how can I remove a disk from a VM? The GUI doesn’t seem to allow that

Regards,
Tony

t.lamprecht


  • #4

thank you for your hint. I have tried the following:

hmm strange result, did you destroy the VM 103 in-between? Just asking for sanity, else it would seem like there was a ghost VM..

I have also tried with various IDs, but the result is always the same: vm created but disk not imported.

So just the empty VM skelleton created? Were there any error messages during qmrestore?

btw, how can I remove a disk from a VM? The GUI doesn’t seem to allow that

You can only destroy «unused» disks, so you first need to detach a disk, then you can remove the resulting «unusedX» disk entry, both should work over the Webinterface.

  • #5

hmm strange result, did you destroy the VM 103 in-between? Just asking for sanity, else it would seem like there was a ghost VM..

yes I did destroy VM 103 (and other VMs that I tried in-between)

So just the empty VM skelleton created? Were there any error messages during qmrestore?

yes the VM was created very quickly with a single short error:

Code:

qmrestore /backup/vzdump-qemu-123-2019_11_04-18_35_26.tar.lzo 999 --unique --storage local
VM is locked (create)

You can only destroy «unused» disks, so you first need to detach a disk, then you can remove the resulting «unusedX» disk entry, both should work over the Webinterface.

ah yes, indeed. Thanks a lot.

Regards,
Tony

t.lamprecht


  • #6

OK, we tried to reproduce this and had success, @Dominic is on a solution for this, so that migrations from older setups (pre 2.3) are easier again.

Понравилась статья? Поделить с друзьями:
  • Task error start failed qemu exited with code 1
  • Task error protection is disabled kaspersky linux
  • Task error numa needs to be enabled for memory hotplug
  • Task error need mds to add storage but none got active
  • Task error max 1 vcpus allowed per vm on this node