您的位置:首页 > 运维架构 > Linux

virt-install to create a new VM instance

2015-09-09 13:32 531 查看
Create a NFS shared in the NFS server:

    # mkdir /var/tmp/OEL5

    # mount -o loop,ro /var/tmp/Linux.iso /var/tmp/OEL5

    # exportfs *:/var/tmp/OEL5

The command to install the VM instance with virt-install command

    # virt-install -n VM1 -r 2048 -f /OVS/running_pool/VM1/System.img -s 20 --nographics -l nfs:192.168.200.11:/mnt -d -b xenbr0

    # virt-install -n VM1 -r 2048 -f /OVS/running_pool/VM1/System.img -s 20 --nographics -l http:192.168.200.11:/mnt -d -b xenbr0

    # virt-install -n VM1 -r 2048 -f /OVS/running_pool/VM1/System.img -s 20 --nographics -l ftp:192.168.200.11:/mnt -d -b xenbr0

The help option of virt-install:

[root@ovs1 log]# virt-install -h

usage: virt-install [options]

options:

  -h, --help            show this help message and exit

  -n NAME, --name=NAME  Name of the guest instance

  -r MEMORY, --ram=MEMORY

                        Memory to allocate for guest instance in megabytes

  -u UUID, --uuid=UUID  UUID for the guest; if none is given a random UUID

                        will be generated

  --vcpus=VCPUS         Number of vcpus to configure for your guest

  -f DISKFILE, --file=DISKFILE

                        File to use as the disk image

  -s DISKSIZE, --file-size=DISKSIZE

                        Size of the disk image (if it doesn't exist) in

                        gigabytes

  --nonsparse           Don't use sparse files for disks.  Note that this will

                        be significantly slower for guest creation

  -m MAC, --mac=MAC     Fixed MAC address for the guest; if none or RANDOM is

                        given a random address will be used

  -b BRIDGE, --bridge=BRIDGE

                        Bridge to connect guest NIC to; if none given, will

                        try to determine the default

  --vnc                 Use VNC for graphics support

  --vncport=VNCPORT     Port to use for VNC

  --vncpasswd=VNCPASSWD

                        File with VNC password

  --vnclisten=VNCLISTEN

                        VNC listener IP address

  --usbtablet           Use tablet config for VNC mouse

  --sdl                 Use SDL for graphics support

  --nographics          Don't set up a graphical console for the guest.

  --noautoconsole       Don't automatically try to connect to the guest

                        console

  --keymap=KEYMAP       set up keymap for a graphical console

  -p, --paravirt        This guest should be a paravirtualized guest

  -l LOCATION, --location=LOCATION

                        Installation source for paravirtualized guest (eg,

                        nfs:host:/path, http://host/path, ftp://host/path)

  -x EXTRA, --extra-args=EXTRA

                        Additional arguments to pass to the installer with

                        paravirt guests

  -d, --debug           Print debugging information
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux virt-install