Code:
qm create ${VMID} --args "-append 'root=live:${URL}/centos/7/os/x86_64/LiveOS/squashfs.img ks=cdrom:/dev/cdrom:/${KICKSTART_FILE_NAME}' -kernel ${WORKDIR}/vmlinuz -initrd ${WORKDIR}/initrd.img" --ide2 local:iso/ksboot.iso,media=cdrom --name ${VMNAME} --net0 rtl8139,rate=50,bridge=vmbr0 --virtio0 local:${HDDGB},format=qcow2,cache=writeback,mbps_rd=5,mbps_wr=5 --bootdisk virtio0 --ostype l26 --memory ${MEMMB} --onboot yes --cores ${VCPU} --sockets 1
[FONT=monospace][COLOR=#000000]qm start ${VMID}
[/COLOR][/FONT][FONT=monospace][COLOR=#000000]qm wait ${VMID}[/COLOR]
[/FONT][FONT=monospace][COLOR=#000000]qm set ${VMID} --args "" --ide2 none,media=cdrom[/COLOR]
qm start ${VMID}[/FONT]
VM installed successfully
Before two start is error:
Code:
[COLOR=#000000][FONT=monospace]update VM 333: -ide2 none,media=cdrom -args [/FONT][/COLOR][FONT=monospace]kvm: Device needs media, but drive is empty
kvm: Device initialization failed.
kvm: Initialization of device ide-hd failed
start failed: command '/usr/bin/kvm -id 333 -chardev 'socket,id=qmp,path=/var/run/qemu-server/333.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -
vnc unix:/var/run/qemu-server/333.vnc,x509,password -pidfile /var/run/qemu-server/333.pid -daemonize -smbios 'type=1,uuid=7ae24755-e11d-4749-9c04-8e09
28228eb1' -name 333 -smp '1,sockets=1,cores=1,maxcpus=1' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000' -vga cirrus -cpu kvm64,+lahf_lm,+x2
apic,+sep -m 1024 -k en-us '' -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' -device 'virtio
-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:1775b27a24b' -drive 'if=none,id=drive-ide2,media=cdrom,a
io=native' -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' -drive 'file=/var/lib/vz/images/333/vm-333-disk-1.qcow2,if=none,id
=drive-virtio0,format=qcow2,cache=writeback,bps_rd=5242880,bps_wr=5242880,aio=native,detect-zeroes=on' -device 'virtio-blk-pci,drive=drive-virtio0,id=
virtio0,bus=pci.0,addr=0xa,bootindex=100' -netdev 'type=tap,id=net0,ifname=tap333i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-se
rver/pve-bridgedown' -device 'rtl8139,mac=46:57:BD:F0:38:24,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300'' failed: exit code 1
[/FONT]
less /etc/pve/qemu-server/333.conf
Code:
args: ''
[/COLOR][/FONT][COLOR=#000000][FONT=monospace]bootdisk: virtio0 [/FONT][/COLOR]
[FONT=monospace]cores: 1
cpu: core2duo
ide2: none,media=cdrom
memory: 1024
name: gateway
net0: rtl8139=[/FONT][FONT=monospace]46:57:BD:F0:38:24[/FONT][FONT=monospace],bridge=vmbr0 [/FONT]
[FONT=monospace]numa: 0
onboot: 1
ostype: l26
smbios1: uuid=4c03c2db-d20e-48b5-bbd2-3fd31c71e2df
sockets: 1
virtio0: local:333/vm-333-disk-1.qcow2,format=qcow2,cache=writethrough,size=10G[/FONT]