• #1

A fresh install of VM (KVM) don’t stop

  1. From web interface Stop menu.
  2. From Web Console Stop or Shutdown
  3. Only can halt form console..

But it’s worng. If VM it’s freeeze we’ll can stop VM.

Message log:

Error: VM quit/powerdown failed – got timeout

dietmar


  • #2

What kind of VM (OS) is that?

  • #3

Search the PID of the machine with:
ps aux | grep “/usr/bin/kvm -id VMID”

Kill it with:
kill -9 PID

Start your machine again with:
qm start VMID

And look if you can stop your machine in GUI or CLI
CLI: qm stop VMID

  • #4

What kind of VM (OS) is that?

Centos x64 y i386…

[B said:

Thijs Simonis]
[/B]
Search the PID of the machine with:
ps aux | grep “/usr/bin/kvm -id VMID”

Kill it with:
kill -9 PID

Start your machine again with:
qm start VMID

And look if you can stop your machine in GUI or CLI
CLI: qm stop VMID

I don’t like STOP by force brute….
I like shutdown nicely.
Thanks for your tip

  • #5

I am also noticing this issue with CentOS-5.3 x86. Stop works, but shutdown does nothing. I don’t like the idea of brute force either.

Apr 4 16:42:01 proxmox1 pvedaemon[70973]: shutdown VM 100: UPID:proxmox1:0001153D:001C9B7D:4F7CB219:qmshutdown:100:root@pam:
Apr 4 16:42:01 proxmox1 pvedaemon[67891]: <root@pam> starting task UPID:proxmox1:0001153D:001C9B7D:4F7CB219:qmshutdown:100:root@pam:
Apr 4 16:42:31 proxmox1 pvedaemon[70973]: VM quit/powerdown failed – got timeout
Apr 4 16:42:31 proxmox1 pvedaemon[67891]: <root@pam> end task UPID:proxmox1:0001153D:001C9B7D:4F7CB219:qmshutdown:100:root@pam: VM quit/powerdown failed – got timeout

tom

tom

Proxmox Staff Member


  • #6

did you enable acpid in your VM?

you need to allow anonymous acpi shutdown in all your KVM guest system to shutdown.

  • #7

Yes for me, ACPI Support it’s yes for all machines and for me don’t work neither stop, shutdown or any for halt machine.

EDIT: Today work STOP, but shutdown got time out.

Last edited:

dietmar


  • #8

Yes for me, ACPI Support it’s yes for all machines and for me don’t work neither stop, shutdown or any for halt machine.

On Linux you need to run the ACPI Daemon (acpid) inside the guest.

  • #9

On Linux you need to run the ACPI Daemon (acpid) inside the guest.

Yep that was the issue for me. On a side note I was unable to start the daemon while the VM was running. I had to add it to chkconfig then reboot for the daemon to properly start. Shutdown is working as it should.

  • #10

Hallo,

I have the same problem. Stop works, but shutdown doesn’t. Sutdown ends up with the following error in “pve – tasks – status”:

Error: VM quit/powerdown failed – got timeout

Under VM options the “ACPI Support” is activated “yes” und the acpid in the vm is working:

Code:

:~# /etc/init.d/acpid status
acpid is running.

I run the debian-distribution “openmediavault” as a vm with kernel “2.6.32-5-amd64”.

What else can be done? What information do you need?

regards

Hoppel

Last edited:

tom

tom

Proxmox Staff Member


  • #11

install acpid in your guest.

  • #12

Hey Tom,

acpid is allready installed in the newest version in the guest:

Code:

:~# apt-get install acpid
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut
Statusinformationen werden eingelesen... Fertig
acpid ist schon die neueste Version.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

What else can be done? Do I need acpid on the pve-host?

acpid is not installed on the host.

Last edited:

tom

tom

Proxmox Staff Member


  • #13

check “System/Power Management” on OMV gui and enable “Shutdown the system when pressing the power button.”

  • #14

Thanks, this was the solution, Shutdown works.

But I still see the message: Error: VM quit/powerdown failed – got timeout even though it works. Why?

———————————————–

EDIT: Curious, after I stopped the omv-vm once, I now get the message: OK while I use the shutdown button. So everything is as it should.

Thank you very much, Tom.

regards

Last edited:

  • #15

EDIT: Curious, after I stopped the omv-vm once, I now get the message: OK while I use the shutdown button. So everything is as it should..[/QUOTE

What is omv-vm.

  • #16

Hi All experts,

I encountered this issue recently.

my proxmox is 2.3, and creat new VM without any OS, but I can’t shoudown the VM through console, the error log is “TASK ERROR: VM quit/powerdown failed – got timeout”. i only force shutdown by qm stop ***.

do you have any suggestion about this issue, i don’t want to force to shutdown VM everytime. thanks.

mo_

Active Member


  • #17

if your VM doesnt have any OS, youre probably still looking at some installer loaded from some ISO. it is VERY likely that installers themselfs will not support ACPI, in fact I know most dont because you always have to press the off button for 3 seconds on a physical machine if the installer hangs because you messed something up.

Long story short: once you actually install some OS and enable ACPI support in it, clean shutdowns will work just fine.

  • #18

Just encounter this error today, not way to stop VM in UI.
And command line also failed:
# qm stop 102
trying to acquire lock…
can’t lock file ‘/var/lock/qemu-server/lock-102.conf’ – got timeout

  • #19

Sorry to necro this thread, but I think I know what the problem is, for future reference:

If you issue a Shutdown command on a VM than cannot process it (no ACPI), the task runs and tries its best before timing out. During this time the /var/lock/qemu-server/lock-100.conf is locked by this task.

If during this time (before the Shutdown task times out), you issue a Stop command to the VM, you become this error message:

trying to acquire lock…
TASK ERROR: can’t lock file ‘/var/lock/qemu-server/lock-100.conf’ – got timeout

In this case, you have to open the still running Shutdown *task* (double click on it in the Tasks pane) and stop it.

Then, re-issue the Stop command to the VM. This time it should work.

Just my 2 cents…

  • #20

Encountered the same error, Shutdown from the Proxmox GUI or from console didn’t work.
After multiple tries, I am able to power off VM after stopping it from the GUI.

TASK ERROR: VM quit/powerdown failed - got timeout

Proxmox is a complete opensource server virtualization management solution. It offers the ability to manage virtual server (VPS) technology with the Linux OpenVZ and KVM technologies.

Today I error VM (Virtual Machine) on proxmox can not be restarted. The following error message I get
VM QUIT POWERDOWN FAILED PROXMOX

VM quit/powerdown failed – got timeout

To fix this, you can try find a guest VM process ID (PID)

ps aux | grep “/usr/bin/kvm -id VMID”

kill the PID with the command

and then start again your VM

verify your VM working

that’s it!

Or

Script

add

#!/bin/sh

echo

echo ‘—–AUTHOR: https://galaxydata.ru—–‘

echo

echo ‘Existing lock files’

ls l /run/lock/qemuserver

read p ‘Enter the VM ID here to delete corresponding lock e.g. 101: ‘ vmid

qm unlock $vmid

rm f /run/lock/qemuserver/lock$vmid.conf

qm unlock $vmid

sleep 5

qm start $1

echo

echo ‘—Remaining locks—‘

ls l /run/lock/qemuserver

run script

—–AUTHOR: https://galaxydata.ru—–

Existing lock files

total 0

rwrr 1 root root 0 Dec 23 18:50 lock1.conf

Enter the VM ID here to delete corresponding lock e.g. 101:

Похожая запись

I am trying to create a Proxmox VM template using Packer. However I am getting a Proxmox error saying Build 'proxmox' errored: Error converting VM to template, could not stop: VM quit/powerdown failed - got timeout.

According to the Proxmox GUI, the VM produces this error during shutdown (status error) but it has no problems stopping (status OK).

I have tried installing and enabling qemu-guest-agent in the preseeding of the Debian OS.

I have tried installing and starting acpid and acpi-support in the preseeding of the Debian OS.

Thank you for your time. All ideas and suggestions are appreciated.

Here is the Packer file I am trying to build:

{
    "builders": [
        {
            "type": "proxmox",
            "proxmox_url": "https://192.111.1.108:8006/api2/json",
            "insecure_skip_tls_verify": true,
            "username": "root@pam",
            "password": "foobar",
            "vm_name": "pm-prov",
            "vm_id": "200",
            "node": "pve",
            "os": "l26",
            "iso_file": "local:iso/debian-10.4.0-amd64-netinst.iso",
            "ssh_username": "root",
            "ssh_password": "foobar",
            "qemu_agent": false,
            "memory": "2048",
            "communicator": "none",
            "scsi_controller": "virtio-scsi-pci",
            "network_adapters": [
                {
                    "model": "virtio",
                    "bridge": "vmbr0"
                }
            ],
            "disks": [
                {
                    "type": "scsi",
                    "disk_size": "32G",
                    "storage_pool": "local-lvm",
                    "storage_pool_type": "lvm"
                }
            ],
            "boot_command": [
                "<esc><wait>",
                "install <wait>",
                "preseed/url=preseed_url <wait>",
                "debian-installer=en_US.UTF-8 <wait>",
                "auto <wait>",
                "locale=en_US.UTF-8 <wait>",
                "kbd-chooser/method=us <wait>",
                "keyboard-configuration/xkb-keymap=us <wait>",
                "netcfg/get_hostname=debian_proxmox_hostname <wait>",
                "netcfg/get_domain=.local <wait>",
                "fb=false <wait>",
                "debconf/frontend=noninteractive <wait>",
                "console-setup/ask_detect=false <wait>",
                "console-keymaps-at/keymap=us <wait>",
                "grub-installer/bootdev=/dev/sda <wait>",
                "<enter><wait>"
            ]
        }
    ]
}

Here is the preseed config that is its running:

d-i debian-installer/locale string en_US
d-i keyboard-configuration/xkb-keymap select us
d-i netcfg/choose_interface select auto
d-i netcfg/dhcp_failed note
d-i netcfg/dhcp_options select Configure network manually
d-i netcfg/get_ipaddress string 192.168.1.42
d-i netcfg/get_netmask string 255.255.255.0
d-i netcfg/get_gateway string 192.168.1.1
d-i netcfg/get_nameservers string 192.168.1.1
d-i netcfg/confirm_static boolean true
d-i netcfg/get_hostname string debian-proxmox
d-i netcfg/get_domain string localdomain
d-i mirror/country string manual
d-i mirror/http/hostname string http.us.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
d-i passwd/root-password password foobar500
d-i passwd/root-password-again password foobar500
d-i passwd/user-fullname string ops
d-i passwd/username string ops
d-i passwd/user-password password foobar500
d-i passwd/user-password-again password foobar500
d-i clock-setup/utc boolean true
d-i time/zone string US/Eastern
d-i clock-setup/ntp boolean true
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-auto-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string debian
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select boot-lvm
d-i partman-auto/expert_recipe string               \
    boot-lvm ::                                     \
        500 500 500 ext4                            \
            $primary{ } $bootable{ }                \
            method{ format } format{ }              \
            use_filesystem{ } filesystem{ ext4 }    \
            mountpoint{ /boot }                     \
        .                                           \
        2048 2048 200% linux-swap                   \
            $lvmok{ }                               \
            lv_name{ swap } in_vg { debian }        \
            $primary{ }                             \
            method{ swap } format{ }                \
        .                                           \
        2048 2048 2048 ext4                         \
            $lvmok{ }                               \
            lv_name{ tmp } in_vg { debian }         \
            $primary{ }                             \
            method{ format } format{ }              \
            use_filesystem{ } filesystem{ ext4 }    \
            mountpoint{ /tmp }                      \
        .                                           \
        4000 4096 4096 ext4                         \
            $lvmok{ }                               \
            lv_name{ var_log } in_vg { debian }     \
            $primary{ }                             \
            method{ format } format{ }              \
            use_filesystem{ } filesystem{ ext4 }    \
            mountpoint{ /var/log }                  \
        .                                           \
        8192 8192 -1 ext4                           \
            $lvmok{ }                               \
            lv_name{ root } in_vg { debian }        \
            $primary{ }                             \
            method{ format } format{ }              \
            use_filesystem{ } filesystem{ ext4 }    \
            mountpoint{ / }                         \
        .
d-i partman-md/device_remove_md boolean true
d-i partman-basicfilesystems/no_mount_point boolean false
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i apt-setup/cdrom/set-first boolean false
d-i apt-setup/cdrom/set-next boolean false   
d-i apt-setup/cdrom/set-failed boolean false
d-i apt-setup/non-free boolean true
d-i apt-setup/contrib boolean true
tasksel tasksel/first multiselect standard, ssh-server
d-i preseed/late_command string \
  in-target rm -rf /var/lib/apt/lists ; \
  in-target apt-get update ; \
  in-target apt-get -y upgrade ; \
  in-target apt-get install qemu-guest-agent -y ; \
  in-target apt-get install acpid -y ; \
  in-target apt-get install acpi-support -y ; \
  in-target systemctl start acpid ; \
  in-target systemctl start acpi-support ; \
  in-target systemctl enable qemu-guest-agent 
d-i pkgsel/include string htop
d-i pkgsel/upgrade select full-upgrade
popularity-contest popularity-contest/participate boolean false
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/bootdev  string /dev/sda
d-i finish-install/reboot_in_progress note

Here is the error in the terminal:

2020/06/25 14:35:11 packer-builder-proxmox plugin: [INFO] communicator disabled, will not connect
2020/06/25 14:35:11 packer-builder-proxmox plugin: Unable to load communicator config from state to populate provisionHookData
2020/06/25 14:35:11 packer-builder-proxmox plugin: Running the provision hook
==> proxmox: Stopping VM
2020/06/25 14:38:18 packer-builder-proxmox plugin: Unable to load communicator config from state to populate provisionHookData
==> proxmox: Error converting VM to template, could not stop: VM quit/powerdown failed - got timeout
==> proxmox: Provisioning step had errors: Running the cleanup provisioner, if present...
==> proxmox: Stopping VM
==> proxmox: Deleting VM
2020/06/25 14:38:23 [INFO] (telemetry) ending proxmox
2020/06/25 14:38:23 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2020/06/25 14:38:23 machine readable: proxmox,error []string{"Error converting VM to template, could not stop: VM quit/powerdown failed - got timeout"}
==> Builds finished but no artifacts were created.
Build 'proxmox' errored: Error converting VM to template, could not stop: VM quit/powerdown failed - got timeout
2020/06/25 14:38:23 [INFO] (telemetry) Finalizing.

==> Some builds didn't complete successfully and had errors:
--> proxmox: Error converting VM to template, could not stop: VM quit/powerdown failed - got timeout

==> Builds finished but no artifacts were created.
2020/06/25 14:38:23 waiting for all plugin processes to complete...
2020/06/25 14:38:23 /home/linuxbrew/.linuxbrew/Cellar/packer/1.6.0/bin/packer: plugin process exited

VM QUIT POWERDOWN FAILED PROXMOX

Proxmox is a complete opensource server virtualization management solution. It offers the ability to manage virtual server (VPS) technology with the Linux OpenVZ and KVM technologies.

Today I error VM (Virtual Machine) on proxmox can not be restarted. The following error message I get

root@virtual:~# qm shutdown 103
VM quit/powerdown failed - got timeout

To fix this, you can try find a guest VM process ID (PID)

ps aux | grep "/usr/bin/kvm -id VMID"

kill the PID with the command

kill -9 PID

and then start again your VM

qm start VMID

verify your VM working

qm list

that’s it!

  • Tweet
  • Share
  • Share
  • Share
  • Share

A hard worker and hired as a SysAdmin by various hosting provider. I am just a wanderer on a “black screen”

HOWTO: First Steps After Installation

Add the no subscription repository…

echo "deb http://download.proxmox.com/debian/pve buster pve-no-subscription" >>/etc/apt/sources.list
apt-get update
apt-get check
apt-get --simulate dist-upgrade

Simple Repository Setup for Proxmox

HOWTO: Update PCI and USB IDs

update-pciids
update-usbids

HOWTO: Set System Locale

dpkg-reconfigure locales   (and choose en_GB.utf8)

Thanks – https://wiki.debian.org/Locale

HOWTO: Change To Software RAID and LVM

Do NOT do this if you are using the new 4.x version of Proxmox and have chosen ZFS (RAID) filesystem!

Install Software

aptitude install mdadm

Prepare Disks

sgdisk -R=/dev/sdb /dev/sda
sgdisk -t 2:fd00 /dev/sdb
sgdisk -t 3:fd00 /dev/sdb
sgdisk -R=/dev/sdc /dev/sda
sgdisk -t 2:fd00 /dev/sdc
sgdisk -t 3:fd00 /dev/sdc
parted

GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: ATA WDC WD3000FYYZ-0 (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number  Start   End     Size    File system  Name     Flags
 1      1049kB  2097kB  1049kB               primary  bios_grub
 2      2097kB  537MB   535MB   ext3         primary  boot
 3      537MB   3001GB  3000GB               primary  lvm
(parted)                                                                  
(parted) select /dev/sdb                                                  
Using /dev/sdb
(parted) print                                                  
Model: ATA WDC WD3000FYYZ-0 (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number  Start   End     Size    File system  Name     Flags
 1      1049kB  2097kB  1049kB               primary  bios_grub
 2      2097kB  537MB   535MB                primary  raid
 3      537MB   3001GB  3000GB               primary  raid

Create RAID Arrays

mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/sdb2
mdadm --create /dev/md1 --level=1 --raid-disks=2 missing /dev/sdb3
cat /proc/partitions /proc/mdstat 

Copy Boot Files To RAID Array

mkfs.ext3 /dev/md0 
mkdir /mnt/tmp
mount /dev/md0 /mnt/tmp
cp -ax /boot/* /mnt/tmp
umount /mnt/tmp
rmdir /mnt/tmp

Change Boot Filesystem Tab

nano /etc/fstab
/dev/pve/root / ext3 errors=remount-ro 0 1
/dev/pve/data /var/lib/vz ext3 defaults 0 1
/dev/md0 /boot ext3 defaults 0 1
#UUID=46b4d3d6-fdec-43b6-a4cb-3f8f8a9c6c10 /boot ext3 defaults 0 1
/dev/pve/swap none swap sw 0 0
proc /proc proc defaults 0 0

Do not reboot now as per kbDone’s page!

Update GRUB Bootloader

echo 'GRUB_DISABLE_LINUX_UUID=true' >> /etc/default/grub
echo 'GRUB_PRELOAD_MODULES="raid dmraid"' >> /etc/default/grub
echo raid1 >> /etc/modules
echo raid1 >> /etc/initramfs-tools/modules
grub-install /dev/sda
grub-install /dev/sdb
grub-install /dev/sdc   (because we will actually be adding sdc below)
update-grub
update-initramfs -u

Now reboot.

reboot

Prepare First Disk (Part 1)

sgdisk -t 2:fd00 /dev/sda
mdadm --add /dev/md0 /dev/sda2

Move LVM Data

pvcreate /dev/md1
vgextend pve /dev/md1
pvmove /dev/sda3 /dev/md1   <-- this takes a very long time!
vgreduce pve /dev/sda3
pvremove /dev/sda3

Prepare First Disk (Part 2)

sgdisk -t 3:fd00 /dev/sda
mdadm --add /dev/md1 /dev/sda3   <-- this takes a long time as well
cat /proc/mdstat

Wait for RAID to sync.

mdadm --add /dev/md0 /dev/sdc2
mdadm --add /dev/md1 /dev/sdc3

Update GRUB (Again)

grub-install /dev/sda
grub-install /dev/sdb
grub-install /dev/sdc
update-grub
update-initramfs -t -u
sync

Finish

reboot
cat /proc/mdstat

Thanks – http://kbdone.com/proxmox-ve-3-2-software-raid/

HOWTO: Add ISO Files

In the GUI…

Storage View > Datacenter > server > local > content > Upload

Location on disk…

/var/lib/vz/template/iso

HOWTO: Add Virtual Machine (VM)

Server View > Datacenter > server
Create VM

Ubuntu Linux

Copy Existing – Physical To Virtual (P2V)

Physical

  • https://help.ubuntu.com/community/BackupYourSystem/TAR
  • sudo tar -czvpf /backup.tar.gz –exclude=/backup.tar.gz –one-file-system /

Virtual

STOP PRESS – new method?! – http://www.fsarchiver.org/QuickStart

  • Boot with SystemRescueCD iso in virtual cdrom
  • either use the proxmox console, or set root password and restart ssh, and ssh in
  • Partition and Format virtual hard disk drive (1:swap,2:ext4)
  • mkdir /mnt/sda2 and mount -v /dev/sda2 /mnt/sda2/
  • scp physical:/backup.tar.gz root@virtual:/mnt/sda2/
  • sudo tar -xzvpf /mnt/sda2/backup.tar.gz -C /mnt/sda2/ –numeric-owner (close console window for this)
  • mount -t proc none /mnt/sda2/proc
  • mount -o bind /dev /mnt/sda2/dev
  • mount -t sysfs /sys /mnt/sda2/sys
  • chroot /mnt/sda2 /bin/bash
  • blkid /dev/sda1 /dev/sda2
  • nano /etc/mtab /etc/fstab /etc/hosts /etc/network/interfaces (change IP address to different to physical)
  • touch /var/lock/aptitude
  • aptitude -y -v purge mdadm lm-sensors hddtemp smartmontools cpufrequtils
  • rm -rfv /var/lib/smartmontools/
  • grub-install /dev/sda
  • update-initramfs -u
  • update-grub
  • exit
  • reboot

Finish

  • When you are happy, then shut down the Physical and change the Virtual IP address, then reboot Virtual 🙂

Windows 7

Fresh Installation

  • Create an ISO of the Windows 7 DVD
dd if=/dev/sr0 of=/var/lib/vz/template/iso/win7pro-sp1.iso
  • Download the VirtIO Drivers ISO (Changelog)
  • Create VM according to the Windows 7 Best Practices page
  • CDROM #1 = win7pro-sp1.iso
  • CDROM #2 = virtio-win-0.1-81.iso
  • CDROM #3 = VMware-tools-windows-9.4.11-2400950.iso
  • Start VM and read instructions below

Mouse Driver

This gives you much better mouse performance and uses less resources (than the default ‘usb tablet mouse’).

The vmmouse driver need a reboot to get activated but then you can enable/disable the ‘usb device tablet’ on the fly.

  • extract setup.exe from iso
  • extract datas from setup.exe
  • setup.exe /A /P C:\Extract
  • drivers are in C:\extract\Program Files\VMware\VMware Tools\VMware\Drivers\mouse

Mouse Driver (64 Bit) – http://packages.vmware.com/tools/esx/latest/windows/x64/index.html (e.g. VMware-tools-windows-9.4.11-2400950.iso)

Mouse Driver (32 Bit) – http://packages.vmware.com/tools/esx/latest/windows/x86/index.html (e.g. VMware-tools-windows-9.4.11-2400950.iso)

Qemu Agent

The qemu-guest-agent is a helper daemon, which is installed in the guest. It is used to exchange information between the host and guest, and to execute command in the guest.

This is a must have!

http://pve.proxmox.com/wiki/Qemu-guest-agent

Links

Tweaks – https://pve.proxmox.com/wiki/Performance_Tweaks

Thanks – https://pve.proxmox.com/wiki/Windows_7_guest_best_practices

Thanks – https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers#Choose_the_right_driver

HOWTO: RUN VIRTUAL MACHINE IN PROXMOX INSIDE VIRTUALBOX

Because VirtualBox does not support KVM Stacking or KVM-in-KVM, you have to use the QEMU option in Proxmox when running inside VirtualBox.

  1. Install Proxmox VE inside VirtualBox and start Proxmox
  2. Log in to the Proxmox Web Admin and ‘Create VM’
  3. VM > Options > KVM Hardware Virtualization = NO, QEMU Agent = YES

HOWTO: RESIZE DISKS

https://pve.proxmox.com/wiki/Resize_disks

Shut Down Stop The Virtual Machine

Shut down and Stop the VM using the GUI or command line.

GUI

Server View > Datacenter > Node > VM > Hardware > Hard Disk > Resize

COMMAND LINE

In this example, we will be increasing the first virtual hard disk sda from 20Gb to 68Gb.

Resize Virtual Hard Disk

Find out the name of the virtual machine and hard disk, using the GUI (shown above), for example 105 and sata0.

Now, you can resize the virtual disk…

qm resize 105 sata0 +48G

Resize Hard Disk Partition

Boot the VM with a live CD such as SystemRescueCD, and then use ‘parted’ to resize the partition (in our case partition #2)…

parted /dev/sda
(parted) print
(parted) resizepart 2 100%
(parted) print
(parted) quit

Check Hard Disk Filesystem (I)

e2fsck -f /dev/sda2

Resize Hard Disk Filesystem

resize2fs /dev/sda2

Check Hard Disk Filesystem (II)

e2fsck -f /dev/sda2

Poweroff The Virtual Machine

Now, you can shutdown the SystemRescueCD…

poweroff

START THE VIRTUAL MACHINE

Start the VM using the GUI or command line, login and check your disk size.

df -H

http://pve.proxmox.com/wiki/Resize_disks

HOWTO: FIX

apt update: TASK ERROR: command ‘apt-get update’ failed: exit code 100

To fix, run the following option to apt-get …

apt-get update --allow-releaseinfo-change

OR

apt-get update

and answer questions manually …

N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
Do you want to accept these changes and continue updating from this repository? [y/N] y

apt-get update: server certificate verification failed

https://pve.proxmox.com/wiki/Server_certificate_verification_failed_when_updating

Manually

To check mountpoint of NFS share…

mount

Disable the NFS share (either in web GUI or on the command line)…

pvesm set yournfsharename_inwebgui --disable 1

To unmount (be patient for up to 10 minutes)…

fusermount -uz /path/to/mountpoint

If no success, then…

umount -f -l -vvv /path/to/mountpoint

https://forum.proxmox.com/threads/nfs-share-umount-f-problem-device-is-busy.26777/

Automatically

nano /etc/rc.local.shutdown
#!/bin/sh -e
echo "NFS Shares are unmounting..."
fusermount -uz /mnt/pve/*
exit 0

http://unix.stackexchange.com/questions/98510/run-a-script-at-shutdown-in-debain#98523

Shutdown Error – TASK ERROR: VM quit powerdown failed – got timeout

Install the app ‘acpid’ in each of your Linux virtual machines…

sudo apt install acpid

HOWTO: ENABLE

Add CPU Frequency Scaling

aptitude install cpufrequtils

Thanks – https://wiki.debian.org/HowTo/CpuFrequencyScaling

HOWTO: CONVERT:

From Proxmox RAW Image To VirtualBox Qcow

-rw-r--r-- 1 root root  20G 2015-02-18 12:54 disk-drive-sata0.raw
-rw-r--r-- 1 root root  330 2015-02-18 12:51 qemu-server.conf
qemu-img convert -f raw -O qcow disk-drive-sata0.raw disk-drive-sata0.qcow
-rw-r--r-- 1 root root 9.8G 2015-02-20 11:03 disk-drive-sata0.qcow
-rw-r--r-- 1 root root  20G 2015-02-18 12:54 disk-drive-sata0.raw
-rw-r--r-- 1 root root  330 2015-02-18 12:51 qemu-server.conf

OVA IMAGE TO Qcow

Instructions

This example shows how to convert the ESET Remote Administrator Virtual Appliance to a Proxmox Virtual Machine.

sudo -i
tar -xf era_appliance.ova
qemu-img convert -p -f vmdk ERA_Appliance-disk1.vmdk -O qcow2 ERA_Appliance-disk1.qcow2
qemu-img info ERA_Appliance-disk1.qcow2
image: ERA_Appliance-disk1.qcow2
virtual size: 64G (68719476736 bytes)
disk size: 7.5G
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    corrupt: false

Open up the OVF file in your editor (it’s XML format) and just check what hardware it requires.

Then, create your new VM in the Proxmox web GUI as per hardware requirements.

Then, copy over the new QCOW2 disk image file we converted OVER the one created by Proxmox.

cp -av ERA_Appliance-disk1.qcow2 /var/lib/vz/images/106/vm-106-disk-1.qcow2

Then, edit the Proxmox VM config file to change the disk size to match the figure in bold above.

nano /etc/pve/nodes/proxmox1/qemu-server/106.conf
bootdisk: ide0
cores: 4
ide0: local:106/vm-106-disk-1.qcow2,format=qcow2,size=64G
ide2: none,media=cdrom
memory: 4096
name: eset1
net0: e1000=5E:EF:04:01:CA:45,bridge=vmbr0
numa: 0
onboot: 1
ostype: l26
smbios1: uuid=12936a8c-6417-4e5d-9f7d-f6e06730b72a
sockets: 1
startup: order=7,up=70,down=10

Now, you can go back to the Proxmox web GUI and start the new VM in a Console.

Job, done.

Troubleshooting

If your VM will not start because of this error:-

file system may not support O_DIRECT

It is because you are using the new ZFS with Proxmox, which does not support it.

Then change the Cache setting on your VM to Write Through

cache=writethrough

Thanks – http://www.jamescoyle.net/how-to/471-zfs-and-glusterfs-network-storage

Links

Upload OVA to Proxmox/ KVM

http://forum.proxmox.com/threads/9309-Convert-OVA-to-working-Proxmox-VM

http://opentox.github.io/installation/2012/08/02/converting-ova-images-to-kvm/

http://matthewmidgett.com/virtualization/5-converting-virtualbox-to-proxmox

http://edoceo.com/notabene/ova-to-vmdk-to-qcow2

HOWTO: Command Line Tools

https://pve.proxmox.com/wiki/Command_line_tools

Check Storage

Settings are kept in…

/etc/pve/storage.cfg

Check the current status with…

pvesm status

This also works to fix an unmounted NFS share (say the NFS server rebooted).

Add A User Using Domain Based Authentication

pveum aclmod / -user joebloggs@DOMAIN -role PVEAuditor

Shell Script To List Status Of Virtual Machines

#!/bin/bash
cd /etc/pve/nodes/<nodename>/qemu-server/
for FILE in *.conf
do
  VMID="${FILE%%.*}"
  echo -n "vm $VMID "
  /usr/sbin/qm status $VMID;
done

Backup All VMs

vzdump --quiet 1 --mailto backupnotify@domain.com --mode snapshot --compress lzo --storage nfs1 --node proxmox1 --all 1

Backup 1 VM

vzdump 219 --mode stop --compress lzo --node proxmox2 --remove 0 --storage nfs1 --mailto backupnotify@domain.com

Shutdown VM

qm shutdown VMID

Thanks – https://pve.proxmox.com/wiki/Virtual_Machine_Startup_and_Shutdown_Behavior

List VMs

qm list

Start VM

qm start VMID

Shutdown VM

qm shutdown VMID

Stop VM

qm stop VMID

HOWTO: DHCP For VMs On Different IP Address Range

https://jay.sh/setting-up-dhcp-for-proxmox-vms/

HOWTO: Change Cron Scheduled Backup Time

sudo nano /etc/pve/vzdump.cron

HOWTO: Change Node IP Address

Use the Web GUI…

Server View > Datacenter > Node > Network > vmbr0 > IP Address > OK > Restart

If you are not able to directly access the Web GUI, use SSH to Port Forward to your computer…

ssh root@proxmox-node -L local-port:remote-server-ip:remote-port
ssh root@123.456.789.0 -L 8006:192.168.1.200:8006

Then, point your web browser to the following address, and hey presto, Web GUI!

https://127.0.0.1:8006

OLD

Update the IP address and DNS IP address in these files…

nano /etc/hosts /etc/network/interfaces /etc/resolv.conf

If it’s a cluster, run this command as well…

/etc/init.d/cman restart

Then, reboot…

reboot

HOWTO: Change Node Hostname Name

WARNING: THIS WORKED FOR ME IN A TEST VIRTUALBOX ENVIRONMENT BUT HAS NOT BEEN TRIED IN PRODUCTION

YOU HAVE BEEN WARNED

THESE INSTRUCTIONS ARE A WORK IN PROGRESS

You may also have to edit some VM .conf files.

nano /etc/hostname /etc/hosts /etc/postfix/main.cf
cd /etc/pve/nodes/
cp -av old new
rm -rfv old
cd /var/lib/rrdcached/db/pve2-node/
cp -av old new
rm -rfv old
reboot

HOWTO: System Update

https://pve.proxmox.com/wiki/Downloads

  • Change DNS Server to modem
nano /etc/resolv.conf
nameserver 192.168.0.1
  • Shut down all running Virtual Machines
  • Turn off Start at Boot for each Virtual Machine (using WebGUI) or…
nano /etc/pve/nodes/proxmox1/qemu-server/*.conf
onboot: 1    <-- delete this line
  • Update system software…
screen -rd
apt-get update
apt-get check
apt-get --download-only dist-upgrade
apt-get --simulate dist-upgrade
apt-get --quiet dist-upgrade
(answer YES to Continuing Without Installing GRUB)
grub-mkdevicemap -n
grub-install /dev/sda
grub-install /dev/sdb
grub-install /dev/sdc
update-grub
update-initramfs -t -u
sync
touch /root/misc/system_updated
(exit screen)
reboot

HOWTO: Test ZFS With Virtualbox

HOWTO: Cluster

https://www.mattwall.co.uk/2019/06/09/new-proxmox-cluster-pt1.html

https://www.howtoforge.com/tutorial/how-to-configure-a-proxmox-ve-4-multi-node-cluster/

http://www.unixmen.com/setting-cluster-proxmox/

HOWTO: Help

Wiki

https://pve.proxmox.com/wiki/Main_Page

Forum

http://forum.proxmox.com/

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *