相对的, RAW 镜像文件也具有一个非常大的缺陷, 就是不支持快照. 所以才有了后来 QCOW 和 QCOW2 的发展.
QCOW2 (QEMU-COW 2)
(摘自官方文档)QEMU copy-on-write format with a range of special features, including the ability to take multiple snapshots, smaller images on filesystems that don’t support sparse files, optional AES encryption, and optional zlib compression QEMU-COW 镜像文件具有一系列特性, 支持包括 多重快照(能够创建基于之前镜像的新镜像, 速度更快), 占用更小的存储空间(不支持稀疏特性, 不会预先分配指定 Size 的存储空间), 可选的 AES 加密方式, 可选的 zlib 压缩方式 等功能.
qm <命令> <vmid> [选项] qm [create|set] <vmid> # 创建虚拟机 --memory <MBYTES> memory in MB (64 - 8192) --sockets <N> set number of CPU sockets <N> --cores <N> set cores per socket to <N> --ostype NAME specify OS type --onboot [yes|no] start at boot --keyboard XX set vnc keyboard layout --cpuunits <num> CPU weight for a VM --name <text> set a name for the VM --description <text> set VM description --boot [a|c|d|n] specify boot order --bootdisk <disk> enable booting from <disk> --acpi (yes|no) enable/disable ACPI --kvm (yes|no) enable/disable KVM --tdf (yes|no) enable/disable time drift fix --localtime (yes|no) set the RTC to local time --vga (gd5446|vesa) specify VGA type --vlan[0-9u] MODEL=XX:XX:XX:XX:XX:XX[,MODEL=YY:YY:YY:YY:YY:YY] --ide<N> [volume=]volume,[,media=cdrom|disk] [,cyls=c,heads=h,secs=s[,trans=t]] [,cache=none|writethrough|writeback] [,snapshot=on|off][,cache=on|off][,format=f] [,werror=enospc|ignore|report|stop] [,rerror=ignore|report|stop] [,backup=no|yes] --ide<N> <GBYTES> create new disk --ide<N> delete remove drive - destroy image --ide<N> undef remove drive - keep image --cdrom <file> is an alias for --ide2 <file>,media=cdrom --scsi<N> [volume=]volume,[,media=cdrom|disk] [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off][,format=f] [,cache=none|writethrough|writeback] [,werror=enospc|ignore|report|stop] [,backup=no|yes] --scsi<N> <GBYTES> create new disk --scsi<N> delete remove drive - destroy image --scsi<N> undef remove drive - keep image --virtio<N> [volume=]volume,[,media=cdrom|disk] [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off][,format=f] [,cache=none|writethrough|writeback] [,werror=enospc|ignore|report|stop] [,rerror=ignore|report|stop] [,backup=no|yes] --virtio<N> <GBYTES> create new disk --virtio<N> delete remove drive - destroy image --virtio<N> undef remove drive - keep image
E: Failed to fetch https://enterprise.proxmox.com/debian/pve/dists/buster/InRelease 401 Unauthorized [IP: 212.224.123.70443]
在pve管理界面内,更新,存储库
将带enterprise字样的库禁用。
apt update 订阅库不可用的问题
1 2 3 4 5 6 7
Err:5 https://enterprise.proxmox.com/debian/ceph-quincy bookworm InRelease 401 Unauthorized [IP: 51.79.228.122 443] Hit:6 http://security.debian.org bookworm-security InRelease Reading package lists... Done E: Failed to fetch https://enterprise.proxmox.com/debian/ceph-quincy/dists/bookworm/InRelease 401 Unauthorized [IP: 51.79.228.122 443] E: The repository 'https://enterprise.proxmox.com/debian/ceph-quincy bookworm In Release' is not signed. N: Updating from such a repository can't be done securely, and is therefore disa bled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
The apt package manager on the fresh Proxmox host is configured to download packages from Enterprise Repository by default. You must have a paid subscription to use this repo. If you don’t have paid subscription you should switch to No-Subscription Repository.
# Create a new VM using parameters read from an OVF manifest # An aliasfor qm disk import. # <虚拟机ID> <清单> <存储> [选项] qm importovf <vmid> <manifest> <storage> [OPTIONS]
#!/bin/sh ### BEGIN INIT INFO # Provides: cpufrequtils # Required-Start: $remote_fs loadcpufreq # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: # Short-Description: set CPUFreq kernel parameters # Description: utilities to deal with CPUFreq Linux # kernel support ### END INIT INFO #
# Which governor to use. Must be one of the governors listed in: # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors # # and which limits to set. Both MIN_SPEED and MAX_SPEED must be values # listed in: # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies # a value of 0 for any of the two variables will disabling the use of # that limit variable. # # WARNING: the correct kernel module must already be loaded or compiled in. # # Set ENABLE to "true" to let the script run at boot time. # # eg: ENABLE="true" # GOVERNOR="ondemand" # MAX_SPEED=1000 # MIN_SPEED=500
# 删除 local-lvm 千万注意备份一下 pve/data/ 目录下的 disk 虚拟磁盘文件 PVE8.2.2我照着这么操作直接把磁盘文件给删掉了,我人都傻了。。。。。 # 后面几个就是在删除磁盘文件 lvremove pve/data Removing pool pve/data will remove 3 dependent volume(s). Proceed? [y/n]: y Do you really want to remove active logical volume pve/vm-220-disk-0? [y/n]: y Logical volume "vm-220-disk-0" successfully removed. Do you really want to remove active logical volume pve/vm-300-disk-0? [y/n]: y Logical volume "vm-300-disk-0" successfully removed. Do you really want to remove active logical volume pve/vm-220-disk-1? [y/n]: y Logical volume "vm-220-disk-1" successfully removed. Do you really want to remove active logical volume pve/data? [y/n]: y Logical volume "data" successfully removed.