virt-install to create a new VM instance

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值