精华内容
下载资源
问答
  • virsh edit查询虚拟机

    千次阅读 2017-10-13 14:22:50
    通过UI 可以知道目前两个虚拟机都在计算节点上 ...通过virsh edit 可以查看虚拟机的xml 虚拟机的类型是kvm 用的模拟器是qemu-system-aarch64 用的是openvswitch tap是tapa7b97820

    通过UI 可以知道目前两个虚拟机都在计算节点上

    登录计算节点,通过virsh list可以看到这两个虚拟机

    通过virsh edit 可以查看虚拟机的xml

    虚拟机的类型是kvm

    用的模拟器是qemu-system-aarch64

    用的是openvswitch tap是tapa7b97820


    展开全文
  • s virsh edit command it will fail to validate against their schema. <p>I propose we make it so that spaces are not allowed in network names as the only other option is to try and get libvirt to change...
  • virsh命令

    千次阅读 2017-02-04 20:10:45
    virsh edit kvm 编辑KVM虚拟机配置文件 virsh console kvm 控制台管理linux虚拟机 virsh autostart kvm 配置开机自启动虚拟机 virsh start kvm 启动虚拟机 virsh domblklist kvm 查看虚拟机
    virsh list  查看运行状态的虚拟机
    virsh list --all  查看所有状态虚拟机
    virsh edit kvm  编辑KVM虚拟机配置文件
    virsh console kvm  控制台管理linux虚拟机
    virsh autostart kvm  配置开机自启动虚拟机
    virsh start kvm 启动虚拟机
    virsh domblklist kvm  查看虚拟机现有磁盘
    virsh domiflist kvm  查看网卡MAC地址信息
    virsh vncdisplay kvm  查看vnc端口
    virsh dominfo kvm  虚拟机信息
    virsh snapshot-create kvm  虚拟机创建快照   virsh snapshot-curren kvm"," 查看当前快照的版本,此两条命令适用于目录存储,不适用于ceph存储直接使用
    virsh suspend kvm  挂起虚拟机
    virsh resume kvm  恢复虚拟机

    virt-clone -o kvm-debian8-template -n kvm /kvm/vm_disk/kvm.qcow2"  克隆虚拟机


    解释:

    root@computer2:~# virsh --help

    virsh [options]... [<command_string>]
    virsh [options]... <command> [args...]

     Domain Management (help keyword 'domain')
        attach-device                  attach device from an XML file
        attach-disk                    attach disk device
        attach-interface               attach network interface
        autostart                      autostart a domain
        blkdeviotune                   Set or query a block device I/O tuning parameters.
        blkiotune                      Get or set blkio parameters
        blockcommit                    Start a block commit operation.
        blockcopy                      Start a block copy operation.
        blockjob                       Manage active block operations
        blockpull                      Populate a disk from its backing image.
        blockresize                    Resize block device of domain.
        change-media                   Change media of CD or floppy drive
        console                        connect to the guest console
        cpu-baseline                   compute baseline CPU
        cpu-compare                    compare host CPU with a CPU described by an XML file
        cpu-stats                      show domain cpu statistics
        create                         create a domain from an XML file
        define                         define (but don't start) a domain from an XML file
        desc                           show or set domain's description or title
        destroy                        destroy (stop) a domain
        detach-device                  detach device from an XML file
        detach-disk                    detach disk device
        detach-interface               detach network interface
        domdisplay                     domain display connection URI
        domfsfreeze                    Freeze domain's mounted filesystems.
        domfsthaw                      Thaw domain's mounted filesystems.
        domfstrim                      Invoke fstrim on domain's mounted filesystems.
        domhostname                    print the domain's hostname
        domid                          convert a domain name or UUID to domain id
        domif-setlink                  set link state of a virtual interface
        domiftune                      get/set parameters of a virtual interface
        domjobabort                    abort active domain job
        domjobinfo                     domain job information
        domname                        convert a domain id or UUID to domain name
        dompmsuspend                   suspend a domain gracefully using power management functions
        dompmwakeup                    wakeup a domain from pmsuspended state
        domuuid                        convert a domain name or id to domain UUID
        domxml-from-native             Convert native config to domain XML
        domxml-to-native               Convert domain XML to native config
        dump                           dump the core of a domain to a file for analysis
        dumpxml                        domain information in XML
        edit                           edit XML configuration for a domain
        event                          Domain Events
        inject-nmi                     Inject NMI to the guest
        send-key                       Send keycodes to the guest
        send-process-signal            Send signals to processes
        lxc-enter-namespace            LXC Guest Enter Namespace
        managedsave                    managed save of a domain state
        managedsave-remove             Remove managed save of a domain
        memtune                        Get or set memory parameters
        metadata                       show or set domain's custom XML metadata
        migrate                        migrate domain to another host
        migrate-setmaxdowntime         set maximum tolerable downtime
        migrate-compcache              get/set compression cache size
        migrate-setspeed               Set the maximum migration bandwidth
        migrate-getspeed               Get the maximum migration bandwidth
        numatune                       Get or set numa parameters
        qemu-attach                    QEMU Attach
        qemu-monitor-command           QEMU Monitor Command
        qemu-monitor-event             QEMU Monitor Events
        qemu-agent-command             QEMU Guest Agent Command
        reboot                         reboot a domain
        reset                          reset a domain
        restore                        restore a domain from a saved state in a file
        resume                         resume a domain
        save                           save a domain state to a file
        save-image-define              redefine the XML for a domain's saved state file
        save-image-dumpxml             saved state domain information in XML
        save-image-edit                edit XML for a domain's saved state file
        schedinfo                      show/set scheduler parameters
        screenshot                     take a screenshot of a current domain console and store it into a file
        setmaxmem                      change maximum memory limit
        setmem                         change memory allocation
        setvcpus                       change number of virtual CPUs
        shutdown                       gracefully shutdown a domain
        start                          start a (previously defined) inactive domain
        suspend                        suspend a domain
        ttyconsole                     tty console
        undefine                       undefine a domain
        update-device                  update device from an XML file
        vcpucount                      domain vcpu counts
        vcpuinfo                       detailed domain vcpu information
        vcpupin                        control or query domain vcpu affinity
        emulatorpin                    control or query domain emulator affinity
        vncdisplay                     vnc display


     Domain Monitoring (help keyword 'monitor')
        domblkerror                    Show errors on block devices
        domblkinfo                     domain block device size information
        domblklist                     list all domain blocks
        domblkstat                     get device block stats for a domain
        domcontrol                     domain control interface state
        domif-getlink                  get link state of a virtual interface
        domiflist                      list all domain virtual interfaces
        domifstat                      get network interface stats for a domain
        dominfo                        domain information
        dommemstat                     get memory statistics for a domain
        domstate                       domain state
        domstats                       get statistics about one or multiple domains
        domtime                        domain time
        list                           list domains


     Host and Hypervisor (help keyword 'host')
        allocpages                     Manipulate pages pool size
        capabilities                   capabilities
        cpu-models                     CPU models
        domcapabilities                domain capabilities
        freecell                       NUMA free memory
        freepages                      NUMA free pages
        hostname                       print the hypervisor hostname
        maxvcpus                       connection vcpu maximum
        node-memory-tune               Get or set node memory parameters
        nodecpumap                     node cpu map
        nodecpustats                   Prints cpu stats of the node.
        nodeinfo                       node information
        nodememstats                   Prints memory stats of the node.
        nodesuspend                    suspend the host node for a given time duration
        sysinfo                        print the hypervisor sysinfo
        uri                            print the hypervisor canonical URI
        version                        show version


     Interface (help keyword 'interface')
        iface-begin                    create a snapshot of current interfaces settings, which can be later committed (iface-commit) or restored (iface-rollback)
        iface-bridge                   create a bridge device and attach an existing network device to it
        iface-commit                   commit changes made since iface-begin and free restore point
        iface-define                   define (but don't start) a physical host interface from an XML file
        iface-destroy                  destroy a physical host interface (disable it / "if-down")
        iface-dumpxml                  interface information in XML
        iface-edit                     edit XML configuration for a physical host interface
        iface-list                     list physical host interfaces
        iface-mac                      convert an interface name to interface MAC address
        iface-name                     convert an interface MAC address to interface name
        iface-rollback                 rollback to previous saved configuration created via iface-begin
        iface-start                    start a physical host interface (enable it / "if-up")
        iface-unbridge                 undefine a bridge device after detaching its slave device
        iface-undefine                 undefine a physical host interface (remove it from configuration)


     Network Filter (help keyword 'filter')
        nwfilter-define                define or update a network filter from an XML file
        nwfilter-dumpxml               network filter information in XML
        nwfilter-edit                  edit XML configuration for a network filter
        nwfilter-list                  list network filters
        nwfilter-undefine              undefine a network filter


     Networking (help keyword 'network')
        net-autostart                  autostart a network
        net-create                     create a network from an XML file
        net-define                     define (but don't start) a network from an XML file
        net-destroy                    destroy (stop) a network
        net-dhcp-leases                print lease info for a given network
        net-dumpxml                    network information in XML
        net-edit                       edit XML configuration for a network
        net-event                      Network Events
        net-info                       network information
        net-list                       list networks
        net-name                       convert a network UUID to network name
        net-start                      start a (previously defined) inactive network
        net-undefine                   undefine a persistent network
        net-update                     update parts of an existing network's configuration
        net-uuid                       convert a network name to network UUID


     Node Device (help keyword 'nodedev')
        nodedev-create                 create a device defined by an XML file on the node
        nodedev-destroy                destroy (stop) a device on the node
        nodedev-detach                 detach node device from its device driver
        nodedev-dumpxml                node device details in XML
        nodedev-list                   enumerate devices on this host
        nodedev-reattach               reattach node device to its device driver
        nodedev-reset                  reset node device


     Secret (help keyword 'secret')
        secret-define                  define or modify a secret from an XML file
        secret-dumpxml                 secret attributes in XML
        secret-get-value               Output a secret value
        secret-list                    list secrets
        secret-set-value               set a secret value
        secret-undefine                undefine a secret


     Snapshot (help keyword 'snapshot')
        snapshot-create                Create a snapshot from XML
        snapshot-create-as             Create a snapshot from a set of args
        snapshot-current               Get or set the current snapshot
        snapshot-delete                Delete a domain snapshot
        snapshot-dumpxml               Dump XML for a domain snapshot
        snapshot-edit                  edit XML for a snapshot
        snapshot-info                  snapshot information
        snapshot-list                  List snapshots for a domain
        snapshot-parent                Get the name of the parent of a snapshot
        snapshot-revert                Revert a domain to a snapshot


     Storage Pool (help keyword 'pool')
        find-storage-pool-sources-as   find potential storage pool sources
        find-storage-pool-sources      discover potential storage pool sources
        pool-autostart                 autostart a pool
        pool-build                     build a pool
        pool-create-as                 create a pool from a set of args
        pool-create                    create a pool from an XML file
        pool-define-as                 define a pool from a set of args
        pool-define                    define (but don't start) a pool from an XML file
        pool-delete                    delete a pool
        pool-destroy                   destroy (stop) a pool
        pool-dumpxml                   pool information in XML
        pool-edit                      edit XML configuration for a storage pool
        pool-info                      storage pool information
        pool-list                      list pools
        pool-name                      convert a pool UUID to pool name
        pool-refresh                   refresh a pool
        pool-start                     start a (previously defined) inactive pool
        pool-undefine                  undefine an inactive pool
        pool-uuid                      convert a pool name to pool UUID


     Storage Volume (help keyword 'volume')
        vol-clone                      clone a volume.
        vol-create-as                  create a volume from a set of args
        vol-create                     create a vol from an XML file
        vol-create-from                create a vol, using another volume as input
        vol-delete                     delete a vol
        vol-download                   download volume contents to a file
        vol-dumpxml                    vol information in XML
        vol-info                       storage vol information
        vol-key                        returns the volume key for a given volume name or path
        vol-list                       list vols
        vol-name                       returns the volume name for a given volume key or path
        vol-path                       returns the volume path for a given volume name or key
        vol-pool                       returns the storage pool for a given volume key or path
        vol-resize                     resize a vol
        vol-upload                     upload file contents to a volume
        vol-wipe                       wipe a vol


     Virsh itself (help keyword 'virsh')
        cd                             change the current directory
        connect                        (re)connect to hypervisor
        echo                           echo arguments
        exit                           quit this interactive terminal
        help                           print help
        pwd                            print the current directory
        quit                           quit this interactive terminal




      (specify help <group> for details about the commands in the group)


      (specify help <command> for details about the command)


    展开全文
  • 【制作镜像】virsh

    2015-10-22 14:46:00
    首先进入到图形界面 常用virsh指令: 1)virsh list 列出当前虚拟机列表,不包括未启动的 2)virsh list --all 列出所有虚拟机,包括所有已经定义的虚拟机 ...5)virsh edit vm-name 编辑虚拟机x...

    首先进入到图形界面

    常用virsh指令:

    1)virsh list 列出当前虚拟机列表,不包括未启动的

     

    2)virsh list --all 列出所有虚拟机,包括所有已经定义的虚拟机

     

    3)virsh destroy vm-name 关闭虚拟机

     

    4)virsh start vm-name 启动虚拟机

     

    5)virsh edit vm-name 编辑虚拟机xml文件

     

    6)virsh undefine vm-name 删除虚拟机

     

    7)virsh shutdown vm-name 停止虚拟机

     

    8)virsh reboot vm-name 重启虚拟机

     

    9)virsh autostart vm-name 虚拟机随宿主机启动

     

    在完成kvm虚拟机的安装之后,如果想要重装相同名字的虚拟机,是会有错误提示的,就算是删除了虚拟机的xml文件,也会弹出错误提示。如下红色所注

    [root@test-R410-4disk qemu]# virt-install --name=convirt --ram=512 --vcpus=2 --cpu=core2duo --pxe --os-type=linux --disk path=/data/vm/convirt.img,size=50 --network bridge=br1,model=virtio --network bridge=br0,model=virtio --graphics vnc,password=123456,port=9903 --hvm –force

    ERROR    Guest name 'convirt' is already in use.

    这点kvm和xen不同,xen的半虚拟化要想重装,只要把创建好的虚拟机配置文件删掉就可以了

    kvm如果想要重装相同名字的虚拟机,需要先关闭虚拟机

    virsh destroy vm-name 关闭虚拟机

    否则会有如下报错:

    error:Failed to undefine domain test

    error:Requested operationis not valid: cannot undefine transient domain

    在虚拟机停止的状态下执行如下命令

    [root@test-R410-4disk qemu]# virsh undefine convirt 
    Domain convirt has been undefined

    这样,虚拟机就被干掉了,同样,相应的xml配置文件也干掉了。

    然后在执行virt-install安装就不会报错了。

    转载于:https://www.cnblogs.com/cmss/p/4900947.html

    展开全文
  • virsh 修改openstack虚拟机的xml

    千次阅读 2016-07-01 17:05:42
    修改xml文件 1.virsh edit instance-00000012 修改id 和 name 2.virsh define /etc/libvirt/qemu/aaa.xml 3 virsh start aaa

    修改xml文件

    1.virsh edit instance-00000012

    修改id 和 name

    2.virsh define /etc/libvirt/qemu/aaa.xml

    3 virsh start aaa

    展开全文
  • virsh edit 修改虚拟机的配置 virsh autostart 设置虚拟机自动启动 virsh domiflist 查看虚拟机网卡信息 virsh domblklist 查看虚拟机硬盘信息 1.在真机命令终端 输入 查看需要扩容的...
  • 一:进入虚拟机查看到当前内存仅有4G,如图:命令为free -m 二:关闭当前虚拟机virsh shutdown kvm-192-168-50-212 三:对虚拟机的文件内容进行编辑virsh setmem...五:对虚拟机进行扩容virsh edit kvm-192-168-50-2...
  • KVM的基本管理 查看虚拟机 前者只列出运行状态的虚拟机,后者全部列...virsh edit vm1 退出和vim一样的。 虚拟机的启动与关闭 virsh start vm1 启动虚拟机 virsh shutdown vm1 关闭虚拟机(推荐) virsh destroy vm1
  • 常见命令:定义Domainvirsh define ubuntutest.xml编辑Domainvirsh edit ubuntutest启动Domainvirsh start ubuntutest关闭Domainvirsh shutdown ubuntutestvirsh destroy ubuntutest重启Domainvirsh reboot ...
  • KVM创建虚拟机

    2018-10-14 20:08:43
    需要的文件 kvm qcow2镜像 xml虚拟机配置文件 常用命令 # virsh define demo.xml # virsh start demo ...# virsh edit demo # virsh shutdown demo # virsh destroy demo # virsh undefine demo kvm创...
  • kvm配置(频率、smt等)

    千次阅读 2015-01-15 15:37:27
    列出vm及相关信息virsh vcpuinfo domain(): 列出vm的vcpu信息cpupower -c all frequency-info:列出所有cpu的频率cpupower frequency-set -f 3.69GHz:设置所有cpu的频率virsh edit rhel1:编辑vm配置文件(不
  • kvm扩容

    2019-08-17 11:08:19
    kvm扩容 主要针对lvm格式磁盘进行扩容操作 virsh shutdown hadoop104 ...virsh edit hadoop104 virsh start hadoop104 ssh hadoop@hadoop104 开始进行分区 切换root用户 sudo -i fdisk ...
  • kvm常用管理

    2018-11-13 22:19:10
    kvm管理常用命令安装虚拟机1.创建 guest 所需的磁盘2.virt-install 安装 guest 常用命令 ...virsh edit kvm_1 编辑虚拟机配置文件 virsh console 连接虚拟机 virsh start 开启虚拟机 ctrl + ] 退出...
  • kvm管理

    2019-10-22 19:19:37
    虚拟机的基本管理命令 查看 # virsh list # virsh list --all # virsh dumpxml name 查看虚拟机配置文件 # virsh dumpxml node4 > /etc/libvirt/qemu/node6.... # virsh edit node6 修改node6的配置文件...
  • 关闭虚拟机 virsh shutdown kvmtest ...virsh edit kvmtest加500M内存和1核 查看添置后信息 virsh dominfo kvmtest 启动虚拟机 virsh start kvmtest 转载于:https://blog.51cto.com/13323775/2086031...
  • 修改,建设kvm虚拟机

    2015-11-02 10:21:38
     修改xml文件 1.virsh edit instance-00000012 修改id 和 name 2.virsh define /etc/libvirt/qemu/aaa.xml 3 virsh start aaa
  • virsh edit CentOS7-X64-1921681017 3.查询镜像文件位置 virsh edit CentOS7-X64-1921681017 4.到对应目录进行扩容 cd /vm-home/CentOS7-X64-1921681017/ qemu-img resize CentOS7-X64-1921681017.qcow2 +20G 5....
  • shutdown guest virsh shutdown guest edit guest xml file virsh edit guest add following to xml file in <device> </device> section guest p
  • Centos 安装KVM并安装虚拟机

    万次阅读 2018-03-07 17:39:53
    需要注意的地方: !!!如果修改了虚拟机XML配置,需要停止虚拟机,然后使用以下命令重新读取XML配置!!!: ...virsh define /etc/libvirt/qemu/centos7.xml ...如果虚拟机需要使用双网卡,virsh edit新增一...
  • kvm 调整 cpu 和内存

    千次阅读 2016-02-22 20:18:27
    1.# virsh edit aming1  修改 memory(最大值),currentMemory(现有的值), vcpu 两个选项 2.# virsh destroy aming1 3.# virsh start aming1 添加一块网卡 1.# virsh domiflist aming1 ...
  • VNC远程连接KVM虚机鼠标不同步问题

    千次阅读 2015-03-02 13:50:09
    1)关闭虚机 # virsh shutdown vm1 2)编辑虚机配置文件 # virsh edit vm1 在标签内,插入一行 保存退出 3)启动虚机 # virsh start vm1
  • 1.关机 virsh shutdown rke01 virsh destroy rke01 2.转换磁盘文件格式 qemu-img convert -f raw -O qcow2 /opt/kvm/images/rke01.img /opt/kvm/images/rke...virsh edit rke01 4.开机 virsh start rke01 .
  • 物理机上virsh edit node1(虚拟机名字) 会打开node1虚拟机的xml配置信息文件 添加网卡 添加硬盘 cd /var/lib/libvirt/images/ qemu-img create -f qcow2 disk.img 20G 物理机上virsh edit node1(虚拟机名字)...
  • vncviewer鼠标不同步问题

    千次阅读 2016-08-08 09:11:00
    1 sh-4.1# virsh edit win7 2 把下面的参数: 3 <input type='mouse' bus='ps2'/> 4 改成: 5 <input type='tablet' bus='usb'/> sh-4.1# virsh destroy win7 sh-4.1# virsh start win7 鼠标...
  • 实验环境: win10系统 虚拟机ubuntu kvm平台 ...输入virsh edit 虚拟机名称 注意:如过出现选择编辑器,一般选择vi或vim4.找到配置文件中的 进入编辑模式在其后面添加: 欢迎使用Markd...
  • virt-resize扩展 #关闭kvm虚拟机 virsh shutdown testkvm2 #安装工具 ...virsh edit testkvm2 #查看磁盘分区信息 virt-filesystems --partitions --long -a /var/lib/libvirt/images/testkvm2.q...
  • 8、kvm虚拟机添加硬盘

    2019-10-01 02:25:51
    kvm虚拟机添加硬盘qemu-img创建一块新的硬盘 qemu-img create -f qcow2 /kvm-data/kvm/jumperhost_disk1.qcow2 50G 关闭虚拟机 ...virsh shutdown jumphost_hadoop ...virsh edit jumphost_hadoop <...
  • 创建快照

    2017-05-29 11:12:00
    创建快照 virsh snapshot-create aming3 查看快照: qemu-img info /data/kvm/aming1.img 查看到虚拟机信息 ...qemu-img info /data/kvm/...virsh edit aming3 编译aming3虚拟机配置文件 格式转换 qemu-im...

空空如也

空空如也

1 2 3 4 5 ... 8
收藏数 148
精华内容 59
关键字:

editvirsh