Umyalo we-Virsh - Ama-Computer Networks ama-SME

Inkomba ejwayelekile yochungechunge: Ama-Computer Networks ama-SME: Isingeniso

Sanibonani bangani!

Uma ulandele nathi ufunda izindatshana ezishicilelwe kuze kube manje, uzokwazi ukuthi silandela indlela enengqondo impela, ukuze sithole isiteshi sokusebenzela noma ilabhorethri ekhaya, ngosizo oludingekayo lokwenza lokho imishini ebonakalayo noma amaseva lapho sizosebenzisa khona izinsizakalo eziphansi ze- I-LAN - Inethiwekhi Yendawo Yendawo Ibhizinisi.

Sicabanga ukuthi ufunda:

Izixhumanisi zangaphambilini, kanye nezixhumanisi zangaphandle zamakhasi ahlukene namasayithi aqukethe imininingwane ecebile, efakwe kundatshana ngayinye, anikezwa ngenhloso yokuthi ufeze ulwazi oluyisisekelo ngezihloko ezahlukahlukene ezihlanganisiwe.

Lokhu okuthunyelwe kungukuqhubeka okunengqondo kwendlela ekhethiwe. Ukufunda nokutadisha kwakho kuzokuvumela ukuthi ube nombono womhlaba omkhulu osebenzisa i-Virtualization ngokusebenzisa I-Qemu-KVM kanye nesitolo saso esiyinhloko libvirt.

I-Virsh - Isixhumi esibonakalayo somsebenzisi sokuphatha i-Virtual Domains

Siyazi ngokufundwa kwangaphambilini ukuthi i-Virtualization kuLinux isho amandla wokusebenzisa izimo eziningi zezinhlelo ezahlukahlukene ezisebenza ngasikhathi sinye, kungxenyekazi efanayo yehadiwe. I-Libvirt ikhithi yamathuluzi ebhalwe kufayela le- ulimi C, esivumela ukuthi sisebenzisane namandla we-virtualization wezinguqulo zakamuva ze-Linux, kanye nalawo wezinye izinhlelo ezisebenzayo.

Singasebenzisa uhlelo virsh ukudala, ukumisa isikhashana, ukuvala shaqa, uhlu, neminye imisebenzi eminingi ezizindeni ezibonakalayo nama-hypervisors ayisingathileyo. Igama lohlelo liphakamisa ukuthi lifushane ngo- «Onezinweleukuhlukaniswa Shyena»Noma I-Virtualization Command Processor.

Ngendlela ejwayelekile singakuncenga njengo:

virsh [OPTION] .... [IZINGXOXO] ...
  • umyalo: kungaba enye ye Imiyalo engu-215 ohlwini kamuva
  • isizinda: igama lesizinda noma umshini obonakalayo, noma i-ID yesikhombi sezinombolo yesizinda, noma i-UUID yesizinda.
  • ukuphikisana: izinketho ezithile kumyalo ngamunye

Kunokuhluka okuningana emthethweni owedlule, njengasesimweni lapho umyalo usebenza kuzo zonke izizinda, umshini, noma ngqo kwiXen Hypervisor - IXen Hypervisor. Lokho kukhishwa kusuliwe kumyalo ngamunye.

Note: Noma kuvumelekile ukukhomba umshini obonakalayo nge-ID yawo yezinombolo, leli nani lenombolo lizohlala lichazwa njenge-ID yesizinda, hhayi njengegama lalo.

I-Las Umyalo we-Virsh OPTIONS Yilezi:

  • -c, –xhuma i-URI: Ixhuma ku URI «Isikhombi Sezisetshenziswa Esifana- Isikhombi Sensiza Elingalingani, esikhundleni se-URI ezenzakalelayo okungukuthi ye-hypervisor yendawo.
  • -d, –iphutha LEVEL: Nika amandla imilayezo yokulungisa iphutha - lungisa, kuze kufinyelele kunani eliphelele LEVEL, impikiswano yezinombolo engathatha amanani aphakathi kuka-0 no-4. Ngokuqondile 4 inani elizenzakalelayo.
  • -e, –intambo yokuphunyuka: Isetha okunye ukulandelana kwezinhlamvu ngoba lapho sicindezela ukhiye «Esc«. Ukulandelana okuzenzakalelayo ngu ^]. Izinhlamvu ezivunyelwe yilezi: noma yiluphi uhlamvu lwe-alfabhethi, @, [,], \, ^, _. Siphakamisa ungaguquli ukulandelana kwezinhlamvu ezizenzakalelayo.
  • -h, -elp: Uziba ezinye izimpikiswano futhi uziphathe sengathi wenza umyalo Usizo.
  • -k, –keepalive-interval ISIKHATHI: Isetha isikhawu ngemizuzwana ukuthumela uhlobo lwemiyalezo gcina, ukubheka ukuthi ngabe ukuxhumana kuseva kusaphila yini. Uma inani le- I-INTERVAL isethwe ku- 0, bese le ndlela yokuhlola ikhutshaziwe.
  • -K, -gcina i-live-count COUNT: Isetha inani lezikhathi umlayezo ongathunyelwa ngalo gcina ngaphandle kokuthola impendulo kusuka kuseva, futhi ngaphandle kokumaka ukuxhumana njengokufile. Ngeke kube nomthelela kulokhu, uma inani le-INTERVAL lenketho yangaphambilini lisethelwe ku-0.
  • -l, -ngena FILEIqondisa ukukhishwa kwelogi yokusebenza kufayela FILE.
  • -q, –ukuthula: Gwema imininingwane eyengeziwe emiyalezweni. Imodi ethule.
  • -r, –kufundwa kuphela: Ukuxhumeka kokuqala kusungulwa ku- Funda kuphela. Kuyafana nalapho sisebenzisa inketho -Funda kuphela ngomyalo ukuxhuma.
  • -t, –ukulinganisa: Ukhombisa isikhathi esichithwa umyalo ngamunye.
  • -v, –version = kufushane: Ziba noma yiziphi ezinye izimpikiswano, bese ukhombisa inguqulo yelabhulali kuphela libvirt uhlelo luvela ku- virsh.
  • -V, –version = ubude: Ziba ezinye izimpikiswano bese ukhombisa inguqulo yelabhulali libvirt uhlelo luvela ku- virsh futhi ngaphezu kwalokho, ama-hypervisors ahlukene, abalawuli - abashayeli, izinhlobo zenethiwekhi, njll.

Amanothi:

  • Imisebenzi eminingi yomyalo virsh, ake sithi isitolo sezincwadi libvirt ukwazi ukuxhuma kusevisi yezisib esenzweni.
  • Imiyalo eminingi idinga ukuthi iqhutshwe ngamalungelo abasebenzisi izimpande ngenxa yeziteshi zokuxhumana ezisebenzisayo ukuxhumana neHypervisor. Uma isebenza ngamalungelo omsebenzisi ojwayelekile, izobuyisa iphutha.
  • Iningi lemiyalo lisebenza ngokuvumelanayo. Okungenzeka kube ngaphandle kukhona vala shaqa, i-setvcpus y semem. Kulezo zimo, iqiniso lokuthi virsh buyisela i- ngokushesha umyalo, kungahle kungasho ukuthi isenzo sigcwaliswe ngempumelelo. Kufanele kuhlolwe ngezikhathi ezithile ukuthola ukuthi umsebenzi uqediwe ku-Isivakashi - Guest.

Ukuthola eminye imininingwane ngokuqukethwe, bheka indoda virsh.

Iziphakamiso zendlela yokubhekana nengculazi yokufunda

Ukwenza kube lula ukuthola usizo ekusebenziseni i- imiyalo engaphezu kwama-200, virsh uwahlanganise ngamagama asemqoka - usizo igama elingukhiye, okuyilezi:

  • domain
  • Ukuqapha
  • Bamba
  • Isikhombikubona
  • lemifanekiso
  • Inethiwekhi
  • umabhebhana
  • secret
  • isifinyezo
  • Ichibi
  • ivolumu
  • virsh
buzz @ sysadmin: ~ $ virsh usizo kusizinda
 Ukuphathwa Kwesizinda (igama lokhiye elisizayo 'isizinda'): unamathisela-idivaysi yokunamathisela idivayisi kusuka kufayela le-XML lokunamathisela idiski lokunamathisela idiski yedivayisi yokunamathisela i-interface yokuxhuma isikhombimsebenzisi senethiwekhi ukuqala kabusha ukuqala kwesizinda i-blkdeviotune Setha noma ukubuza imingcele ye-I / O yokulungisa idivayisi.
 blkiotune Thola noma setha i-blkio parameter blockcommit Qala ukusebenza kwe-block ukuzibophezela.
 blockcopy Qala ukusebenza kwekhophi yebhlokhi.
 blockjob Phatha ukusebenza kwe-block blockpull Gcwalisa idiski esithombeni sayo sokweseka.
 vimba kabusha usayizi we-block device wesizinda.
 change-media Shintsha imidiya ye-CD noma i-floppy drive console xhuma kwikhonsoli yezivakashi cpu-baseline compute isisekelo se-CPU cpu-qhathanisa i-CPU yokubamba ne-CPU echazwe yifayela le-XML cpu-stats show domain cpu statistics dala isizinda kusuka ku-XML fayela chaza chaza (kepha ungaqali) isizinda esivela embukisweni wefayela le-XML noma setha incazelo yesizinda noma isihloko sonakalisa ukubhubhisa (misa) idivaysi yokukhipha idivaysi yesizinda kusuka kufayela le-XML idiski-idiski yediski yediski yediski yediski isikhombimsebenzisi esibonakalayo se-domdisplay domain display connection URI domfsfreeze freeystems's filesstems.
 Izinhlelo zefayela ezifakiwe ze-domfsthaw Thaw.
 i-domfstrim Biza i-fstrim kumasistimu efayela afakiwe wesizinda.


buzz @ sysadmin: ~ $ virsh usizo ukuqapha
 Ukuqapha Kwesizinda (igama elingukhiye elisizayo 'qapha'): domblkerror Khombisa amaphutha kumadivayisi we-block domblkinfo domain block imininingwane yosayizi wedivayisi uhlu lwe-domblklist zonke izizinda ze-domblkstat zithola izibalo zamabhulokhi wedivayisi yesizinda esibonakalayo sokulawulwa kwesizinda sesimo se-domif-getlink sithola isixhumanisi sesixhumi esibonakalayo esibonakalayo uhlu lwama-domiflist wonke ama-interface we-virtual domain domifstat athole izibalo zesixhumi esibonakalayo senethiwekhi yesizinda solwazi dommemstat thola izibalo zememori zesizinda se-domstate state domstats zithola izibalo ngesizinda esisodwa noma eziningi izizinda ze-domtime uhlu lohlu lwezizinda

buzz @ sysadmin: ~ $ virsh usizo ukuqapha
 Ukuqapha Kwesizinda (igama elingukhiye elisizayo 'qapha'): domblkerror Khombisa amaphutha kumadivayisi we-block domblkinfo domain block imininingwane yosayizi wedivayisi uhlu lwe-domblklist zonke izizinda ze-domblkstat zithola izibalo zamabhulokhi wedivayisi yesizinda esibonakalayo sokulawulwa kwesizinda sesimo se-domif-getlink sithola isixhumanisi sesixhumi esibonakalayo esibonakalayo uhlu lwama-domiflist wonke ama-interface we-virtual domain domifstat athole izibalo zesixhumi esibonakalayo senethiwekhi yesizinda solwazi dommemstat thola izibalo zememori zesizinda se-domstate state domstats zithola izibalo ngesizinda esisodwa noma eziningi izizinda ze-domtime uhlu lohlu lwezizinda

buzz @ sysadmin: ~ $ virsh usizo Umsingathi
 I-Host ne-Hypervisor (igama elingukhiye lokusiza 'umphathi'): ama-allocpage Sebenzisa amakhasi we-pool size amakhono cpu-amamodeli we-CPU amamodeli we-domcapability amandla wesizinda freecell i-NUMA imemori yamahhala imephu ye-NUMA amakhasi wamahhala igama lomethuli liphrinta igama le-hypervisor hostname maxvcpus connection vcpu maximum node-memory-tune Get or setha amapharamitha wememori ye-node nodecpumap node cpu map map nodecpustats Prints cpu stats of the node. imininingwane yama-nodeinfo nodememstats Iphrinta izibalo zememori ye-node. i-nodeuspend imisa okwesikhashana i-host node yesikhathi esinikeziwe sysinfo phrinta i-hypervisor sysinfo uri phrinta i-hypervisor canonical URI version show version

buzz @ sysadmin: ~ $ virsh usizo lokuxhumana
 Isikhombimsebenzisi (igama elingukhiye 'interface'): i-iface-start yakha isithombe samasethingi wamanje we-interface, angenziwa kamuva (iface-commit) noma abuyiselwe (iface-rollback) iface-bridge yakha idivayisi yebhuloho futhi unamathisele idivayisi ekhona yenethiwekhi kuyena-yenza ukuzibophezela kokushintshwa okwenziwe kusukela ku-iface-start kanye ne-free point point iface-define (kodwa ungaqali) i-interface yomsingathi womzimba kusuka kufayela le-XML iface-destroy bhubhisa i-interface yomsingathi womzimba (khubaza / "if- phansi ") imininingwane yesixhumi esibonakalayo se-iface-dumpxml ku-XML iface-edit edit XML configuration for a physical host interface iface-list list physical host interfaces iface-mac convert the name interface to interface MAC address iface-name convert an interface MAC address to interface name ukubuyiselwa emuva kwe-iface ekucushweni kwangaphambilini okulondoloziwe okwenziwe nge-iface-start iface-start qala i-interface yomsingathi womzimba (ivumele / "if-up") iface-unbridge ungachazi idivaysi yebhuloho ngemuva kokumisa idivayisi yayo yesigqila iface-undefine ichaze i-phy sical host interface (isuse ekucushweni)

buzz @ sysadmin: ~ $ virsh usizo isihlungi
 Isihlungi senethiwekhi (igama elingukhiye 'isihlungi'): nwfilter-chaza chaza noma ubuyekeze isihlungi senethiwekhi kusuka kufayela le-XML imininingwane ye-nwfilter-dumpxml yenethiwekhi yokuhlunga ku-XML nwfilter-edit edit XML ukumisa kwesihlungi senethiwekhi nwfilter-list list network filters nwfilter-undefine chaza isihlungi senethiwekhi

buzz @ sysadmin: ~ $ virsh usizo lwenethiwekhi
 Ukuxhumana (igama elingukhiye 'lenethiwekhi'): i-net-autostart qala kabusha inethiwekhi yakha inethiwekhi kusuka kufayela le-XML inetha-chaza (kepha ungaqali) inethiwekhi evela kufayela le-XML net-destroy destroy (stop) a Inethiwekhi net-dhcp-leases imininingwane yokuphrinta yokuphrinta yenethiwekhi enikeziwe imininingwane yenethiwekhi ye-dumpxml ku-XML net-edit edit edit XML configuration for network net-event Network Events net-info network info net-list list network net-name convert a network UUID ukwenza igama lenethiwekhi ukuqala kwenethiwekhi (kuchazwe ngaphambili) inethiwekhi engasebenzi net-undefine ichaze izingxenye eziqhubekayo zenethiwekhi zokuvuselela inethiwekhi zokuvuselela ukubuyekeza kwenethiwekhi ekhona i-net-uuid iguqula igama lenethiwekhi libe yi-UUID yenethiwekhi

buzz @ sysadmin: ~ $ virsh usizo nodedev
 Idivayisi yeNode (igama elingukhiye losizo 'nodedev'): nodedev-dala idivaysi echazwe yifayela le-XML ku-node nodedev-destroy destroy (misa) idivaysi eku-node nodedev-detach detach node device kusuka kumshayeli wayo wedivayisi nodedev-dumpxml imininingwane yedivayisi kuhlu lwe-XML nodedev-enumerate amadivayisi kulo msingathi nodedev-anamathisela kabusha idivayisi yedivayisi kumshayeli wayo wedivayisi nodedev-reset reset node device

buzz @ sysadmin: ~ $ virsh usizo oluyimfihlo
 Imfihlo (igama eliyisihluthulelo losizo 'imfihlo'): chaza imfihlo noma shintsha imfihlo kusuka kufayela le-XML imfihlo-dumpxml imfanelo eyimfihlo ku-XML eyimfihlo-thola-inani Ukukhipha inani eliyimfihlo uhlu lohlu lwemfihlo uhlu lohlu izimfihlo-set-value setha imfihlo ivelu-undefine iveze imfihlo

buzz @ sysadmin: ~ $ virsh usizo isifinyezo
 Isifinyezo (igama eliyisihluthulelo 'isifinyezo'): dala isifinyezo Dala isifinyezo kusuka ku-XML isifinyezo-dala-njengoba Dala isifinyezo kusuka kusethi yamakhefu we-args Thola noma setha isifinyezo samanje-susa Susa isifinyezo sesizinda sesithombe-dumpxml Dump I-XML yesifinyezo sesizinda sokuhlela isizinda-hlela i-XML ukuthola isifinyezo-imininingwane yesithombe-sithombe sohlu-isifinyezo-uhlu Uhlu lwezithombe zesifinyezo-somzali wesizinda Thola igama lomzali wesifinyezo-buyisela emuva Buyisela isizinda esithombeni
buzz @ sysadmin: ~ $ virsh usizo echibini
 Iphuli Yokugcina (igama elingukhiye elithi 'ichibi'): thola-indawo yokugcina-imithombo-njengoba ungathola imithombo yamachibi okugcina ongayithola thola-isitoreji-imithombo-yokuthola imithombo yamachibi okugcina okungaba khona ichibi-i-autostart i-autostart ichibi lokubhukuda-yakha ichibi lechibi- dala-njengoba dala iphuli kusuka kusethi ye-args echibini-dala iphuli kusuka kufayela le-XML-chaza-njengokuchaza iphuli kusuka kusethi ye-args echibini-chaza ichaze (kepha ungaqali) ichibi elisuka kuXML ifayela echibini-susa susa ichibi le-pool-destroy destroy (misa) imininingwane yokubhukuda echibini-dumpxml ku-XML echibini-hlela ukuhlela ukuhlela kwe-XML kwedamu lokugcina ulwazi I-UUID yokuqamba igama le-pool-refresh ye-pool pool-start a start (echazwe ngaphambilini) echibini elingasebenzi-undefine undefine i-pool ye-pool engasebenzi-uuid guqula igama lechibi ukuze libe i-UUID

buzz @ sysadmin: ~ $ virsh usizo ivolumu
 Ivolumu Yokugcina (igama elingukhiye 'ivolumu'): i-vol-clone clone ivolumu. vol-create-as dala ivolumu kusuka kusethi yama-args vol-dala i-vol kusuka kufayela le-XML vol-create-from ukudala i-vol, usebenzisa enye ivolumu njengokufaka vol-susa susa okuqukethwe kwevolumu yokulanda ivolumu ifayela le-vol-dumpxml vol imininingwane ku-XML vol-info storage vol information vol-key ibuyisa ukhiye wevolumu wegama levolumu elinikeziwe noma i-path vol-list list vols vol-name ibuyisa igama levolumu yokhiye wevolumu enikeziwe noma indlela vol- path ibuyisa indlela yevolumu yegama elinikezwe ivolumu noma i-key vol-pool ibuyisa ichibi lokugcina lokhiye wevolumu onikeziwe noma indlela vol-resize resize resize vol vol-upload upload file to the vol vol-wip sula i-vol

buzz @ sysadmin: ~ $ virsh usizo virsh
 I-Virsh uqobo (igama elingukhiye elisizayo 'virsh'): cd shintsha umkhombandlela wamanje xhuma (re) xhuma ku-hypervisor echo echo arguments exit leave this interactive terminal help print help pwd print the current directory quit leaving this interactive terminal

Ngosizo oluthile kunoma imiphi imiyalo efakwe kuhlu

Kumele sikhiphe usizo lwe-virsh. Izibonelo:

buzz @ sysadmin: ~ $ virsh uhlu losizo
  Uhlu lwe-NAME - uhlu lwezizinda uhlu lwe-SYNOPSIS [- olungasebenzi] [- konke] [- okuqhubekayo] [- ukuphikiswa] [--with-snapshot] [--without-snapshot] [- state-running] [- -kumisiwe okwesikhashana] [--state-shutoff] [--state-other] [--autostart] [--no-autostart] [--with-Managed-save] [--without-Managed-Save] [ --uuid] [--name] [--table] [--managed-save] [--title] DESCRIPTION Ibuyisa uhlu lwezizinda. OPTIONS - uhlu olungasebenzi izizinda ezingasebenzi - lonke uhlu lwezizinda ezingasebenzi nezisebenzayo - uhlu oludlulayo izizinda zesikhashana - izizinda eziphikisanayo zohlu eziphikisanayo - izizinda ezinama-snapshot ezizindeni ezinamazwibela akhona --ezingenazo izizinda zohlu lwezizinda ngaphandle kwesithombe - isifunda - izizinda zohlu ezibalekayo ezizindeni ezisetshenziswayo - izizinda zohlu ezimiswe okwesikhashana esimweni esimiswe okwesikhashana - izizinda zohlu lwamazwe-ezizimele ezisezikhundleni ze-shutoff state - ezinye izizinda zohlu kwezinye izifunda - izizinda zohlu lwe-autostart ezine-autostart enikwe amandla - i-no-autostart uhlu lwezizinda ezinokukhubazeka okuzenzakalelayo lukhubazekile - izizinda zohlu lokulondolozwa okuphethwe ngesimo sokuphathwa esilawulwayo - izizinda zohlu lokulondolozwa ngaphandle kokulawulwa ngaphandle kokulondolozwa okuphethwe - uhlu lwamagama uuid kuphela - amagama ohlu lwamagama wesizinda kuphela - ithebula lohlu lwamathebula (okuzenzakalelayo - izizinda zemaki ezingalawulwa-ezilawulwayo eziphethwe ngombuso wokulondoloza ophethwe - isihloko sombukiso wesizinda

buzz @ sysadmin: ~ $ virsh usizo lokuvala
  NAME ukuvala shaqa - ngomusa vala isizinda SYNOPSIS ukuvala shaqa [--imodi ] INCAZELO Run shutdown esizindeni target. OPTIONS [- isizinda] igama lesizinda, i-id noma i-uuid --mode imodi yokuvala: i-acpi | i-ejenti | i-initctl | isignali | i-paravirt

Izibonelo zokusebenzisa umyalo we-virsh

Uhlobo lwe-Virsh

buzz @ sysadmin: ~ $ virsh -v
1.2.9

buzz @ sysadmin: ~ $ virsh -V
Ithuluzi lomugqa womyalo we-Virsh we-libvirt 1.2.9 Bona iwebhusayithi kwi-http: //libvirt.org/ Ihlanganiswe ngokusekelwa kwe: Hypervisors: QEMU / KVM LXC UML Xen LibXL OpenVZ VMWare VirtualBox Test Networking: Remote Network Bridging Interface netcf Nwfilter VirtualPort Storage: I-Dir Disk Filesystem SCSI Multipath iSCSI LVM RBD Sheepdog Okuxubile: Daemon Nodedev AppArmor SELinux Secrets Debug DTrace Readline Modular

Faka i-virsh console

buzz @ sysadmin: ~ $ sudo virsh
[Sudo] password for buzz: Welcome to virsh, the virtualization interactive terminal. Thayipha: 'usizo' ngosizo ngemiyalo 'yeka' ukuyeka

Bhala zonke izizinda

i-virsh # uhlu - konke
 Isimo segama lomazisi --------------------------------------------------- ----- - i-dns ivaliwe - i-miweb ivaliwe - i-sysadmin-centos ivaliwe

Qala isizinda se-dns

i-virsh # qala i-dns
I-Domain dns iqalile

i-virsh # ddplayplay dns
izinongo: //127.0.0.1: 5900

Faka ohlwini amavolumu wesitoreji

virsh # ichibi-uhlu
 Igama State Autostart ----------------------------------------------- ezenzakalelayo ayisebenzi ama-vms -imifanekiso esebenzayo yebo       

virsh # pool-info okuzenzakalelayo
Igama: i-UUID ezenzakalelayo: 3d158e62-6237-464f-9d8f-07ac98be56dc State: running Persistent: yebo Autostart: no Capacity: 14.64 GiB Allocation: 5.18 GiB Available: 9.46 GiB

virsh # pool-info vms-izithombe
Igama: vms-izithombe UUID: 72e1b63d-3d90-4f02-bfde-197fd00f3b94 State: running Persistent: yes Autostart: yes Capacity: 916.77 GiB Allocation: 464.22 GiB Available: 452.55 GiB

Faka kuhlu izithombe eziqukethwe yivolumu

virsh # vol-list vms-izithombe
 Indlela Yendlela ---------------------------------------------------- ------------------------------ I-CentOS-7-x86_64-Yonke into-1511.iso / tera / vms / CentOS-7- x86_64-Konke-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-izithombe
Igama: dns.qcow2 Uhlobo: Amandla wefayela: Ukunikezwa kwe-10.00 GiB: 1.56 GiB

Dala isithombe sediski ngevolumu

i-virsh # vol-create-as --pool vms-images --name dns2.raw --capacity 20G
IVol dns2.raw idaliwe

virsh # vol-list vms-izithombe
 Indlela Yendlela ---------------------------------------------------- ------------------------------ I-CentOS-7-x86_64-Yonke into-1511.iso / tera / vms / CentOS-7- x86_64-Konke-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

Joyina isithombe esisanda kudalwa kusizinda esisebenzayo

i-virsh # i-dns yangaphakathi
nokugijima

virsh # dominfo dns
Id: 4 Igama: dns UUID: 9e69ebc6-213e-42f7-99bf-83b333e93958 OS Type: hvm State: running CPU (s): 1 CPU time: 25.2s Max memory: 262144 KiB Used memory: 262144 KiB Persistent: yes Autostart: khubaza ukulondolozwa okuphethwe: ayikho imodeli yokuphepha: ayikho i-Security DOI: 0

i-virsh # domblklist dns
Umthombo ohlosiwe ---------------------------------------------------- i-vda /tera/vms/dns.qcow2 hda -

i-virsh # attach-disk dns /tera/vms/dns2.raw vdb - i -ististent - phila
Idiski linamathiselwe ngempumelelo

i-virsh # domblklist dns
Umthombo ohlosiwe ---------------------------------------------------- vda /tera/vms/dns.qcow2 vdb /tera/vms/dns2.raw hda -

i-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

i-virsh # domblkstat dns vdb
vdb rd_req 117 vdb rd_bytes 479232 0 vdb wr_req 0 vdb wr_bytes 0 vdb flush_operations 28976780 vdb rd_total_times 0 vdb wr_total_times 0 vdb flush_total_times XNUMX

Sihlukanisa, sifometha futhi sifake i-disk entsha

i-virsh # niyeke
buzz @ sysadmin: ~ $ ssh buzz@192.168.10.5
buzz@192.168.10.5 iphasiwedi:

buzz @ dns: ~ $ sudo fdisk / dev / vdb
[sudo] iphasiwedi ye-buzz: Siyakwamukela ku-fdisk (util-linux 2.25.2). Izinguquko zizohlala kwimemori kuphela, uze uthathe isinqumo sokuzibhala. Qaphela ngaphambi kokusebenzisa umyalo wokubhala. Command (m for help): n Uhlobo lokwahlukanisa p primary (0 primary, 0 extended, 4 free) e enwetshiwe (container for partical logitions) Khetha (default p): p Partition number (1-4, default 1): Umkhakha wokuqala (2048-41949951, default 2048): Umkhakha wokugcina, + imikhakha noma + usayizi {K, M, G, T, P} (2048-41949951, default 41949951): Idale ukwahlukanisa okusha 1 kohlobo 'Linux' nosayizi I-20 GiB. Command (m ngosizo): p Disk / dev / vdb: 20 GiB, 21478375424 bytes, 41949952 sect Units: sectors of 1 * 512 = 512 bytes Usayizi womkhakha (okunengqondo / ngokomzimba): 512 bytes / 512 bytes I / O size ( ubuncane / okulungile): Ama-512 byte / ama-512 amabhayithi Uhlobo lwe-Disklabel: isihlonzi se-dos Disk: 0x12e1497e Uhlobo lwe-Boot Start End Sectors Type Id Type / dev / vdb1 2048 41943039 41940992 20G 83 Linux Command (m for help): w Ithebula lokuhlukanisa lishintshiwe . Ukushayela ioctl () ukuze ufunde kabusha ithebula lokuhlukanisa. Ivumelanisa amadiski.

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

buzz @ dns: ~ $ sudo fdisk -l

IDiski / i-dev / vda: i-10 GiB, i-10737418240 byte, imikhakha ye-20971520 Units: imikhakha ye-1 * 512 = 512 byte Usayizi womkhakha (okunengqondo / ngokomzimba): 512 byte / 512 byte Usayizi we-I / O (ubuncane / okulungile): 512 byte / Uhlobo lwe-Disklabel lwama-512: isihlonzi se-Disk ezimbili: 0xb1e40216 Uhlobo lwe-Boot Start End Sectors Type Id Type / dev / vda1 * 2048 20013055 20011008 9.6G 83 Linux / dev / vda2 20015102 20969471 954370 466M 5 Extended / dev / vda5 20015104 20969471 954368 swap / Solaris Disk / dev / vdb: 466 GiB, 82 bytes, 20 sector Units: sectors of 21478375424 * 41949952 = 1 bytes Usayizi womkhakha (okunengqondo / ngokomzimba): 512 bytes / 512 bytes Usayizi we-I / O (ubuncane / okulungile): Ama-512 byte / ama-512 byte Uhlobo lwe-Disklabel: isihlonzi se-dos Disk: 512x512e0e Uhlobo lwe-Boot Start End Sectors Type Id Type / dev / vdc12 1497 1 2048 41943039G 41940992 Linux

buzz @ dns: ~ $ sudo mkdir / isitolo
i-buzz @ dns: ~ $ sudo nano / etc / fstab 
/ dev / vdb1 / esitolo ext4 okuzenzakalelayo 0 0

buzz @ dns: ~ $ sudo mount -a
buzz @ dns: ~ $ ls -l / total store 16 drwx ------ 2 impande 16384 Dec 10 17: 34 elahlekile + itholakele

Sibuyela ku-virsh console

buzz @ sysadmin: ~ $ Sudo virsh Siyakwamukela ku-virsh, i-virtualization interactive terminal. Thayipha: 'usizo' ngosizo ngemiyalo 'yeka' ukuyeka

i-virsh # 

Siyacisha

i-virsh # i-dns yangaphakathi
nokugijima

i-virsh # ukuvalwa kwe-dns
I-Domain dns iyavalwa

Isifingqo

Kuze kube manje sesihambe ngomkhumbi ogwini loLwandle iVirsh. 😉 Ngeminye imininingwane, yenza umyalo indoda virsh. Kodwa-ke, sishiya ifayela lombhalo elicacile elibiziwe virsh-usizo.txt esikwenzayo ukwenza impilo ibe lula kulabo abazama ukungena kule Super Command yokuphathwa nokuphathwa kwamaHypervisors nemishini yabo eyi-Virtual.

Sincoma kakhulu hlola imiyalo engaphandle kwendawo yokukhiqiza.


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Amazwana ayi-7, shiya okwakho

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.

  1.   isihlibhi kusho

    Ngingathanda ukusebenzisa iVirsh ukwenza izinto eziningi, njengamanje izisekelo kuphela, ukuqala, ukuma, konke okunye engikusebenzisa umphathi we-virt, ngithanda ukuthi ungaba namaseva we-N asebenzisa i-libvirt futhi uwaphathe kusuka endaweni yakho yokusebenza nomphathi we-virt.

  2.   frederico kusho

    Sawubona mngane Dhunter !!! Sengivele ngisemsebenzini wami. Landa ifayela virsh-help.txt elizokusiza kakhulu. Ngayenza nge-virsh console uqobo, ngabe sengenza iskripthi ukuyigcwalisa. Ngicabanga ukuthi, ukuhlelwa ngamagama asemqoka wosizo, kuyaphuzeka kakhulu. Esihlokweni esilandelayo ngithinta izihloko eziningi mayelana nalo myalo.

  3.   ICarburus Zodiac kusho

    Sanibonani uFederico. Ngilandele izindatshana zakho ezithakazelisayo kuma-SME. Kunqunywa ukuthi kulula ukusebenzisa ikhonsoli ekuphathweni okusheshayo nokusheshayo. Basebenzisa nezinsizakusebenza ezimbalwa. Ngilinde ukulethwa kwakho okulandelayo.

  4.   crespo88 kusho

    Kahle Federico, usuvele wahlangana nami. Siyabonga ngalesi sipho osinike sona. Okuthunyelwe okuhle kakhulu, bengilinde le ndatshana ku-virsh. Ngiyabonga mfowethu, sonke sizokwazi ukuthi siyisebenzisa kanjani ngendlela efanele.

  5.   phico kusho

    Wamukelekile, uCrespo88. Ngalokho sikwi-DesdeLinux.

  6.   U-Ismael Alvarez Wong kusho

    sawubona, ngiyamangala ngamandla omyalo we-virsh, angiwatholi amagama okuchaza engikucabangayo ngawo, okungakholeki, nokuthi okushoyo kokuthunyelwe kumane nje kuyibhrashi, usebenzisa amagama akho siqu «Kuze kube manje uhambe ngomkhumbi ogwini loLwandle iVirsh. "
    ilusizo olukhulu uma uchaza ukuthi ungalucwaninga kanjani usizo lwe-virsh usebenzisa amagama wakho angukhiye.
    isibonelo esihle esenziwe se-Dala isithombe sediski ngevolumu bese u-Join (engeza) kusizinda esisebenzayo (noma i-MV), konke kune-virsh; bese kusuka ku-WK sysadmin yethu exhunywe yi-SSH kusizinda nangaphakathi kwayo, yakha ukwahlukanisa nohlelo lwayo lwefayela le-ext4 ekugcineni ukuyifaka kusuka ku-fstab.
    Akukho okumele kulandelwe ngokuthunyelwe okulandelayo ochungechungeni lwe-virt qemu-kvm futhi ngiyabonga kakhulu ngokwabelana ngakho konke lokhu.

    1.    frederico kusho

      Uthole ingqikithi yomlayezo, mngani Wong. Uma kuphela ngokwethulwa komyalo we-Virsh, izimangaliso zingenziwa, kungani ungaqhubeki nokutadisha nokusetshenziswa kwayo. Ingculazi Ngokwencazelo, isikhombimsebenzisi seQemu-KVM, esakhiwe ngabadali baso eRed Hat, Inc futhi sixhaswe yile nkampani enkulu. Yize sazi ukuthi kunezinye izixhumi ezibonakalayo ezifana neVirt-Manager ne-oVirt, iVirsh isaphelele kunawo wonke ukuphatha umtapo wezincwadi libvirt. Ngiyabonga mngani Wong ngemibono yakho ebalulekile.