Monday, November 3, 2014


How to create a Centos VM from command line, with one liner

     

#create centos6:

virt-install --name acid-1.6 --ram 4096 --vcpus 4 --location http://mirror.centos.org/centos-6/6/os/x86_64/ --disk=/home/templates/acid-1.6.img,size=100 --network=bridge:virbr0,model=virtio --nographics --extra-args="text console=tty0 console=ttyS0,115200"


#create centos5.9:

virt-install --name DS --ram 4096 --vcpus 4 --location http://mirror.nsc.liu.se/centos-store/5.9/os/x86_64/ --disk=/home/cb_templates/ds-base.qcow2,size=10,format=qcow2,bus=virtio,cache=none --network=bridge:virbr0,model=virtio --nographics --extra-args="text console=tty0 console=ttyS0,115200"

or

[root@openvpn ~]# virt-install --name DS --ram 4096 --vcpus 4 --location http://mirror.nsc.liu.se/centos-store/5.9/os/x86_64/ --disk=/home/cb_templates/ds-600base.qcow2,format=qcow2,bus=virtio,cache=none --network=bridge:virbr0,model=virtio --nographics --extra-args="text console=tty0 console=ttyS0,115200"

#create a thin qcow2

[root@openvpn ~]# qemu-img create -f qcow2 -o preallocation=metadata /home/cb_templates/ds-600base.qcow2 600G
Formatting '/home/cb_templates/ds.qcow2', fmt=qcow2 size=644245094400 encryption=off cluster_size=65536 preallocation='metadata'



No comments:

Post a Comment