Virsh hais kom ua - Cov Network rau Computer rau SMEs

General index ntawm lub series: Computer Networks rau cov SMEs: Taw qhia

Nyob zoo cov phooj ywg!

Yog tias koj tau ua nrog peb nyeem cov ntawv luam tawm txog tam sim no, koj yuav pom tau tias peb tab tom taug txoj kev ncaj ncees, txhawm rau kom tau txais chaw nres tsheb ua haujlwm lossis chaw kuaj mob nyob hauv tsev, nrog kev txhawb nqa tsim nyog los ua lub tshuab ua haujlwm lossis lub tshuab pabcuam uas peb yuav ua rau cov kev pabcuam tsawg kawg nkaus rau a LAN - Local Area Network Kev lag luam.

Peb xav tias koj nyeem:

Cov kev txuas yav dhau los, txuas mus rau sab nraud txuas rau cov nplooj ntawv sib txawv thiab chaw uas muaj cov ntaub ntawv nplua nuj, muaj nyob hauv txhua kab lus, muab nrog lub hom phiaj uas koj ua tiav kev paub txog cov ncauj lus sib txawv.

Cov ncej no yog lub laj thawj txuas ntxiv ntawm txoj kev xaiv. Koj txoj kev nyeem thiab kawm yuav ua rau koj muaj ib lub tswv yim ntawm lub ntiaj teb loj heev uas yog Virtualization hla Qemu-KVM thiab nws lub khw muag ntawv tseem ceeb libvirt.

Virsh - Lub ntsiab ntawm cov neeg siv interface rau kev tswj cov Domains Virtual

Peb paub los ntawm cov ntawv nyeem dhau los hais tias Virtualization hauv Linux txhais tau tias muaj peev xwm los khiav ntau qhov kev sib txawv ntawm cov kab ke ua haujlwm sib txawv, ntawm tib lub kho vajtse. Poj Ntsuam yog cov cuab yeej sau nyob hauv cov lus C, uas tso cai rau peb cuam tshuam nrog lub peev xwm virtualization ntawm cov khoos phis tawm tshiab ntawm Linux, thiab tseem nrog lwm cov kev ua haujlwm.

Peb tuaj yeem siv cov program virsh ua los tsim, ncua, kaw, sau npe, thiab ntau yam haujlwm ntxiv rau ntawm virtual domains thiab hypervisors uas tuav lawv. Lub npe ntawm cov kev pab cuam qhia tias nws luv rau «Virkev tsim tawm Shell»Los yog Txheej Txheem Virtualization Commandor.

Ib txoj hauv kev uas nquag peb tuaj yeem thov nws tau:

virsh [XAIV] .... [Sib cav] ...
  • hais kom ua: tuaj yeem yog ib tus 215 cov lus txib teev tom qab
  • sau: lub npe ntawm tus sau lossis lub tshuab virtual, lossis cov lej cim tus lej ID ntawm tus sau, lossis UUID ntawm tus sau.
  • kev sib cav: cov kev xaiv tshwj xeeb rau txhua lo lus txib

Muaj ntau qhov kev zam rau cov kev cai yav dhau los, xws li hauv rooj plaub uas cov lus txib ua rau txhua tus tswv, lub tshuab, lossis ncaj qha rau Xen Hypervisor - Xen Hypervisor tauCov. Cov kev zam tshwj xeeb raug tshem tawm rau txhua lo lus txib.

Ceeb toom: Txawm hais tias nws siv tau los txheeb xyuas lub tshuab virtual los ntawm nws tus lej ID, tus lej no yuav ib txwm txhais raws li tus lej sau npe, thiab tsis yog nws lub npe.

lub Virsh txib XAIV Yog:

  • -c, Txuas URI: Txuas rau URI «Cov Cim Khoom Siv Uas Tsis Yog Tus Kheej"- - Cov Cim Khoom Siv Uas Tsis Yog Tus Kheej, hloov ntawm URI qhov tsis yog uas yog hais tias ntawm lub zos hypervisor.
  • -d, –debug QIB: Pab qhib debugging lus - debug, mus txog tus zauv integer LEVEL, tus lej sib cav uas tuaj yeem coj tus nqi ntawm 0 thiab 4. Tus lej 4 yog tus nqi pheej hmoo.
  • -e, stringescape hlua: Teeb tsa tus cwj pwm sib pauv hloov ua ntu zus rau thaum peb nias lub «yuam sijEsc«. Lub neej ntawd yog ^]Cov. Cov cim uas tau tso cai yog: tus ntawv muaj suab npe, @, [,], \, ^, _. Peb xav kom tsis txhob hloov lub neej ntawd tus ua ntu zus.
  • -h, -help: Tsis lees paub lwm yam kev sib cav thiab coj tus cwj pwm zoo li qhov kev txiav txim raug tua pab.
  • -k, eepkeepalive-interval INTERVAL: Teeb lub sijhawm nyob hauv vib nas this los xa cov ntawv hom ceev, txhawm rau xyuas yog tias qhov sib txuas nrog tus neeg rau zaub mov tseem muaj sia nyob. Yog hais tias tus nqi ntawm TEB CHAWS yog teeb tsa 0, ces qhov kev kuaj xyuas no yog xiam oob khab.
  • -K, –keepalive-suav COUNT: Tsa tus naj npawb ntawm cov sij hawm ib tsab xov tuaj yeem xa ceev yam tsis tau txais daim ntawv teb los ntawm tus neeg rau zaub mov, thiab tsis muaj khij rau kev sib txuas yog kev tuag. Nws yuav tsis muaj qhov cuam tshuam rau qhov kev xaiv no, yog tias INTERVAL tus nqi ntawm cov kev xaiv dhau los tau teev rau 0.
  • -l, -log FILE: Qhia rau cov sijhawm ua haujlwm cov zis tawm rau cov ntaub ntawv THAWJ.
  • -q, lus: Zam kev qhia ntxiv nyob rau hauv cov lus. Hom uas ntsiag to.
  • -r, onreadonly: Qhov pib txuas tau tsim hauv Nyeem xwbCov. Tib yam li thaum peb siv cov kev xaiv .Quaj hauv kev hais kom ua txuas.
  • -t, -timing: Qhia lub sijhawm siv ntawm txhua qhov kev hais kom ua.
  • -v, –version = luv: Tsis quav ntsej txog lwm yam kev sib cav, thiab tsuas yog ua lub tsev qiv ntawv version xwb libvirt program los ntawm virsh ua.
  • -V, –version = ntev: Tsis quav ntsej txog lwm yam kev sib cav thiab qhia lub tsev qiv ntawv daim ntawv libvirt program los ntawm virsh ua thiab ntxiv mus, cov neeg saib xyuas sib txawv, tswj hwm - cov neeg tsav tsheb, network hom, thiab lwm yam uas cov ntaub ntawv muab tso ua ke txhawb.

Sau ntawv:

  • Feem ntau cov haujlwm ua haujlwm virsh ua, xav tias phau ntawv muag ntawv nyeem libvirt muaj peev xwm txuas rau kev pabcuam libvirtd hauv kev nqis tes.
  • Feem ntau cov lus txib kom lawv yuav tsum tau khiav nrog cov cai ntiag tug ntawm cov neeg siv hauv paus vim muaj cov xov xwm sib txuas lus nws siv rau kev sib txuas lus nrog hypervisor. Yog tias khiav nrog txoj cai ntawm tus neeg siv ib txwm, nws yuav rov qab ua qhov yuam kev.
  • Feem ntau ntawm cov lus txib ua synchronously. Cov kev zam uas tsim nyog muaj yog shutdown, setvcpus ua y teebCov. Hauv cov xwm txheej ntawd, qhov tseeb uas virsh ua rov tus sai li sai tau hais kom ua, nws kuj tsis txhais tau tias qhov kev ua tiav tiav. Nws yuav tsum raug kuaj xyuas ib ntus kom paub tias cov haujlwm tau ua tiav ntawm Cov Qhua - qhua.

Yog xav paub ntxiv txog cov ntsiab lus, saib tus txiv neej virsh.

Cov lus qhia txog yuav ua li cas kom ze rau kev kawm virsh

Kom nws yooj yim dua kom tau txais kev pab rau siv tus ntau dua 200 lo lus txib, virsh ua pawg lawv los ntawm cov ntsiab lus - sib pab lo lus tseem ceeb, uas yog:

  • sau
  • saib
  • party
  • interface
  • lim
  • network
  • nodev
  • tsis pub leejtwg paub
  • snapshot
  • pas dej ua ke
  • ntim
  • virsh ua
buzz @ sysadmin: ~ $ virsh pab sau
 Kev Tswj Twm (pab lo lus tseem ceeb 'sau'): cov khoom siv xa ntawv txuas los ntawm cov ntaub ntawv XML txuas-disk txuas disk ntaus txuas-sib txuas cov network sib txuas autostart autostart ib lub npe blkdeviotune Teeb los yog nug cov cuab yeej thaiv I / O kev hloov.
 blkiotune Tau los yog teeb tsa blkio para blockcommit Pib qhov kev ua haujlwm block.
 blockcopy Pib block daim lag luam.
 blockjob Tswj kev siv cov haujlwm ua haujlwm blockpull Populate ib daim disk los ntawm nws cov duab rov qab.
 blockresize Resize block khoom siv ntawm cov sau.
 hloov-media Hloov xov xwm ntawm CD lossis floppy drive console txuas rau tus qhua console cpu-lub hauv paus laij cov hauv paus CPU CPU cpu-piv tus tswv CPU nrog CPU tau piav qhia los ntawm XML file cpu-stats qhia sau cpu txheeb cais tsim tsim sau los ntawm XML cov ntsiab lus txhais kom meej (tab sis tsis txhob pib) ib qhov sau los ntawm cov ntaub ntawv XML desc qhia lossis teeb sau cov lus piav qhia lossis cov npe rhuav tshem (nres) ib qho kev ua kom raug tshem tawm-ntaus cov cuab yeej tawm ntawm cov ntaub ntawv XML tshem cov disk tawm cov cuab yeej disk tawm ntawm cov cuab yeej network interface domdisplay sau cov zaub sib txuas URI domfsfreeze Khov sau ua ke cov kab ke.
 domfsthaw Thaw sau's mounted filesystems.
 domfstrim Caw fstrim ntawm tus sau ua ke cov filesystems.


buzz @ sysadmin: ~ $ virsh pab soj
 Kev Ntsuas Tus Tswv (pab lo lus tseem ceeb 'saib xyuas'): domblkerror Qhia yuam kev ntawm cov khoom siv thaiv domblkinfo sau qhov cuab yeej loj cov ntaub ntawv domblklist sau tag nrho cov ntawv sau npe domblkstat tau ntaus block stats rau ib qho kev tswj hwm tus tswj hwm lub xeev domif-getlink tau txuas lub xeev ntawm lub virtual interface domiflist teev txhua hom sau virtual interfaces domifstat tau network interface stats rau cov ntaub ntawv sau cov ntaub ntawv dommemstat tau txais kev txheeb xyuas cov cim tseg rau ib qho kev qhia domstate domain xeev domstats tau kev txheeb cais txog ib lossis ntau thawj dom sijhawm dom sijhawm sau npe domains

buzz @ sysadmin: ~ $ virsh pab soj
 Kev Ntsuas Tus Tswv (pab lo lus tseem ceeb 'saib xyuas'): domblkerror Qhia yuam kev ntawm cov khoom siv thaiv domblkinfo sau qhov cuab yeej loj cov ntaub ntawv domblklist sau tag nrho cov ntawv sau npe domblkstat tau ntaus block stats rau ib qho kev tswj hwm tus tswj hwm lub xeev domif-getlink tau txuas lub xeev ntawm lub virtual interface domiflist teev txhua hom sau virtual interfaces domifstat tau network interface stats rau cov ntaub ntawv sau cov ntaub ntawv dommemstat tau txais kev txheeb xyuas cov cim tseg rau ib qho kev qhia domstate domain xeev domstats tau kev txheeb cais txog ib lossis ntau thawj dom sijhawm dom sijhawm sau npe domains

buzz @ sysadmin: ~ $ virsh pab tswv
 Tus tswv tsev thiab Hypervisor (pab lo lus tseem ceeb 'host'): allocpages Manipulate nplooj pas dej loj loj muaj peev xwm ua qauv cpu-qauv CPU qauv domcaprability sau muaj peev xwm ua kom muaj tso tseg NUMA dawb nco freepages NUMA dawb nplooj hostname luam tawm hypervisor hostname maxvcpus kev sib txuas vcpu siab tshaj plaws-nco-qhib tau lossis teeb node cim xeeb tsis ntawm nodecpumap node cpu daim ntawv qhia nodecpustats Prints cpu stats ntawm node. nodeinfo ntawm cov ncauj lus nodememstats Luam tawm cov ntaub ntawv nco txog cov ntawm. nodesuspend muab ncua tseg rau tus tswv tsev ua haujlwm rau ib lub sijhawm ntev sysinfo luam tawm hypervisor sysinfo uri luam tawm hypervisor canonical URI version qhia version

buzz @ sysadmin: ~ $ virsh pab interface
 Kev sib cuam tshuam (pab lo lus tseem ceeb 'interface'): iface-pib tsim ib qho kev cuam tshuam ntawm kev teeb tsa lub ntsej muag tam sim no, uas tuaj yeem tom qab ua tiav (iface-rollback) iface-choj tsim tus choj txuas thiab muab cov khoom siv hauv network uas twb muaj lawm rau nws iface-ua phem rau cov kev hloov tau ua txij li iface-pib thiab pub dawb rov qab taw tes iface-txhais tau txhais (tab sis tsis txhob pib) lub cev host interface los ntawm XML ntaub ntawv iface-txov rhuav tshem lub cev tswv interface (lov tes taw nws / "if- down ") iface-dumpxml interface cov ntaub ntawv hauv XML iface-edit hloov XML configuration rau lub cev host interface iface-daim ntawv teev npe lub cev lub cev sib cuam tshuam iface-mac hloov lub npe interface rau interface MAC chaw nyob iface-lub npe hloov qhov interface MAC chaw nyob rau lub npe interface iface-rollback rollback mus rau yav dhau los tau txais kev teeb tsa tsim los ntawm iface-pib iface-pib pib lub cev lub cev interface (ua kom nws / "yog-up") iface-unbridge tsis pom tus choj txuas tom qab tshem tawm nws cov qhev cov cuab yeej iface-undefine undefine a phy sical party interface (tshem tawm nws los ntawm kev teeb tsa)

buzz @ sysadmin: ~ $ virsh pab lim
 Network lim (pab lo lus tseem ceeb 'lim'): nwfilter-txhais kom meej los yog hloov kho lub network lim los ntawm XML cov ntaub ntawv nwfilter-dumpxml network lim cov ntaub ntawv hauv XML nwfilter-kho kom raug kho XML teeb tsa rau lub network lim nwfilter-teev npe network lim nwfilter-undefine undefine lub taub lim network

buzz @ sysadmin: ~ $ virsh pab network
 Networking (pab lo lus tseem ceeb 'network'): net-autostart autostart network net-tsim tsim lub network los ntawm XML cov ntaub ntawv net-txhais tau txhais (tab sis tsis txhob pib) lub network los ntawm XML ntaub ntawv net-rhuav tshem (nres) a network net-dhcp-daim ntawv xauj tsev sau cov lus qhia cov ntaub ntawv rau network net-dumpxml network cov ntaub ntawv hauv XML net-kho kom raug kho XML teeb tsa rau lub network net-event Network Txheej xwm net-info network cov ntaub ntawv net-teev npe network-npe hloov network UUID rau network lub npe net-pib pib lub (yav tas los txhais) lub network tsis ua hauj lwm net-undefine undefine lub qub network hloov kho qhov hloov tshiab ntawm ib qho ntawm lub network tshiab teeb tsa net-uuid hloov lub npe network rau network UUID

buzz @ sysadmin: ~ $ virsh pab nodedev
 Ntaus Node (pab lo lus tseem ceeb 'nodedev'): nodeev-tsim tsim cov cuab yeej txhais los ntawm cov ntawv XML ntawm cov nodeev-rhuav tshem (nres) ib qho khoom siv ntawm nodeev-detach det node device los ntawm nws lub driver driver nodeev-dumpxml node ntaus cov lus hauv XML nodedev-teev enumerate li ntawm no host nodedev-reattach rov ntaus cov khoom siv rau nws lub cuab yeej tsav tsheb nodedev-pib dua pib ntawm cov cuab yeej

buzz @ sysadmin: ~ $ virsh pab zais cia
 Cov lus zais (pab cov ntsiab lus 'zais cia'): cov lus zais zais lossis hloov kho tsis pub lwm tus paub ntawm cov ntaub ntawv XML zais cia-dumpxml cov yam ntxwv zais cia hauv XML zais cia-tau-tus nqi Tso zis zais cia cov txiaj ntsig zais cia-sau cov lus zais zais-teev-nqi teeb tsa tsis pub leej twg paub nqi zais cia-undefine undefine yam zais cia

buzz @ sysadmin: ~ $ virsh pab thaij duab
 Snapshot (pab lo lus tseem ceeb 'snapshot'): snapshot-tsim Tsim ib qho snapshot los ntawm XML snapshot-tsim-ua Tsim ib qho snapshot los ntawm cov txheej ntawm kev sib cav snapshot-tam sim no Tau txais lossis teeb cov snapshot snapshot-delete Rho tawm ib tug sau snapshot-dumpxml Dump XML rau ib qho chaw tuav tseg - kho kom raug hloov XML rau cov lus qhia ceev tseg-cov lus qhia cov ntaub ntawv snapshot-daim ntawv teev cov npe kev pabcuam rau ib tus tswv cuab snapshot-niam txiv tau txais lub npe ntawm leej niam leej txiv ntawm ib qho snapshot-revert Rov qab sau lub npe mus rau snapshot
buzz @ sysadmin: ~ $ virsh pab pas dej
 Cia pas dej (pab lo lus 'pas dej'): nrhiav-pas dej-pas dej-nrhiav-raws li nrhiav tej chaw khaws pas dej nrhiav-nrhiav-pas dej-nrhiav pom tej chaw khaws pas dej ua ke pas dej-autostart autostart pas dej ua ke-tsim tsim pas dej- tsim-ua tsim pas dej los ntawm cov teeb ntawm cov sib cav pas dej-tsim tsim pas dej los ntawm XML cov ntaub ntawv pas dej-txhais-raws li txhais cov pas dej ntawm cov txheej ntawm cav sib cav pas dej txhais-txhais tau (tab sis tsis txhob pib) pas dej los ntawm XML cov ntaub ntawv pas dej ua ke-rho tawm cov pas dej pas dej ua ke-rhuav tshem (nres) cov pas dej ua ke-dumpxml pas dej ua ke cov ntaub ntawv hauv XML pas dej ua ke-kho kom raug kho XML teeb tsa rau lub pas dej ua ke pas dej-cov ntaub ntawv khaws cov ntaub ntawv pas dej ua ke cov npe sau pas dej ua ke-npe hloov pas dej UUID rau cov pas dej ua ke lub pas dej-refresh refresh pas dej pas dej-pib pib lub (yav tas los txhais) pas dej ua ke pas dej ua ke-undefine undefine ib lub pas dej ua ke hauv pas dej ua ke-uuid hloov lub npe pas dej ua ke UUID

buzz @ sysadmin: ~ $ virsh pab ntim
 Ntim Ntim (pab lo lus tseem ceeb 'ntim'): vol-clone clone ib lub ntim. vol-tsim-ua tsim ib lub ntim los ntawm ib pawg ntawm kev sib cav vol-tsim tsim vol los ntawm XML cov ntaub ntawv vol-tsim-los ntawm tsim vol, siv lwm ntim raws li cov tswv yim vol-delete rho tawm vol-download rub tawm ntim cov ntsiab lus rau cov ntawv ntim vol-dumpxml vol cov ntaub ntawv hauv XML vol-info cia cov lus qhia vol-key rov cov ntim tseem ceeb rau cov ntim lub npe lossis kab vol-daim ntawv teev vols vol-lub npe rov ntim cov npe rau lub ntim muab qhov tseem ceeb lossis kab vol- kev rov ntim ntim txoj kev rau lub ntim muab npe lossis qhov tseem ceeb vol-pas dej rov qab los khaws cia pas dej rau lub ntim muab qhov tseem ceeb lossis txoj kev taug-resize resize qhov chaw ntim vol-upload xa cov ntawv ntim rau lub ntim vol-so so ib vol

buzz @ sysadmin: ~ $ virsh pab virsh
 Virsh nws tus kheej (pab cov lus tseem ceeb 'virsh'): cd hloov cov chaw tam sim no txuas (rov) txuas rau hypervisor ncha ncha cov lus tawm tawm ntawm qhov sib cuam tshuam no davhlau ya nyob twg pab luam tawm pab pwd luam tawm cov chaw tam sim no tawm haujlwm tawm ntawm qhov kev sib tham no.

Yog xav tau kev pab tshwj xeeb rau ib qho ntawm cov lus txib teev cia

Peb yuav tsum ua virsh pabCov. Piv txwv:

buzz @ sysadmin: ~ $ virsh pab npe
  Cov npe NPE - teev cov npe SYNOPSIS teev [- nquag] [- txhua tus] [- tus neeg tiv thaiv] [--tawm rov qab] [--with-snapshot] [--without-snapshot] [--state-running] [- -state-paused] [--state-shutoff] [--state-other] [--autostart] [--no-autostart] [- tswj-tswj-txuag] [- tswj-tswj-txuag] --uuid] [- npe] [- rooj noj mov] [- tswj-txuag] [--title] DESCRIPTION Rov qab los cov npe uas yog. XAIV - cov npe tsis tseem ceeb lub npe tsis tseem ceeb - tag nrho cov npe tsis nquag & nquag sau npe - ncua npe npe hloov chaw --persistent sau cov npe tseem pheej - nrog cov npe tuav tag nrho cov npe uas tsis muaj npe - tuav tseg - sau npe cov npe tsis muaj snapshot - nyob rau -qhia cov npe tseem ceeb nyob rau hauv xeev khiav - rov qab teev cov npe sau nyob hauv xeev tau ncua tseg - rov kaw cov npe nyob rau hauv xeev shutoff - chaw nyob lwm lub npe nyob rau lwm lub xeev - chaw teev cov npe nrog autostart enabled --no-autostart sau cov npe nrog autostart xiam oob khab - nrog-tswj-txuag cov npe sau nrog cov tswj tau txuag lub xeev - nrog-tswj-txuag-tus sau npe tsis muaj tswj hwm --uuid teev uuid tsuas - npe sau npe npe tsuas - តារាង teev npe (neej ntawd) ) - tswj tseg-tseg lub cim tsis ua haujlwm nrog kev tswj tuav tseg hauv lub xeev - cim qhia qhia lub npe

buzz @ sysadmin: ~ $ virsh pab kaw
  LUB NPE kaw - lub siab kaw ib lub npe SYNOPSIS kaw [--mode ] LAWV LAWV Siv dej kaw hauv lub hom phiaj. Kev Xaiv [--domain] cov npe sau, id lossis uuid --mode hom kev kaw: acpi | tus neeg sawv cev | initctl | teeb liab | paravirt

Piv txwv ntawm kev siv cov virsh hais kom ua

Virsh version

buzz @ sysadmin: ~ $ virsh -v
1.2.9

buzz @ sysadmin: ~ $ virsh -V
Virsh kab ntaus cov cuab yeej ntawm libvirt 1.2.9 Mus saib lub vev xaib ntawm http://libvirt.org/ Muab tso nrog kev pab rau: Cov neeg saib xyuas: QEMU / KVM LXC UML Xen LibXL OpenVZ VMWare VirtualBox Test Networking: Chaw Sib Tsoo Network Bridging Interface netcf Nwfilter VirtualPort Cia: Dir Disk Filesystem SCSI Kev Sib Tw Ntau iSCSI LVM RBD Cov Hnyuv Tswm Sib Tsoo: Daemon Nodedev AppArmor SELinux Cov Lus Cog Tseg Debug DTrace Readline Modular

Nkag mus rau lub virsh console

buzz @ sysadmin: ~ $ sudo virsh
[sudo] lo lus zais rau buzz: Zoo siab txais tos rau virsh, virtualization sib tham sib lub davhlau ya nyob twg. Hom: 'pab' rau kev pab nrog cov lus txib 'tawm haujlwm' kom luam yeeb

Sau txhua tus puav

virsh # teev npe --all
 Id Npe Xeev ----------------------------------------------- ----- - dns kaw - miweb kaw - sysadmin-centos kaw

Pib dns sau

virsh # pib dns
Sau cov dns pib

virsh # domdisplay dns ua
txuj lom: //127.0.0.1: 5900

Sau cov ntaub ntawv tagnrho

virsh # pas dej ua ke-cov npe
 Npe Xeev Autostart ------------------------------------------- vim tsis muaj vms -images nquag muaj       

virsh # pas dej ua ke-info pib
Npe: default UUID: 3d158e62-6237-464f-9d8f-07ac98be56dc Lub Xeev: khiav Cov Ntsej Muag: muaj Autostart: tsis muaj peev xwm: 14.64 GiB Hloov: 5.18 GiB Muaj: 9.46 GiB

virsh # pas dej ua ke-info vms-cov duab
Lub npe: vms-cov duab UUID: 72e1b63d-3d90-4f02-bfde-197fd00f3b94 Lub Xeev: kev khiav tawm mus tas li: muaj Autostart: muaj Peev Xwm: 916.77 GiB Hloov: 464.22 GiB Muaj: 452.55 GiB

Sau cov duab hauv ntim

virsh # vol-teev lus vms-cov duab
 Lub Npe Kab ------------------------------------------------ ------------------------------ CentOS-7-x86_64-Txhua-1511.iso / tera / vms / CentOS-7- x86_64-Txhua-1511.iso dns.qcow2 /tera/vms/dns.qcow2 miweb.qcow2 /tera/vms/miweb.qcow2 openSUSE-13.2-DVD-x86_64.iso /tera/vms/openSUSE-13.2-DVD-x86_64 .iso sysadmin-centos.qcow2 /tera/vms/sysadmin-centos.qcow2 sysadmin.qcow2 /tera/vms/sysadmin.qcow2                

virsh # vol-info dns.qcow2 --pool vms-cov duab
Lub Npe: dns.qcow2 Hom: cov muaj peev xwm: 10.00 GiB Txaws Chaw: 1.56 GiB

Tsim cov duab disk ntawm lub ntim

virsh # vol-tsim-ua --pool vms-cov duab - npe dns2.raw - ntaub muaj peev xwm 20G
Vol dns2.raw tsim

virsh # vol-teev lus vms-cov duab
 Lub Npe Kab ------------------------------------------------ ------------------------------ CentOS-7-x86_64-Txhua-1511.iso / tera / vms / CentOS-7- x86_64-Txhua-1511.iso dns.qcow2 /tera/vms/dns.qcow2                     
 dns2.raw /tera/vms/dns2.raw                    
 miweb.qcow2 /tera/vms/miweb.qcow2 openSUSE-13.2-DVD-x86_64.iso /tera/vms/openSUSE-13.2-DVD-x86_64.iso sysadmin-centos.qcow2 /tera/vms/sysadmin-centos.qcow2 sysadmin .qcow2 /tera/vms/sysadmin.qcow2

Koom nrog cov duab tshiab tsim rau lub sijhawm sau

virsh # domstate dns
khiav

virsh # dominfo dns
Tus ID: 4 Lub Npe: dns UUID: 9e69ebc6-213e-42f7-99bf-83b333e93958 OS Hom: hvm Xeev: khiav CPU (s): 1 CPU sijhawm: 25.2s Max nco: 262144 KiB Siv cim xeeb: 262144 KiB Lub cev tsis muaj tseeb: muaj Autostart: kev tswj hwm qhov kev tswj tseg tseg: tsis muaj tus qauv Security: tsis muaj Security DOI: 0

virsh # domblklist dns
Hom Phiaj Source ------------------------------------------------ vda /tera/vms/dns.qcow2 hda -

virsh # txuas-disk dns /tera/vms/dns2.raw vdb-txuas ntxiv --live
Disk txuas tau zoo

virsh # domblklist dns
Hom Phiaj Source ------------------------------------------------ vda /tera/vms/dns.qcow2 vdb /tera/vms/dns2.raw hda -

virsh # domblkstat dns vda
vda rd_req 5438 vda rd_bytes 67512320 vda wr_req 405 vda wr_bytes 2854912 vda flush_operations 14 vda rd_total_times 20533958076 vda wr_total_times 423498369 vda flush_total_times 232141607

virsh # domblkstat dns vdb
vdb rd_req 117 vdb rd_bytes 479232 vdb wr_req 0 vdb wr_bytes 0 vdb fl__tswg 0 vdb rd_total_times 28976780 vdb wr_total_times 0 vdb fl__total_times 0

Peb muab faib, tawm tswv yim thiab mount daim disk tshiab

virsh # txiav luam yeeb
buzz @ sysadmin: ~ $ ssh buzz@192.168.10.5
buzz@192.168.10.5 tus password:

buzz @ dns: ~ $ sudo fdisk / dev / vdb
[sudo] lo lus zais rau buzz: Txais tos kom fdisk (siv-linux 2.25.2). Hloov pauv yuav nyob hauv qhov kev nco tsuas yog, txog thaum koj txiav txim siab sau lawv. Ua tib zoo ua ntej siv cov lus txib sau. Kev hais kom ua (m rau kev pab): n muab faib hom p thawj (0 thawj, 0 txuas ntxiv, 4 pub dawb) e ncua (thawv rau lub laj thawj ntu) Xaiv (neej ntawd p): p Muab faib nab npawb (1-4, vim 1): Thawj ntu (2048-41949951, default 2048): Cov haujlwm kawg, + cov haujlwm lossis + loj {K, M, G, T, P} (2048-41949951, vim 41949951): Tsim qhov faib tshiab 1 ntawm hom 'Linux' thiab ntawm qhov loj me 20 GiB. Hais kom ua (m tau kev pab): p Disk / dev / vdb: 20 GiB, 21478375424 bytes, 41949952 Cov koog: cov haujlwm ntawm 1 * 512 = 512 bytes Cov loj me (qhov tsim nyog / lub cev): 512 bytes / 512 bytes I / O loj ( yam tsawg kawg nkaus / qib siab): 512 bytes / 512 bytes Disklabel yam: dos Disk cim: 0x12e1497e Ntaus khau pob kom kawg Cov nplai loj Id hom / dev / vdb1 2048 41943039 41940992 20G 83 Linux Command (m kev pab): w Lub rooj faib tau raug hloov Cov. Hu rau ioctl () kom rov nyeem cov rooj faib khoom. Syncing disks.

buzz @ dns: ~ $ sudo mkfs.ext4 / dev / vdb1

buzz @ dns: ~ $ sudo fdisk -l

Disk / dev / vda: 10 GiB, 10737418240 bytes, 20971520 cov koog: cov chaw ntawm 1 * 512 = 512 bytes Sector loj (muaj kuab / lub cev): 512 bytes / 512 bytes I / O loj (yam tsawg kawg / qib siab): 512 bytes / 512 bytes Disklabel hom: ob hom Disk lub cim: 0xb1e40216 Ntaus Khoom Siv Pib Ua Ntej Sectors Loj Id Hom / dev / vda1 * 2048 20013055 20011008 9.6G 83 Linux / dev / vda2 20015102 20969471 954370 466M 5 Txuas Ntxiv / dev / vda5 * 20015104 20969471 954368 466G 82 Linux / dev / vda20 21478375424 41949952 1 512M 512 Txuas Ntxiv / dev / vda512 512 512 512 sib pauv / Solaris Disk / dev / vdb: 0 GiB, 12 bytes, 1497 cov koog: cov chaw ntawm 1 * 2048 = 41943039 bytes Cov loj me (cov zajlus kom / lub cev): 41940992 bytes / 20 bytes I / O loj (yam tsawg kawg / qib siab): 83 bytes / XNUMX bytes Disklabel type: dos Disk identifier: XNUMXxXNUMXeXNUMXe Ntaus Boot Pib Thaum Kawg Cov Nplai Loj Id Hom / dev / vdcXNUMX XNUMX XNUMX XNUMX XNUMXG XNUMX Linux

buzz @ dns: ~ $ sudo mkdir / khw
buzz @ dns: ~ $ sudo nano / thiab / fstab 
/ dev / vdb1 / khw ext4 xim 0 0

buzz @ dns: ~ $ sudo mount -a
buzz @ dns: ~ $ ls -l / tag nrho lub khw 16 drwx ------ 2 lub hauv paus 16384 Dec 10 17:34 poob + pom

Peb rov qab mus rau lub virsh console

buzz @ sysadmin: ~ $ sudo virsh Zoo siab txais tos rau virsh, lub virtualization sib tham sib davhlau ya nyob twg. Hom: 'pab' rau kev pab nrog cov lus txib 'tawm haujlwm' kom luam yeeb

virsh # 

Peb muab tua

virsh # domstate dns
khiav

virsh # kaw dns
No lub dns yog tau raug kaw

Abstract

Kom deb li deb peb tau caij nkoj raws tus ntug dej Hiav Txwv Virsh. Xav paub ntau ntxiv, coj cov lus txib tus txiv neej virshCov. Txawm li cas los xij, peb tawm hauv cov ntawv sau ntawm cov ntawv yoojyim virsh-pab.txt tias peb ua kom lub neej yooj yim dua rau cov uas koom tes nrog Super Command no rau kev tswj hwm thiab kev tswj hwm ntawm hypervisors thiab lawv lub Machine Virtual.

Peb pom zoo kom kuaj cov lus txib sab nraum qhov chaw tsim khoom.


Cov ntsiab lus ntawm tsab xov xwm ua raws li peb cov ntsiab cai ntawm kev tswj hwm kev ncaj nceesCov. Tshaj tawm ib qho yuam kev nyem no.

7 lus, tawm koj li

Tso koj saib

Koj email chaw nyob yuav tsis tsum luam tawm. Yuav tsum tau teb cov cim nrog *

*

*

  1. Lub luag haujlwm rau cov ntaub ntawv: Miguel Ángel Gatón
  2. Lub hom phiaj ntawm cov ntaub ntawv: Tswj SPAM, kev tswj xyuas tawm tswv yim.
  3. Sau raws cai: Koj kev tso cai
  4. Kev sib txuas lus ntawm cov ntaub ntawv: Cov ntaub ntawv yuav tsis raug xa mus rau lwm tus neeg thib peb tsuas yog los ntawm kev txiav txim siab raug cai.
  5. Cov ntaub ntawv khaws cia: Cov Ntaub Ntawv khaws tseg los ntawm Occentus Networks (EU)
  6. Txoj Cai: Txhua lub sijhawm koj tuaj yeem txwv, rov qab thiab tshem tawm koj cov ntaub ntawv.

  1.   dhunter said

    Kuv xav siv Virsh rau ntau yam ntxiv, tam sim no tsuas yog qhov pib, pib, nres, txhua yam ntxiv Kuv siv tus neeg saib xyuas kev coj zoo, Kuv xav tias koj tuaj yeem muaj N servers ua haujlwm libvirt thiab tswj lawv ntawm koj txoj haujlwm nrog kev tswj hwm kev tsim txiaj.

  2.   federico said

    Nyob zoo tus phooj ywg Dhunter !!! Kuv twb yuav txog tom haujlwm. Rub tawm cov ntaub ntawv virsh-pab.txt uas yuav pab koj ntau. Kuv tau ua los ntawm virsh console nws tus kheej, thiab tom qab ntawd kuv ua ib tsab ntawv sau rau nws. Kuv xav tias, raug teeb tsa los ntawm cov ntsiab lus ntawm kev pab, nws yog ntau haus. Hauv lwm tsab xov xwm Kuv kov rau ntau lub ncauj lus ntawm cov lus txib no.

  3.   Carburus Zodiac said

    Kev txais tos Federico. Kuv tau ua raws li koj cov lus ntxim nyiam ntawm SMEs. Nws yog txiav txim siab yooj yim los siv lub console kom nrawm thiab ua haujlwm tau. Lawv kuj siv nyiaj tsawg dua. Kuv tos rau koj cov khoom xa tuaj tom ntej.

  4.   kev 88 said

    Zoo Federico, koj twb tau ntsib kuv. Ua tsaug rau qhov khoom plig uas koj tau muab rau peb. Zoo heev ncej, Kuv tau tos cov lus no ntawm virsh. Ua tsaug koj cov kwv tij, peb txhua tus yuav paub siv nws kom raug.

  5.   phico said

    Koj nyob zoo, Crespo88. Rau qhov peb nyob hauv DesdeLinux.

  6.   Ismael Alvarez Wong said

    nyob zoo, Kuv xav tsis thoob nrog cov peev txheej ntawm cov lus txib virsh, Kuv nrhiav tsis tau cov lus los piav txog qhov kuv xav txog nws, tsis ntseeg li, thiab qhov koj nthuav tawm hauv kev tshaj tawm tsuas yog siv tshuaj txhuam, siv koj cov lus «Tam sim no peb muaj sailed raws ntug dej hiav txwv Virsh. "
    heev pab tau thaum koj piav qhia yuav tshawb tshawb virsh pab siv koj cov ntsiab lus li cas.
    zoo tshaj plaws tsim piv txwv ntawm Tsim daim duab disk ntawm lub ntim thiab Koom nrog (ntxiv rau) nws rau ib qho chaw sib tw khiav (lossis MV), tag nrho nrog virsh; tom qab ntawd los ntawm peb WK sysadmin txuas los ntawm SSH rau qhov sau thiab nyob hauv nws, tsim cov kev faib tawm thiab nws cov ext4 filesystem kom kawg pom nws los ntawm fstab.
    Tsis muaj dab tsi ua raws li nrog cov lus txuas ntxiv tom qab hauv qhov zoo hauv qemu-kvm thiab ua tsaug ntau rau kev sib koom txhua yam.

    1.    federico said

      Koj tau txais qhov gist ntawm cov lus, phooj ywg Wong. Yog tias tsuas yog nrog cov lus qhia rau Virsh lus txib, kev xav tau tuaj yeem ua tau, vim li cas ho tsis txuas ntxiv nrog nws txoj kev tshawb nrhiav thiab siv. Xov Xwm Nws yog, los ntawm kev txhais, Qemu-KVM interface, xeeb los ntawm nws cov neeg tsim ntawm Red Hat, Inc thiab txhawb nqa los ntawm lub tuam txhab ntawd. Txawm hais tias peb paub tias muaj lwm yam cuam tshuam xws li Virt-Manager thiab oVirt, Virsh tseem ua tiav ntau tshaj los saib xyuas lub tsev qiv ntawv. libvirtCov. Ua tsaug rau phooj ywg Wong rau koj cov lus muaj txiaj ntsig.