kvm vm deploy command memo

1831 단어 KVM

kvm vm deploy command memo



objectives


  • personal memo

  • create disk image


    VMNAME=''
    
    qemu-img create -f qcow2 -o preallocation=metadata $VMNAME.qcow2 45G
    

    deploy vm


    RAM=''    ### 8192 = 8GB
    CPU=''    ### 2 is multicpu
    VNCPORT=''
    ISOFILE=''
    OSTYPE=''  ###[linux, unix, windows, other]
    
    echo $VMNAME $RAM $CPU $VNCPORT $ISOFILE $OSTYPE
    
  • pattern 1
  • virt-install --connect qemu:///system \
    -n $VMNAME \
    -r $RAM \
    --vcpus=$CPU \
    --disk path=./$VMNAME.qcow2 \
    -c ../osimages/$ISOFILE \
    --os-type $OSTYPE \
    --accelerate --network=bridge:br0,model=e1000 --hvm \
    --graphics vnc,port=$VNCPORT,listen=0.0.0.0 \
    -usbdevice tablet
    
  • If you use vnc with mouse operation, add -usbdevice tablet or edit xml like following. ( htps //w w. 마이 루 아 r ゔ ぇ. 이 m/kvm@v r. 케 r네 l. rg/msg25261. HTML )
  •     <input type='tablet' bus='usb'/>
    
  • pattern2
  • virt-install --connect qemu:///system \
    -n $VMNAME \
    -r $RAM \
    --vcpus=sockets=1,cores=2,threads=2 \
    --cpu Nehalem,match=exact,require=vmx \
    --disk path=./$VMNAME.qcow2 \
    -c ../osimages/$ISOFILE \
    --os-type $OSTYPE \
    --accelerate --network=bridge:br0,model=e1000 --hvm \
    --graphics vnc,port=$VNCPORT,listen=0.0.0.0
    

    access vnc with above port on kvm host





    proceed OS installation

    좋은 웹페이지 즐겨찾기