AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[virsh](server)

Martin Hope
cm08
Asked: 2021-07-14 10:01:17 +0800 CST

libvirt 存储的 RAM 快照在哪里?

  • 1

我的理解是,当我运行此命令来创建正在运行的域的快照时:

virsh snapshot-create-as myvm snapshot1

这不仅是在每个磁盘映像文件中创建的内部快照,而且 RAM 状态也保存在某处。因此,如果我稍后恢复到该快照,RAM 中的所有内容都将恢复到创建快照时。

我看到了 qcow2 磁盘映像中列出的快照,并且看到了为描述快照和域配置而创建的 XML 文件,但是RAM 的实际内容存储在哪里? 它是“永久的”吗?例如,如果我重新启动主机,如果我选择恢复到该快照,则域的已保存 RAM 状态仍然可用?

kvm-virtualization virsh
  • 1 个回答
  • 566 Views
Martin Hope
os_user
Asked: 2021-05-28 11:42:13 +0800 CST

Ubuntu 20.04 云镜像无法获取IP地址

  • 0

使用virt-install创建guest时,CentOS 7.9云镜像成功获取IP地址,可以用sudo virsh domifaddr <domain>. 但是,Ubuntu 20.04 LTS 云映像不能,无论我做什么,它都不会被分配 IP 地址。它成功启动,我可以使用 看到登录提示sudo virsh console <domain>,但我无法 ssh 进入它,因为没有分配 IP。我正在使用 virt-manager 的默认网络。sudo iptables -S显示接受主机上 DHCP 端口的传入和持续流量的规则。

任何帮助是极大的赞赏。

virtualization ip ubuntu-20.04 virsh virt-install
  • 2 个回答
  • 759 Views
Martin Hope
MrCalvin
Asked: 2021-04-26 12:47:42 +0800 CST

禁用 libvirt 存储池

  • -1

似乎每次我创建一个带有virt-install新存储池的虚拟机时都会创建。

但我根本不使用存储池!

我查看了 virt-install 手册,但可以找到防止这种情况发生的方法。还一直在寻找 libvirt/qemu 配置文件中的任何设置以以任何方式禁用存储池,但在那里也找不到任何东西。

如果我运行,virsh pool-capabilities我确实会得到一个带有一些“支持”属性的 XML 输出,将其设置为“否”可能会很有趣,但我再次找不到任何地方来编辑这些设置。

任何帮助,将不胜感激。

我主要通过直接编辑 VM XML 文件来编辑/创建/管理 VM,并且只使用本地存储(qcow2 文件和逻辑设备)。我也只使用 virsh(无 gui)从控制台管理虚拟机。我看不出使用存储池有什么好处。

编辑:我的 virt-install cmd:

virt-install \
--virt-type kvm \
--name SRV01 \ 
--metadata description="SRV2019" \
--vcpus 2 \
--memory 2048 \
--boot uefi \
--cpu host \
--os-variant win2k19 \
--features acpi=on \
--disk device=disk,path="/mnt/data-r1/vm/w2k16-01/Disk1.qcow2",format=qcow2,bus=virtio,cache=none,boot_order=1 \
--disk device=cdrom,path="/mnt/data-r1/vm/iso/WinSrv2016.iso",boot_order=2,bus=scsi,boot_order=6 \
--disk device=cdrom,path="/mnt/data-r1/vm/iso/virtio-win-0.1.190.iso",bus=sata \
--controller type=virtio-serial \
--controller type=scsi,model=virtio-scsi \
--network bridge=brLAN,model=virtio \
--graphics vnc,password=pass,port=5900,keymap=local,listen=0.0.0.0 \
--noautoconsole \
--video vga \
--memballoon none \
--noreboot
kvm-virtualization libvirt virsh
  • 1 个回答
  • 336 Views
Martin Hope
qwr
Asked: 2021-02-22 16:46:32 +0800 CST

Xen VM不断重启,内核无法启动init

  • 1

我正在使用使用 Xen 管理程序和 libvirt 管理层构建的 VM。在将 Debian 版本从 8 更新到 9 后,我无法连接到 VM,因此我尝试登录到运行 VM 的物理机并使用 virsh 重新启动 VM。但是,在停止并启动 VM 后,它似乎处于重新启动循环中。域ID不断增加;它从 ID 8 开始,现在几个小时后达到 400+。(这里shell1是域名。)

$ virsh list --all
 Id    Name                           State
----------------------------------------------------
 412   shell1                         running

这是virsh console shell1内核日志的结果

Escape character is ^]
0 000024 (v02 Xen   )
[    0.000000] ACPI: XSDT 0x00000000FC00A550 000054 (v01 Xen    HVM      00000000 HVML 00000000)
[    0.000000] ACPI: FACP 0x00000000FC00A280 0000F4 (v04 Xen    HVM      00000000 HVML 00000000)
[    0.000000] ACPI: DSDT 0x00000000FC001250 008FAC (v02 Xen    HVM      00000000 INTL 20160831)
[    0.000000] ACPI: FACS 0x00000000FC001210 000040
[    0.000000] ACPI: FACS 0x00000000FC001210 000040
[    0.000000] ACPI: APIC 0x00000000FC00A380 000068 (v02 Xen    HVM      00000000 HVML 00000000)
[    0.000000] ACPI: HPET 0x00000000FC00A460 000038 (v01 Xen    HVM      00000000 HVML 00000000)
[    0.000000] ACPI: WAET 0x00000000FC00A4A0 000028 (v01 Xen    HVM      00000000 HVML 00000000)
[    0.000000] ACPI: SSDT 0x00000000FC00A4D0 000031 (v02 Xen    HVM      00000000 INTL 20160831)
[    0.000000] ACPI: SSDT 0x00000000FC00A510 000031 (v02 Xen    HVM      00000000 INTL 20160831)
[    0.000000] No NUMA configuration found
[    0.000000] Faking a node at [mem 0x0000000000000000-0x000000018f7fffff]
[    0.000000] Initmem setup node 0 [mem 0x00000000-0x18f7fffff]
[    0.000000]   NODE_DATA [mem 0x18f7f9000-0x18f7fdfff]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x00001000-0x00ffffff]
[    0.000000]   DMA32    [mem 0x01000000-0xffffffff]
[    0.000000]   Normal   [mem 0x100000000-0x18f7fffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00001000-0x0009efff]
[    0.000000]   node   0: [mem 0x00100000-0xefffefff]
[    0.000000]   node   0: [mem 0x100000000-0x18f7fffff]
[    0.000000] ACPI: PM-Timer IO Port: 0xb008
[    0.000000] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
[    0.000000] ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0])
[    0.000000] IOAPIC[0]: apic_id 1, version 17, address 0xfec00000, GSI 0-47
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 low level)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 low level)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 low level)
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[    0.000000] smpboot: Allowing 1 CPUs, 0 hotplug CPUs
[    0.000000] PM: Registered nosave memory: [mem 0x0009f000-0x0009ffff]
[    0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000effff]
[    0.000000] PM: Registered nosave memory: [mem 0x000f0000-0x000fffff]
[    0.000000] PM: Registered nosave memory: [mem 0xeffff000-0xefffffff]
[    0.000000] PM: Registered nosave memory: [mem 0xf0000000-0xfbffffff]
[    0.000000] PM: Registered nosave memory: [mem 0xfc000000-0xffffffff]
[    0.000000] e820: [mem 0xf0000000-0xfbffffff] available for PCI devices
[    0.000000] Booting paravirtualized kernel on Xen HVM
[    0.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cpu_ids:1 nr_node_ids:1
[    0.000000] PERCPU: Embedded 27 pages/cpu @ffff88018f400000 s80960 r8192 d21440 u2097152
[    0.000000] Built 1 zonelists in Node order, mobility grouping on.  Total pages: 1549220
[    0.000000] Policy zone: Normal
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.16.0-4-amd64 root=/dev/xvda2 ro elevator=noop console=ttyS0
[    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000] AGP: Checking aperture...
[    0.000000] AGP: No AGP bridge found
[    0.000000] Memory: 6086104K/6282868K available (5247K kernel code, 947K rwdata, 1832K rodata, 1208K init, 840K bss, 196764K reserved)
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU dyntick-idle grace-period acceleration is enabled.
[    0.000000]  RCU restricting CPUs from NR_CPUS=512 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS:33024 nr_irqs:256 16
[    0.000000] xen:events: Using FIFO-based ABI
[    0.000000] xen:events: Xen HVM callback vector for event delivery is enabled
[    0.000000] Console: colour VGA+ 80x25
[    0.000000] console [ttyS0] enabled
[    0.000000] tsc: Detected 3598.992 MHz processor
[    0.012000] Calibrating delay loop (skipped), value calculated using timer frequency.. 7197.98 BogoMIPS (lpj=14395968)
[    0.028004] pid_max: default: 32768 minimum: 301
[    0.036012] ACPI: Core revision 20140424
[    0.051837] ACPI: All ACPI Tables successfully acquired
[    0.060540] Security Framework initialized
[    0.068009] AppArmor: AppArmor disabled by boot time parameter
[    0.080003] Yama: disabled by default; enable with sysctl kernel.yama.*
[    0.092393] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes)
[    0.101268] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes)
[    0.108550] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes)
[    0.120032] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes)
[    0.136390] Initializing cgroup subsys memory
[    0.144026] Initializing cgroup subsys devices
[    0.152026] Initializing cgroup subsys freezer
[    0.160016] Initializing cgroup subsys net_cls
[    0.168021] Initializing cgroup subsys blkio
[    0.176016] Initializing cgroup subsys perf_event
[    0.188011] Initializing cgroup subsys net_prio
[    0.196145] CPU: Physical Processor ID: 0
[    0.204006] CPU: Processor Core ID: 0
[    0.212011] mce: CPU supports 2 MCE banks
[    0.220060] Last level iTLB entries: 4KB 512, 2MB 7, 4MB 7
[    0.220060] Last level dTLB entries: 4KB 512, 2MB 32, 4MB 32, 1GB 0
[    0.220060] tlb_flushall_shift: 6
[    0.270008] Freeing SMP alternatives memory: 20K (ffffffff81a1c000 - ffffffff81a21000)
[    0.291417] ftrace: allocating 21701 entries in 85 pages
[    0.352435] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=0 pin2=0
[    0.407302] smpboot: CPU0: Intel(R) Xeon(R) CPU           X5687  @ 3.60GHz (fam: 06, model: 2c, stepping: 02)
[    0.424050] installing Xen timer for CPU 0
[    0.432177] Performance Events: unsupported p6 CPU model 44 no PMU driver, software events only.
[    0.445857] x86: Booted up 1 node, 1 CPUs
[    0.448018] smpboot: Total of 1 processors activated (7197.98 BogoMIPS)
[    0.452469] NMI watchdog: disabled (cpu0): hardware events not enabled
[    0.456253] devtmpfs: initialized
[    0.468220] pinctrl core: initialized pinctrl subsystem
[    0.472141] NET: Registered protocol family 16
[    0.476238] cpuidle: using governor ladder
[    0.480019] cpuidle: using governor menu
[    0.484089] ACPI: bus type PCI registered
[    0.488013] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    0.492734] PCI: Using configuration type 1 for base access
[    0.497450] ACPI: Added _OSI(Module Device)
[    0.500013] ACPI: Added _OSI(Processor Device)
[    0.504013] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.508013] ACPI: Added _OSI(Processor Aggregator Device)
[    0.522128] ACPI: Interpreter enabled
[    0.524024] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20140424/hwxface-580)
[    0.535711] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S2_] (20140424/hwxface-580)
[    0.544033] ACPI: (supports S0 S3 S4 S5)
[    0.548012] ACPI: Using IOAPIC for interrupt routing
[    0.552054] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.568633] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[    0.572021] acpi PNP0A03:00: _OSC: OS supports [ASPM ClockPM Segments MSI]
[    0.576031] acpi PNP0A03:00: _OSC failed (AE_NOT_FOUND); disabling ASPM
[    0.580343] acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.
[    0.584888] acpiphp: Slot [3] registered
[    0.588159] acpiphp: Slot [4] registered
[    0.592124] acpiphp: Slot [5] registered
[    0.596134] acpiphp: Slot [6] registered
[    0.600131] acpiphp: Slot [7] registered
[    0.604151] acpiphp: Slot [8] registered
[    0.608129] acpiphp: Slot [9] registered
[    0.612098] acpiphp: Slot [10] registered
[    0.616120] acpiphp: Slot [11] registered
[    0.620109] acpiphp: Slot [12] registered
[    0.624112] acpiphp: Slot [13] registered
[    0.628119] acpiphp: Slot [14] registered
[    0.632154] acpiphp: Slot [15] registered
[    0.636117] acpiphp: Slot [16] registered
[    0.640118] acpiphp: Slot [17] registered
[    0.644127] acpiphp: Slot [18] registered
[    0.648119] acpiphp: Slot [19] registered
[    0.652118] acpiphp: Slot [20] registered
[    0.656119] acpiphp: Slot [21] registered
[    0.660149] acpiphp: Slot [22] registered
[    0.664119] acpiphp: Slot [23] registered
[    0.668113] acpiphp: Slot [24] registered
[    0.672117] acpiphp: Slot [25] registered
[    0.676115] acpiphp: Slot [26] registered
[    0.680117] acpiphp: Slot [27] registered
[    0.684115] acpiphp: Slot [28] registered
[    0.688113] acpiphp: Slot [29] registered
[    0.692113] acpiphp: Slot [30] registered
[    0.696139] acpiphp: Slot [31] registered
[    0.700129] PCI host bridge to bus 0000:00
[    0.704018] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.708015] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7]
[    0.712015] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff]
[    0.716015] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff]
[    0.720015] pci_bus 0000:00: root bus resource [mem 0xf0000000-0xfbffffff]
[    0.748366] pci 0000:00:01.1: legacy IDE quirk: reg 0x10: [io  0x01f0-0x01f7]
[    0.752022] pci 0000:00:01.1: legacy IDE quirk: reg 0x14: [io  0x03f6]
[    0.756015] pci 0000:00:01.1: legacy IDE quirk: reg 0x18: [io  0x0170-0x0177]
[    0.760016] pci 0000:00:01.1: legacy IDE quirk: reg 0x1c: [io  0x0376]
[    0.768611] pci 0000:00:01.3: quirk: [io  0xb000-0xb03f] claimed by PIIX4 ACPI
[    0.772162] pci 0000:00:01.3: quirk: [io  0xb100-0xb10f] claimed by PIIX4 SMB
[    0.827260] ACPI: PCI Interrupt Link [LNKA] (IRQs *5 10 11)
[    0.831799] ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11)
[    0.835629] ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11)
[    0.839445] ACPI: PCI Interrupt Link [LNKD] (IRQs *5 10 11)
[    0.845239] ACPI: Enabled 2 GPEs in block 00 to 0F
[    0.848110] xen:balloon: Initialising balloon driver
[    0.856057] xen_balloon: Initialising balloon driver
[    0.860266] vgaarb: setting as boot device: PCI:0000:00:03.0
[    0.864000] vgaarb: device added: PCI:0000:00:03.0,decodes=io+mem,owns=io+mem,locks=none
[    0.864021] vgaarb: loaded
[    0.868013] vgaarb: bridge control possible 0000:00:03.0
[    0.872044] init_memory_mapping: [mem 0x190000000-0x197ffffff]
[    0.876187] PCI: Using ACPI for IRQ routing
[    0.882529] HPET: 3 timers in total, 0 timers will be used for per-cpu timer
[    0.884038] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
[    0.890542] hpet0: 3 comparators, 64-bit 62.500000 MHz counter
[    0.896028] amd_nb: Cannot enumerate AMD northbridges
[    0.900036] Switched to clocksource xen
[    0.914008] pnp: PnP ACPI init
[    0.920390] ACPI: bus type PNP registered
[    0.928055] system 00:00: [mem 0x00000000-0x0009ffff] could not be reserved
[    0.941437] system 00:01: [io  0x08a0-0x08a3] has been reserved
[    0.954150] system 00:01: [io  0x0cc0-0x0ccf] has been reserved
[    0.966208] system 00:01: [io  0x04d0-0x04d1] has been reserved
[    0.978430] system 00:07: [io  0xae00-0xae0f] has been reserved
[    0.989888] system 00:07: [io  0xb044-0xb047] has been reserved
[    1.002139] pnp: PnP ACPI: found 8 devices
[    1.010482] ACPI: bus type PNP unregistered
[    1.026018] NET: Registered protocol family 2
[    1.034611] TCP established hash table entries: 65536 (order: 7, 524288 bytes)
[    1.048711] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
[    1.062300] TCP: Hash tables configured (established 65536 bind 65536)
[    1.076282] TCP: reno registered
[    1.083473] UDP hash table entries: 4096 (order: 5, 131072 bytes)
[    1.096895] UDP-Lite hash table entries: 4096 (order: 5, 131072 bytes)
[    1.111198] NET: Registered protocol family 1
[    1.120773] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
[    1.132448] pci 0000:00:01.0: PIIX3: Enabling Passive Release
[    1.143536] pci 0000:00:01.0: Activating ISA DMA hang workarounds
[    1.155975] Unpacking initramfs...
[    1.653611] Freeing initrd memory: 30932K (ffff880034386000 - ffff8800361bb000)
[    1.664987] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    1.671339] software IO TLB [mem 0xebfff000-0xeffff000] (64MB) mapped at [ffff8800ebfff000-ffff8800efffefff]
[    1.680275] microcode: CPU0 sig=0x206c2, pf=0x1, revision=0x14
[    1.685279] microcode: Microcode Update Driver: v2.00 <[email protected]>, Peter Oruba
[    1.693165] futex hash table entries: 256 (order: 2, 16384 bytes)
[    1.702078] audit: initializing netlink subsys (disabled)
[    1.710578] audit: type=2000 audit(1613960999.504:1): initialized
[    1.717050] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    1.723569] zbud: loaded
[    1.726975] VFS: Disk quotas dquot_6.5.2
[    1.732474] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    1.742456] msgmni has been set to 11947
[    1.749746] alg: No test for stdrng (krng)
[    1.757405] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    1.771209] io scheduler noop registered (default)
[    1.780259] io scheduler deadline registered
[    1.788138] io scheduler cfq registered
[    1.795348] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    1.805509] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    1.817802] GHES: HEST is not enabled!
[    1.825431] xen:grant_table: Grant tables using version 1 layout
[    1.836685] Grant table initialized
[    1.843914] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    1.897443] 00:06: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    1.912105] Linux agpgart interface v0.103
[    1.920107] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
[    1.940049] serio: i8042 KBD port at 0x60,0x64 irq 1
[    1.948666] serio: i8042 AUX port at 0x60,0x64 irq 12
[    1.958392] mousedev: PS/2 mouse device common for all mice
[    1.966923] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input1
[    1.981401] input: Xen Virtual Keyboard as /devices/virtual/input/input2
[    1.995164] input: Xen Virtual Pointer as /devices/virtual/input/input4
[    2.018214] rtc_cmos 00:02: rtc core: registered rtc_cmos as rtc0
[    2.029967] rtc_cmos 00:02: alarms up to one day, 114 bytes nvram, hpet irqs
[    2.043409] ledtrig-cpu: registered to indicate activity on CPUs
[    2.055112] AMD IOMMUv2 driver by Joerg Roedel <[email protected]>
[    2.067465] AMD IOMMUv2 functionality not available on this system
[    2.079793] TCP: cubic registered
[    2.086264] NET: Registered protocol family 10
[    2.094962] mip6: Mobile IPv6
[    2.100560] NET: Registered protocol family 17
[    2.108302] mpls_gso: MPLS GSO support
[    2.115426] registered taskstats version 1
[    2.124182] xenbus_probe_frontend: Device with no driver: device/vbd/51712
[    2.136918] xenbus_probe_frontend: Device with no driver: device/vif/0
[    2.150014] rtc_cmos 00:02: setting system clock to 2021-02-22 02:30:00 UTC (1613961000)
[    2.168960] Freeing unused kernel memory: 1208K (ffffffff818ee000 - ffffffff81a1c000)
[    2.184230] Write protecting the kernel read-only data: 8192k
[    2.196185] Freeing unused kernel memory: 884K (ffff880001523000 - ffff880001600000)
[    2.211466] Freeing unused kernel memory: 216K (ffff8800017ca000 - ffff880001800000)
[    2.227230] Failed to execute /init (error -8)
[    2.236746] Starting init: /sbin/init exists but couldn't execute it (error -8)
[    2.251559] Starting init: /bin/sh exists but couldn't execute it (error -8)
[    2.265834] Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
[    2.269815] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.16.0-4-amd64 #1 Debian 3.16.39-1
[    2.269815] Hardware name: Xen HVM domU, BIOS 4.8.5 01/10/2020
[    2.269815]  0000000000000000 ffffffff81514c11 ffffffff81705310 ffff8801880f3f40
[    2.269815]  ffffffff8151195e ffffffff00000008 ffff8801880f3f50 ffff8801880f3ef0
[    2.269815]  ffff8801880f3ef8 0000000000000046 000000000000093d 000000000000093d
[    2.269815] Call Trace:
[    2.269815]  [<ffffffff81514c11>] ? dump_stack+0x5d/0x78
[    2.269815]  [<ffffffff8151195e>] ? panic+0xc8/0x206
[    2.269815]  [<ffffffff81507da0>] ? rest_init+0x80/0x80
[    2.269815]  [<ffffffff81507e82>] ? kernel_init+0xe2/0xf0
[    2.269815]  [<ffffffff8151ad18>] ? ret_from_fork+0x58/0x90
[    2.269815]  [<ffffffff81507da0>] ? rest_init+0x80/0x80
[    2.269815] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff)

然后ID继续增加。

我可以做些什么来调试这个问题?我不想使用 virsh destroy 来破坏文件系统的风险。我应该尝试备份与 VM 存储池关联的 OpenAFS 卷吗?我也无法让 guestmount 使用,guestmount -m /dev/sda --ro -a /dev/opc-vg.shell1/shell1-disk /mnt因为它说不允许操作。

xen debian virsh
  • 1 个回答
  • 215 Views
Martin Hope
MrSnrub
Asked: 2021-01-18 19:58:35 +0800 CST

QEMU / KVM - 每个 VM 的专用 802.1q VLAN - 仅通过路由器通信

  • 0

我有一个带有多个 eth N接口(我的“大防火墙”)的 Linux 防火墙路由器(专用机器)。所有转发的流量都由一组iptables规则过滤(默认策略 DROP)。

还有另一台专用机器(“vmhost”)将使用 KVM / QEMU / libvirt / virsh 托管多个虚拟机。

防火墙路由器(物理服务器)和vm主机(另一台物理服务器)通过跳线直接连接(路由器的eth2 <-> vmhost的eth0)。

我不希望 vmhost 上的虚拟机能够通信

  • 对彼此
  • 或到 VM 主机

除了通过外部防火墙路由器。

因此,我在两侧(路由器和 vmhost)配置了多个 802.1q 标记的 VLAN:eth0.10、eth0.11 等(另一侧为 eth2.10、eth2.11、...),每个都有一个不同的/30子网(一个主机 IP = 路由器,另一台主机 IP = VM)。因此,每个虚拟机都有自己的标记 VLAN 和自己的子网。

我想用它来将 VM 流量从属于中央防火墙路由器的 iptables 规则。VM 只能访问明确允许的 IP 地址和端口。

如何将 VM 配置为绑定到专用 VLAN 接口(例如eth0.10)?关于net, netdev, nic, ...

我明确不想在虚拟机的网络或虚拟机和主机之间架起桥梁。

// 稍后添加:两台服务器都使用 Debian 10 amd64。

vlan kvm-virtualization libvirt qemu virsh
  • 1 个回答
  • 1335 Views
Martin Hope
Sandra
Asked: 2020-11-03 02:08:53 +0800 CST

virt-install 后将终端/TTY 恢复正常?

  • 2

在创建了一个虚拟机virt-install之后,终端只有 24 行,而终端有 70 行。

我记得在virsh console.

问题

理想情况下,我会喜欢两者virt-install并virsh console使用整个终端,但是在使用后将终端恢复正常的方法会非常感激。

linux kvm-virtualization virsh virt-install
  • 1 个回答
  • 110 Views
Martin Hope
dsl101
Asked: 2020-07-29 07:20:23 +0800 CST

无法启动使用 virt-clone 克隆的域

  • 0

底部的最终更新

我有一个工作的 KVM 域,我已经配置并希望将其用作其他来宾的“模板”。所以,我的流程大致是这样的:

  1. 关闭“源”域 ( 07xQBuild)
  2. 跑virt-clone --original 07xQBuild --name 07x2 --file ./07x2.qcow2
  3. 使用挂载新创建的07x2.qcow2映像guestmount,并编辑网络配置(/etc/netplan/01-config.yaml、/etc/hostname等)等内容
  4. 卸载图像并开始virsh start 07x2

但这总是以:

error: Failed to start domain 07x2
error: Cannot open log file: '/usr/local/var/log/libvirt/qemu/07x2-fs0-virtiofsd.log': Device or resource busy

没有07x2-fs0-virtiofsd.log文件,07x2.log文件只包含:

2020-07-28 13:42:29.400+0000: shutting down, reason=failed

我尝试运行LIBVIRT_DEBUG=1 virsh start 07x2,但在 400 多行输出中,我只能看到以下错误:

2020-07-28 13:15:00.954+0000: 40737: info : virObjectNew:250 : OBJECT_NEW: obj=0x56440bb29480 classname=virDomain
2020-07-28 13:15:00.954+0000: 40737: info : virObjectRef:385 : OBJECT_REF: obj=0x56440bb25be0
2020-07-28 13:15:00.954+0000: 40737: debug : virDomainGetID:1721 : dom=0x56440bb29480, (VM: name=07x2, uuid=761c9104-b8de-474a-a5d6-31be46b50562)
2020-07-28 13:15:00.955+0000: 40737: debug : virDomainCreate:6544 : dom=0x56440bb29480, (VM: name=07x2, uuid=761c9104-b8de-474a-a5d6-31be46b50562)
2020-07-28 13:15:00.955+0000: 40737: debug : virNetMessageNew:45 : msg=0x56440bb27df0 tracked=0
2020-07-28 13:15:00.955+0000: 40737: debug : virNetMessageEncodePayload:388 : Encode length as 60
2020-07-28 13:15:00.955+0000: 40737: info : virNetClientSendInternal:2108 : RPC_CLIENT_MSG_TX_QUEUE: client=0x56440bb26f60 len=60 prog=536903814 vers=1 proc=9 type=0 status=0 serial=7
2020-07-28 13:15:00.955+0000: 40737: debug : virNetClientCallNew:2061 : New call 0x56440bb39290: msg=0x56440bb27df0, expectReply=1, nonBlock=0
2020-07-28 13:15:00.955+0000: 40737: debug : virNetClientIO:1879 : Outgoing message prog=536903814 version=1 serial=7 proc=9 type=0 length=60 dispatch=(nil)
2020-07-28 13:15:00.955+0000: 40737: debug : virNetClientIO:1931 : We have the buck head=0x56440bb39290 call=0x56440bb39290
2020-07-28 13:15:00.955+0000: 40737: info : virEventGLibHandleUpdate:196 : EVENT_GLIB_UPDATE_HANDLE: watch=1 events=0
2020-07-28 13:15:00.955+0000: 40737: debug : virEventGLibHandleUpdate:206 : Update handle data=0x56440bb27420 watch=1 fd=4 events=0
2020-07-28 13:15:00.955+0000: 40737: debug : virEventGLibHandleUpdate:227 : Removed old handle watch=15
2020-07-28 13:15:00.955+0000: 40738: debug : virEventRunDefaultImpl:340 : running default event implementation
2020-07-28 13:15:00.955+0000: 40737: info : virEventGLibTimeoutUpdate:381 : EVENT_GLIB_UPDATE_TIMEOUT: timer=2 interval=5000
2020-07-28 13:15:00.955+0000: 40737: debug : virEventGLibTimeoutUpdate:390 : Update timeout data=0x56440bb27dc0 timer=2 interval=5000 ms
2020-07-28 13:15:00.955+0000: 40738: debug : virEventRunDefaultImpl:340 : running default event implementation
2020-07-28 13:15:02.363+0000: 40737: info : virEventGLibTimeoutUpdate:381 : EVENT_GLIB_UPDATE_TIMEOUT: timer=2 interval=3000
2020-07-28 13:15:02.363+0000: 40737: debug : virEventGLibTimeoutUpdate:390 : Update timeout data=0x56440bb27dc0 timer=2 interval=3000 ms
2020-07-28 13:15:02.363+0000: 40737: debug : virNetMessageDecodeLength:160 : Got length, now need 304 total (300 more)
2020-07-28 13:15:02.363+0000: 40737: info : virNetClientCallDispatch:1263 : RPC_CLIENT_MSG_RX: client=0x56440bb26f60 len=304 prog=536903814 vers=1 proc=9 type=1 status=1 serial=7
2020-07-28 13:15:02.363+0000: 40737: debug : virKeepAliveCheckMessage:369 : ka=0x56440bb28bb0, client=0x56440bb26f60, msg=0x56440bb26fc8
2020-07-28 13:15:02.363+0000: 40737: info : virEventGLibTimeoutUpdate:381 : EVENT_GLIB_UPDATE_TIMEOUT: timer=2 interval=5000
2020-07-28 13:15:02.363+0000: 40737: debug : virEventGLibTimeoutUpdate:390 : Update timeout data=0x56440bb27dc0 timer=2 interval=5000 ms
2020-07-28 13:15:02.363+0000: 40737: debug : virNetMessageClear:73 : msg=0x56440bb26fc8 nfds=0
2020-07-28 13:15:02.363+0000: 40738: debug : virEventRunDefaultImpl:340 : running default event implementation
2020-07-28 13:15:02.363+0000: 40737: debug : virNetClientIOEventLoopPassTheBuck:1559 : Giving up the buck 0x56440bb39290
2020-07-28 13:15:02.363+0000: 40737: debug : virNetClientIOEventLoopPassTheBuck:1573 : No thread to pass the buck to
2020-07-28 13:15:02.363+0000: 40737: info : virEventGLibHandleUpdate:196 : EVENT_GLIB_UPDATE_HANDLE: watch=1 events=1
2020-07-28 13:15:02.363+0000: 40737: debug : virEventGLibHandleUpdate:206 : Update handle data=0x56440bb27420 watch=1 fd=4 events=1
2020-07-28 13:15:02.363+0000: 40737: debug : virEventGLibHandleUpdate:222 : Added new handle watch=19
2020-07-28 13:15:02.363+0000: 40737: debug : virNetClientIO:1956 : All done with our call head=(nil) call=0x56440bb39290 rv=0
2020-07-28 13:15:02.363+0000: 40737: debug : virNetMessageFree:86 : msg=0x56440bb27df0 nfds=0 cb=(nil)
2020-07-28 13:15:02.363+0000: 40738: debug : virEventRunDefaultImpl:340 : running default event implementation
2020-07-28 13:15:02.363+0000: 40737: debug : virDomainGetName:1642 : domain=0x56440bb29480
error: Failed to start domain 07x2
2020-07-28 13:15:02.363+0000: 40737: debug : virDomainFree:562 : dom=0x56440bb29480, (VM: name=07x2, uuid=761c9104-b8de-474a-a5d6-31be46b50562)
2020-07-28 13:15:02.364+0000: 40737: info : virObjectUnref:347 : OBJECT_UNREF: obj=0x56440bb29480
2020-07-28 13:15:02.364+0000: 40737: info : virObjectUnref:349 : OBJECT_DISPOSE: obj=0x56440bb29480
2020-07-28 13:15:02.364+0000: 40737: debug : virDomainDispose:323 : release domain 0x56440bb29480 07x2 761c9104-b8de-474a-a5d6-31be46b50562
2020-07-28 13:15:02.364+0000: 40737: info : virObjectUnref:347 : OBJECT_UNREF: obj=0x56440bb25be0
error: Cannot open log file: '/usr/local/var/log/libvirt/qemu/07x2-fs0-virtiofsd.log': Device or resource busy

我尝试转储源域的 XML(有效)和克隆的 XML(无效),唯一的 4 个区别是名称、uuid、源文件和 mac 地址:

# diff 07xQBuild.xml 07x2.xml
2,3c2,3
<   <name>07xQBuild</name>
<   <uuid>24ed7962-518e-4151-8635-84cb72a8a9b4</uuid>
---
>   <name>07x2</name>
>   <uuid>761c9104-b8de-474a-a5d6-31be46b50562</uuid>
45c45
<       <source file='/fast_data/kvm/images/07xQBuild.qcow2'/>
---
>       <source file='/fast_data/kvm/images/07x2.qcow2'/>
83c83
<       <mac address='52:54:00:01:7c:fc'/>
---
>       <mac address='52:54:00:c6:4a:e4'/>

使用 克隆域后是否还需要其他东西virt-clone?

2020-07-28 17:10 英国夏令时更新

好的,这似乎很简单——我可以创建一个名为 07x3 的新来宾,并且一切正常。由于我一直在重建和测试 07x2 几次,看起来有些东西卡住了。要删除和重新创建域,我一直在这样做:

# virsh destroy 07x2
# virsh undefine 07x2
# rm 07x2.qcow2

这对所有其他域都有效,但 07x2 总是会导致该错误。所以我想新的问题是如何找出我还需要删除/清除/清除什么才能重新创建它?

2020-08-14 11:31 英国夏令时更新

根据@gediz-gÜrsu 的回答,我尝试了这个:

  1. # cp -a /fast_data/kvm/images/07xTemplate.qcow2 /fast_data/kvm/images/07x2.qcow2
  2. # cp -a /usr/local/etc/libvirt/qemu/07xTemplate.xml /usr/local/etc/libvirt/qemu/07x2.xml
  3. 编辑那个xml,替换名字、uuid、磁盘源和mac地址
  4. # virsh define /usr/local/etc/libvirt/qemu/07x2.xml
  5. 用于guestmount更新磁盘映像设置(IP 地址等)
  6. # virsh start 07x2

我得到了完全相同的错误,并且没有名为07x2-fs0-virtiofsd.log. 07x2.log看起来与原始问题完全相同。所以我想我们可以排除virt-clone问题的原因。

然而,运行lsof | grep virtiofsd.log产生了这个:

virtlogd   3255                   root   15w      REG              253,1           0    5773534 /usr/local/var/log/libvirt/qemu/07x1-fs0-virtiofsd.log
virtlogd   3255                   root   17w      REG              253,1           0    5773535 /usr/local/var/log/libvirt/qemu/07x1-fs1-virtiofsd.log
virtlogd   3255                   root   19w      REG              253,1           0    5773536 /usr/local/var/log/libvirt/qemu/07x1-fs2-virtiofsd.log
virtlogd   3255                   root   21w      REG              253,1           0    5773537 /usr/local/var/log/libvirt/qemu/07x1-fs3-virtiofsd.log
virtlogd   3255                   root   23w      REG              253,1           0    5773538 /usr/local/var/log/libvirt/qemu/07x1-fs4-virtiofsd.log
virtlogd   3255                   root   27w      REG              253,1           0    5767384 /usr/local/var/log/libvirt/qemu/07x2-fs0-virtiofsd.log (deleted)
virtlogd   3255                   root   29w      REG              253,1           0    5767385 /usr/local/var/log/libvirt/qemu/07x2-fs1-virtiofsd.log (deleted)
virtlogd   3255                   root   31w      REG              253,1           0    5773542 /usr/local/var/log/libvirt/qemu/07x3-fs0-virtiofsd.log
virtlogd   3255                   root   33w      REG              253,1           0    5773543 /usr/local/var/log/libvirt/qemu/07x3-fs1-virtiofsd.log
virtlogd   3255                   root   35w      REG              253,1           0    5773807 /usr/local/var/log/libvirt/qemu/07x3-fs2-virtiofsd.log
virtlogd   3255                   root   37w      REG              253,1           0    5773808 /usr/local/var/log/libvirt/qemu/07x3-fs3-virtiofsd.log
virtlogd   3255                   root   39w      REG              253,1           0    5774205 /usr/local/var/log/libvirt/qemu/07x3-fs4-virtiofsd.log

对不起,它很宽 - 滚动查看(deleted)我猜是问题原因的 2 个条目。因此,解决方案似乎很简单service virtlogd restart。我现在能够成功启动该域!

kvm-virtualization libvirt virsh
  • 1 个回答
  • 418 Views
Martin Hope
turbonerd
Asked: 2020-04-15 00:41:29 +0800 CST

无法在 Amazon Linux 2 KVM 映像上访问控制台或 SSH

  • 0

我正在尝试在 CentOS 7 主机上的本地环境中创建运行 Amazon Linux 2 的 KVM 来宾实例。我正在通过 SSH 进行此操作(例如,我的本地机器 -> SSH 到 CentOS 主机)。

我知道我的管理程序设置有效,因为使用以下命令,我可以创建一个具有 SSH 访问权限的 CentOS 7 来宾完全没有问题:

OS_IMG=CentOS-7-x86_64-GenericCloud.qcow2
DIR=/home/libvirt
SCRIPTS=$DIR/scripts
BOOT=$DIR/boot
IMG=$DIR/images
VM=centos-vm-test

# +++ Downloading image OS image
cd $BOOT
wget http://cloud.centos.org/centos/7/images/$OS_IMG

# +++ Creating meta/user data
cd $IMG/$VM
echo -e "instance-id: $VM\nlocal-hostname: $VM" > meta-data
cp $SCRIPTS/user-data user-data
cp $BOOT/$OS_IMG $VM.qcow2

# +++ Creating disk
export LIBGUESTFS_BACKEND=direct
qemu-img create -f qcow2 -o preallocation=metadata $VM.new.image 40G
virt-resize --quiet --expand /dev/sda1 $VM.qcow2 $VM.new.image
mv $VM.new.image $VM.qcow2

# +++ Creating CD-ROM containing cloud init data
mkisofs -o $VM-cidata.iso -V cidata -J -r user-data meta-data

# +++ Creating VM"
virt-install --import --name $VM \
    --memory 4096 --vcpus 2 --cpu host \
    --disk $VM.qcow2,format=qcow2,bus=virtio \
    --disk $VM-cidata.iso,device=cdrom \
    --network bridge=virbr0,model=virtio \
    --os-type=linux \
    --os-variant=centos7.0 \
    --noautoconsole

在几秒钟内,我可以运行virsh net-dhcp-leases并查看可以通过 SSH 访问的 IP 地址。

我尝试使用 Amazon Linux 2 复制此过程,使用此处找到的图像:https ://cdn.amazonlinux.com/os-images/2.0.20200304.0/kvm/

对于user-data,我已经尝试了我的 CentOS 文件(很长,包括很多runcmd行)和推荐的基本内容在这里找到:https ://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-2-虚拟机.html。使用 2 个不同的文件时,我没有看到任何区别。

然而,这似乎不起作用,我不知道如何进一步进行。

  • 我无法运行virsh console myvmname,因为它只是卡住了Escape character is ^](回车键什么都不做)。在 CentOS 客户机上,我可以运行virsh console myvmname,只需按一下返回键,就可以按预期连接
  • 如果我运行virsh net-dhcp-leases default,则没有租约 - 所以我没有可以尝试 SSH 连接的 IP 地址
  • 登录/var/log/libvirt/qemu显示没有错;失败的 AL2 日志看起来与工作中的 CentOS 来宾日志相同。

我还尝试完全按照之前亚马逊链接上的建议复制该过程,包括使用genisoimage文件seed.iso等,但这似乎没有任何区别。

我如何才能访问此 VM,或者至少尝试找出问题所在?引导日志将是理想的。

kvm-virtualization libvirt amazon-linux-2 virsh
  • 1 个回答
  • 376 Views
Martin Hope
CzipO2
Asked: 2020-04-08 08:54:44 +0800 CST

KVM 虚拟机重启后失去了公共 IP 和访问互联网?

  • 0

我用“virsh shutdown VM”关闭了其中一个虚拟机,当我启动它时,它失去了对互联网的访问权限。虚拟机有自己的公共 IP,有自己的接口。我不确定这个公共 IP 是如何提供给 VM 的,可能来自 KVM 主机,但我在历史上看不到它。有什么好方法可以开始调试吗?

networking kvm-virtualization virsh
  • 1 个回答
  • 195 Views
Martin Hope
Cutton Eye
Asked: 2019-09-30 23:48:05 +0800 CST

获取所有 virsh 配置

  • 0

我有几个用 virsh 管理的 qemu vm。我已经创建了图像的备份。现在我想创建配置文件的备份。我怎样才能做到这一点?

到目前为止,我想出的唯一解决方案是:virsh dumpxml vmname > bachuk.xml请参阅. 但这仅存储一台机器。

有没有一种简单的方法可以使用简单的命令来获取所有配置?

virsh
  • 1 个回答
  • 552 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve