Taelo ea Virsh - Network Networks bakeng sa li-SME

Kakaretso ea li-series: Li-network tsa likhomphutha tsa li-SME: Selelekela

Lumelang metsoalle!

Haeba u latetse le rona ho bala lingoliloeng tse phatlalalitsoeng ho fihlela joale, u tla hlokomela hore re latela tsela e utloahalang, ho fumana seteishene sa mosebetsi kapa laboratori lapeng, ka tšehetso e hlokahalang ho etsa joalo Mechini kapa lisebelisoa tse fumanehang moo re tla kenya ts'ebetsong lits'ebeletso tse tlase bakeng sa Lan - Local Network Network Khoebo.

Re nahana hore u bala:

Lihokelo tsa pejana, hammoho le lihokela tsa kantle ho maqephe a fapaneng le libaka tsa marang-rang tse nang le tlhaiso-leseling e ngata, e kenyellelitsoeng sengoloeng ka seng, li fanoa ka sepheo sa hore u fihlelle tsebo ea mantlha ka lihlooho tse fapaneng tse koahetsoeng.

Poso ena ke tsoelopele e utloahalang ea tsela e khethiloeng. Ho bala le ho ithuta ha hau ho tla u lumella ho ba le mohopolo oa lefats'e le leholo leo Virtualization e fetang ho lona Qemu-KVM le lebenkele la eona le leholo la libuka libvirt.

Virsh - Sebopeho se ka sehloohong sa mosebelisi bakeng sa ho laola Virtual Domains

Rea tseba ho tsoa palong e fetileng hore Virtualization in Linux e bolela bokhoni ba ho tsamaisa maemo a mangata a lits'ebetso tse fapaneng tse ts'oanang tsa ts'ebetso, sethaleng se le seng sa lisebelisoa. Libvirt ke sesebelisoa sa lithulusi se ngotsoeng ho puo C, e re lumellang ho sebelisana le bokhoni ba bonono ba mefuta ea morao-rao ea Linux, hape le ea lits'ebetso tse ling tsa ts'ebetso.

Re ka sebelisa lenaneo virsh ho theha, ho emisa, ho koala, lenane, le lits'ebetso tse ling tse ngata libakeng tse fumanehang le li-hypervisors tse li amohelang. Lebitso la lenaneo le fana ka maikutlo a hore e khuts'oane bakeng sa «Virho kopanya Shell»Kapa Sesebelisoa sa Taolo ea Virtualization.

Ka tsela e tloaelehileng re ka e kopa joalo ka:

virsh [KHETHO] .... [LIEKETSE] ...
  • taelo: e ka ba e 'ngoe ea Litaelo tsa 215 thathamisitsoe hamorao
  • domain: lebitso la domain kapa mochini o fumanehang, kapa ID ea lebitso la domain, kapa UUID ea domain.
  • khang: likhetho tse ikhethang ho taelo ka 'ngoe

Ho na le mekhelo e mengata molaong o fetileng, joalo ka maemong ao taelo e sebetsang ho libaka tsohle, mochini, kapa ka kotloloho ho Xen Hypervisor - Xen Hypervisor. Likhetho tse joalo li hlakisoa bakeng sa taelo ka 'ngoe.

Hlokomela: Le ha ho nepahetse ho khetholla mochini o fumanehang ka ID ea ona ea linomoro, boleng bona ba linomoro bo tla lula bo hlalosoa e le ID ea domain, eseng lebitso la eona.

ea Taelo ea Virsh OPTIONS Ke tsona:

  • -c, – hokahanya URI: E hokela ho URI «Sebopeho sa lisebelisoa tse sa tšoaneng- Sebopeho sa lisebelisoa tse sa tšoanengSebakeng sa URI ea kamehla eo e leng ea hypervisor ea lehae.
  • -d, –debug level: Numella melaetsa ea ho buoa - debug, hofihlela ho boleng ba palo e felletseng, ngangisano ea linomoro e ka nkang litekanyetso pakeng tsa 0 le 4. Hantle-ntle 4 ke boleng ba mantlha.
  • -e, - khoele ea ho balehaE beha tatellano e fapaneng ea sebapali etsoe ha re tobetsa «senotloloEsc«. Tsamaiso ea kamehla ke ^]. Litlhaku tse lumelletsoeng ke: mofuta ofe kapa ofe oa alfabeta, @, [,], \, ^, _. Re fana ka maikutlo u se ke ua fetola tatellano ea sebopeho sa kamehla.
  • -h, -help: O hlokomoloha mabaka afe kapa afe mme o itšoara joalo ka ha eka o etsa taelo Thusa.
  • -k, –keepalive-karohano NAKOE beha karohano ka metsotsoana ho romella mofuta oa melaetsa boloka, ho netefatsa hore na khokelo ea seva e ntse e phela. Haeba boleng ba TŠEBETSO e hlophiselitsoe ho 0, joale mochini ona oa ho lekola o holofetse.
  • -K, –keepalive-bala COUNTE beha palo ea makhetlo ao molaetsa o ka romelloang boloka ntle le ho fumana karabo ho tsoa ho seva, mme ntle le ho tšoaea khokahano joalo ka ha e shoele. E ke ke ea ba le phello ho khetho ena, haeba boleng ba INTERVAL ba khetho e fetileng bo ne bo behiloe ho 0.
  • -l, -log FILEE tsamaisa tlhahiso ea log ea ts'ebetso ho file FILE.
  • -q, –e khutsitseQoba tlhahisoleseding e eketsehileng melaetseng. Mokhoa o khutsitseng.
  • -r, –e le mong feela: Khokahano ea pele e thehiloe ka Bala feela. Hoa tšoana le ha re sebelisa khetho –Bala feela ka taelo amahanya.
  • -t, -le nako: E bontša nako e sebelisitsoeng ke taelo ka 'ngoe.
  • -v, –version = khutsoanyaneHlokomoloha mabaka a mang, 'me u bontše mofuta oa laeborari feela libvirt lenaneo le tsoa ho virsh.
  • -V, –version = boleleleHlokomoloha lintlha tse ling ebe u bontša mofuta oa laeborari libvirt lenaneo le tsoa ho virsh ho feta moo, li-hypervisors tse fapaneng, balaoli - bakhanni, mefuta ea marang-rang, jj. eo pokello e e tšehetsang.

Lintlha:

  • Boholo ba ts'ebetso ea litaelo virsh, nahana hore lebenkele la libuka libvirt khona ho hokahanya le ts'ebeletso kbatla ka liketso.
  • Boholo ba litaelo li hloka hore li tsamaisoe ka litokelo tsa mosebelisi motso ka lebaka la liteishene tsa puisano tseo e li sebelisang ho buisana le Hypervisor. Haeba e matha le litokelo tsa mosebelisi ea tloaelehileng, e tla khutlisa phoso.
  • Boholo ba litaelo li sebetsa ka tsela e lumellanang. Likhetho tse ka bang teng ke tsena koala, setvcpus y setemem. Maemong ao, taba ea hore virsh khutlisa potlako taelo, ho kanna ha se bolele hore ketso e phethetsoe ka katleho. E lokela ho hlahlojoa nako le nako ho fumana hore ts'ebetso e phethetsoe ho Moeti - Guest.

Bakeng sa tlhaiso-leseling e batsi ka litaba, bona monna virsh.

Litlhahiso mabapi le mokhoa oa ho atamela ts'oaetso ea ho ithuta

Ho etsa hore ho be bonolo ho fumana thuso mabapi le ho sebelisa litaelo tse fetang 200, virsh lihlopha ka mantsoe a bohlokoa - thuso keyword, e leng:

  • domain name
  • lepiwa
  • moamoheli
  • segokanyimmediamentsi sa sebolokigolo
  • filthara
  • netweke
  • qhobane
  • sephiri
  • sekhetho
  • letangoana la ho sesa
  • bophahamo ba modumo
  • virsh
buzz @ sysadmin: ~ $ virsh thuso domain
 Tsamaiso ea Domain (keyword keyword 'domain'): hokela-sesebelisoa se hokelang sesebelisoa ho tsoa faeleng ea XML e hokela-disk hokela sesebelisoa sa disk hokela-interface hokela marang-rang autostart autostart domain domain blkdeviotune Set kapa botsa sesebelisoa sa block block I / O.
 blkiotune Fumana kapa beha blkio parameter blockcommit Qala ts'ebetso ea boitlamo.
 blockcopy Qala ts'ebetso ea block copy.
 blockjob Laola ts'ebetso e sebetsang ea li-blockpull Etsa palo ea disk ho setšoantšo sa eona se tšehelitsoeng.
 blockresize Resize block device ea domain.
 change-media Fetola media ea CD kapa floppy drive console e hokela mojaneng oa baeti cpu-baseline compute ea mantlha CPU cpu-bapisa host CPU le CPU e hlalositsoeng ke file ea XML cpu-stats show domain cpu lipalo e theha domain ho tsoa XML faele e hlalosa (empa u se ke ua qala) domain ho tsoa ponts'ong ea faele ea XML kapa beha tlhaloso ea domain kapa sehlooho senya senya (emisa) sesebelisoa sa detach-sesebedisoa sa sesebelisoa sa XML file detach-disk detach disk device detach-interface detach netweke segokanyimmediamentsi sa sebolokigolo domdisplay domain name display connection URI domfsfreeze Freeze domain's systemed systems.
 sisteme ea li-file tsa domfsthaw Thaw.
 domfstrim Kopa fstrim litsing tse hlophisitsoeng tsa li-file.


buzz @ sysadmin: ~ $ virsh thusa ho lekola
 Tlhokomelo ea Domain (help keyword 'monitor'): domblkerror Bontša liphoso lisebelisoa tsa block domblkinfo domain block block size leseli domblklist thathamisa libaka tsohle tsa domain domblkstat fumana li-block block tsa domain bakeng sa domain domain domcontrol domain control interface state domif-getlink fumana khokahano ea boemo ba sebopeho se hlakileng lenane la li-domiflist lethathamo la li-interface tsa domain kaofela li fumana li-interface tsa marang-rang bakeng sa domain domain leseli dommemstat fumana lipalo-palo tsa memori bakeng sa domain domstate domain state domstats fumana lipalo-palo ka e le 'ngoe kapa libaka tse ngata tsa domtime domain time lenane la libaka tsa libaka

buzz @ sysadmin: ~ $ virsh thusa ho lekola
 Tlhokomelo ea Domain (help keyword 'monitor'): domblkerror Bontša liphoso lisebelisoa tsa block domblkinfo domain block block size leseli domblklist thathamisa libaka tsohle tsa domain domblkstat fumana li-block block tsa domain bakeng sa domain domain domcontrol domain control interface state domif-getlink fumana khokahano ea boemo ba sebopeho se hlakileng lenane la li-domiflist lethathamo la li-interface tsa domain kaofela li fumana li-interface tsa marang-rang bakeng sa domain domain leseli dommemstat fumana lipalo-palo tsa memori bakeng sa domain domstate domain state domstats fumana lipalo-palo ka e le 'ngoe kapa libaka tse ngata tsa domtime domain time lenane la libaka tsa libaka

buzz @ sysadmin: ~ $ virsh thusa moamoheli
 Host and Hypervisor (help keyword 'host'): likhaolo Laola maqephe a boholo ba letamo bokhoni ba li-cpu-mehlala ea li-CPU mefuta e mengata ea matla a marang-rang freecell NUMA mehopolo ea bolokolohi ea memori ea maqephe a mahala a NUMA hatisa lebitso la lebitso la lebitso la lebitso la maxvcpus mabapi le vcpu palo e phahameng ea mohopolo Fumana kapa seta lipalo tsa mohopolo oa node nodeinfo node information nodememstats E hatisa lintlha tsa mohopolo oa node. nodeuspend emisa node ea moamoheli ka nako e fuoeng sysinfo hatisa hypervisor sysinfo uri hatisa hypervisor canonical URI version show version

buzz @ sysadmin: ~ $ virsh thuso interface
 Sebopeho (lebitso la sehlooho la thuso ea 'interface'): qalo-qalo etsa setšoantšo sa li-setting tsa hajoale tsa li-interface, tse ka etsoang hamorao (iface-commit) kapa tse nchafalitsoeng (iface-rollback) iface-Bridge e theha sesebelisoa sa borokho ebe e hokela sesebelisoa sa marang-rang se teng ho eona haeba u ikemiselitse ho etsa liphetoho tse entsoeng ho tloha ha qalo-qalo le ho khutlisetsa sebaka sa mahala mahala-hlalosa (empa u se ke ua qala) sebopeho sa moamoheli sa 'mele se tsoang faeleng ea XML faele-senya timetsa sebopeho sa moamoheli oa' mele (se thibele / "if- ("down") tlhahisoleseling ea interface-dumpxml ho XML iface-edit edita XML sebopeho sa sebopeho sa 'mele se nang le lethathamo la lethathamo la likarolo tsa' mele tse amohelang li-iface-mac tse fetolelang lebitso la sehokelo ho aterese ea MAC atace-lebitso fetola aterese ea MAC ea sehokelo ho lebitso la sehokelo faace-rollback rollback ho peakanyo e fetileng e bolokiloeng e entsoe ka iface-qala iface-qala qala sebopeho sa moamoheli oa 'mele (e nolofalletse / "if-up") iface-unbridge undefine a sesebelisoa sa borokho kamora ho koala sesebelisoa sa eona sa lekhoba iface-undefine undefine a phy sical host interface (e tlose tlhophisong)

buzz @ sysadmin: ~ $ virsh thusa sefahla
 Filter ea Marangrang (keyword key 'filter'): nwfilter-hlalosa hlalosa kapa ho nchafatsa sefahleho sa marang-rang ho tsoa ho file ea XML file nwfilter-dumpxml network filter information ho XML nwfilter-edit edit XML configuration for network network nwfilter-list list network filters nwfilter-undefine hlakisa sefahleho sa marang-rang

buzz @ sysadmin: ~ $ virsh thuso marang-rang
 Marangrang (keyword help 'network'): net-autostart ho qala marang-rang ho theha marang-rang ho tsoa ho file ea XML net-define (empa u se ke ua qala) marang-rang a tsoang ho file ea XML net-senya senya (emisa) a net net-dhcp-leases print lease info bakeng sa netweke e fanoeng 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 network net-name convert a network UUID ho lebitso la marang-rang ho qala marang-rang (a neng a hlalositsoe pele) marang-rang a sa sebetseng a sa hlalose marang-rang a sa khaotseng a ho ntlafatsa likarolo tsa lisebelisoa tsa marang-rang a net-uuid fetola lebitso la marang-rang ho UUID ea marang-rang

buzz @ sysadmin: ~ $ virsh thusa nodedev
 Sesebelisoa sa Node (keyword help 'nodedev'): nodedev-etsa sesebelisoa se hlalositsoeng ke file ea XML ho node nodedev-senya senya (emisa) sesebelisoa ho node nodedev-detach detach node device ho tsoa ho sesebelisoa sa eona sa mokhanni nodedev-dumpxml node makolopetso a sesebelisoa lenaneng la XML nodedev-thathamisa lisebelisoa ho moamoheli enoa nodedev-kenya hape sesebelisoa sa node ho sesebelisoa sa eona sa nodedev-reset reset node

buzz @ sysadmin: ~ $ virsh thusa sephiri
 Lekunutu (keyword key 'secret'): hlalosa lekunutu kapa u fetole lekunutu ho tsoa ho file ea XML lekunutu-dumpxml lekunutu ho XML lekunutu la ho fumana boleng ba lekunutu lethathamo la lekunutu lethathamo la liphiri lekunutu le behileng lekunutu lekunutu ha le hlalose sephiri

buzz @ sysadmin: ~ $ virsh thuso setšoantšo
 Snapshot (keyword help 'snapshot'): snapshot-create Etsa senepe ho tsoa ho XML snapshot-create-as Create a snapshot from a set of args snapshot-current Get or set the snapshot snapshot-delete Delete a snapshot snapshot-dumpxmlump XML bakeng sa setšoantšo sa marang-rang-edit edit edit XML bakeng sa snapshot-info snapshot information snapshot-list Lethathamo la linepe bakeng sa domain-snapshot-motsoali Fumana lebitso la motsoali oa setšoantšo se khutlang-khutlisetsa Khutlisetsa domain ho setšoantšo
buzz @ sysadmin: ~ $ virsh thuso letamo
 Letamo la ho Boloka (thusa lentsoe la bohlokoa 'letamo'): fumana-mehloli ea polokelo-joalo ka ha u ka fumana mehloli ea letamo la polokelo fumana-polokelo-mehloli ea mehloli ea mehloli ea letamo la ho boloka letamo-autostart autostart letamo la letangoana-haha letamo la ho sesa- theha-joalo ka ha u theha letangoana ho tloha letamong la args-etsa letangoana ho tsoa letamong la faele la XML-hlalosa-joalo ka ho hlalosa letangoana ho tsoa sethaleng sa args-hlalosa hlalosa (empa u se ke ua qala) letangoana le tsoang ho XML faele letangoana-hlakola hlakola letangoana la metsi-senya timetsa (emisa) leseli la letamo-la-dumpxml letamo ka letamo la XML-hlophisa liphetoho tsa XML bakeng sa letamo la polokelo-lethathamo la lintlha tsa polokelo ea letangoana lethathamo la letamo-lebitso le fetola letangoana UUID ho letamo la ho sesa letamo-khatholla letangoana la ho sesa letamo-qala ho qala (le neng le hlalosoa pejana) letamo le sa sebetseng-undefine ha o hlalose letangoana le sa sebetseng-uuid fetola lebitso la letangoana hore le be letangoana la UUID

buzz @ sysadmin: ~ $ virsh thuso bophahamo ba modumo
 Sesebelisoa sa polokelo (lentsoe la sehlooho la thuso 'volume'): cl-clone clone molumo. vol-create-ha o etsa bophahamo ba modumo ho tsoa ho sete sa args vol-etsa vol ho tsoa ho XML file vol-create-ho theha vol, u sebelisa molumo o mong e le ho kenya vol-hlakola hlakola vol vol-download download volume litaba ho file vol-dumpxml vol information in XML vol-info storage vol information vol-key e khutlisetsa senotlolo sa molumo bakeng sa lebitso la bophahamo le fanoeng kapa lethathamo la lenane la vol-list vols lebitso le khutlisa lebitso la molumo bakeng sa senotlolo sa molumo o fanoeng kapa tsela vol- path e khutlisetsa tsela ea molumo bakeng sa lebitso la molumo o fanoeng kapa letamo la senotlolo sa vol-pool e khutlisetsa letangoana la polokelo bakeng sa senotlolo se fanoeng sa molumo kapa tsela vol-resize resize res vol vol-upload upload file tse kahare ho vol vol hlakola hlakola vol

buzz @ sysadmin: ~ $ virsh thusa virsh
 Virsh ka boeona (thusa keyword 'virsh'): cd change the current directory connect (re) hokela ho hypervisor echo echo mabaka a tsoang tlohella seteishene sena sa puisano thusa ho hatisa thuso pwd ho hatisa buka ea hajoale tlohela ho tlohela seteishene sena sa puisano

Bakeng sa thuso e ikhethang ho efe kapa efe ea litaelo tse thathamisitsoeng

Re tlameha ho phethisa thuso ea virsh. Mehlala:

buzz @ sysadmin: ~ $ virsh lenane la thuso
  Lenane la mabitso - lenane la libaka tsa SYNOPSIS lethathamo [- ha le sebetse] [- kaofela] [--transient] [--persistent] [--with-snapshot] [--with-snapshot] [- state-running] [- -state-paused] [--state-shutoff] [--state-other] [--autostart] [--no-autostart] [--with-Managed-save] [- ntle le taolo e laoloang] [ --uuid] [--name] [--table] [--managed-save] [--title] DESCRIPTION E khutlisa lenane la libaka. KHETHO - lethathamo le sa sebetseng la libaka tse sa sebetseng - lethathamo lohle la libaka tse sa sebetseng le tse sa sebetseng - lethathamo la libaka tse khutšoane lethathamo la libaka tse sa khaotseng - tse nang le lethathamo la likarolo tse nang le linepe tse seng li ntse li le teng - ntle le linepe ntle le setšoantšo - setereke -ho matha lethathamo la libaka tse maemong a mmuso - libaka tse emisitsoeng tsa lethathamo la libaka maemong a khefutsitsoeng - libaka tsa lethathamo la maemo a boemo ba mmuso ho shutoff state - libaka tsa lethathamo la linaha tse ling libakeng tse ling - libaka tsa lethathamo la liostostart tse nang le autostart e lumelletsoeng --no-autostart lethathamo la libaka tse nang le li-autostart tse holofalitsoeng - tse bolokiloeng-tse bolokiloeng lethathamong la libaka tse nang le taolo e bolokiloeng ea naha - ntle le taolo e bolokiloeng ea lethathamo ntle le ho boloka taolo - lethathamo la mabitso a mabitso feela - mabitso a li-domain mabitso feela - lethathamo la lethathamo la litafole (default - e laoloang-e boloka libaka tse sa sebetseng tse nang le taolo e bolokiloeng ea state -title show domain title

buzz @ sysadmin: ~ $ virsh thusa ho koala
  HO TIMA LEBITSO - ka moetso o koala domain name SYNOPSIS shutdown [--mode ] TLHALOSO Qoba ho koala libaka tseo u batlang ho li sebelisa. KHETHO [- domain] domain name, id kapa uuid --mode Mokhoa oa ho tima: acpi | moemeli | initctl | lets'oao | paravirt

Mehlala ea ho sebelisa taelo ea virsh

Mofuta oa Virsh

buzz @ sysadmin: ~ $ virsh -v
1.2.9

buzz @ sysadmin: ~ $ virsh -V
Sesebelisoa sa taelo ea Virsh ea libvirt 1.2.9 Sheba sebaka sa marang-rang ho http://libvirt.org/ E hlophisitsoe ka tšehetso ea: Hypervisors: QEMU / KVM LXC UML Xen LibXL OpenVZ VMWare VirtualBox Test Networking: Remote Network Bridging Interface netcf Nwfilter VirtualPort Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM RBD Sheepdog Tse fapaneng: Daemon Nodedev AppArmor SELinux Secrets Debug DTrace Readline Modular

Kenya konteraka ea virsh

buzz @ sysadmin: ~ $ sudo virsh
[sudo] phasewete bakeng sa buzz: Rea u amohela ho virsh, e leng virtualization interactive terminal. Tlanya: 'thuso' bakeng sa thuso ka litaelo 'tlohela' ho tlohela

Thathamisa libaka tsohle

virsh # list - kaofela
 Naha ea Lebitso la Id ----------------------------------------------- ----- - dns e koetsoe - miweb e koetsoe - sysadmin-centos e koetsoe

Qala domain ea dns

virsh # qala dns
Dns ea domain e qalile

virsh # bapala dns
senoko: //127.0.0.1: 5900

Thathamisa lenane la polokelo

virsh # lethathamo la letamo
 Lebitso State Autostart ----------------------------------------------- e sa sebetseng ha e na vms -e na le maikutlo a sebetsang e       

virsh # letamo-info default
Lebitso: default UUID: 3d158e62-6237-464f-9d8f-07ac98be56dc State: running Persistent: yes Autostart: no Capacity: 14.64 GiB Allocation: 5.18 GiB Available: 9.46 GiB

virsh # letamo-leseli vms-litšoantšo
Lebitso: vms-litšoantšo UUID: 72e1b63d-3d90-4f02-bfde-197fd00f3b94 State: Run Persistent: yes Autostart: yes Capacity: 916.77 GiB Allocation: 464.22 GiB Available: 452.55 GiB

Thathamisa litšoantšo tse nang le molumo

virsh # vol-lenane vms-litšoantšo
 Tsela ea Lebitso ----------------------------------- ------------------------------ CentOS-7-x86_64-Ntho e ngoe le e ngoe-1511.iso / tera / vms / CentOS-7- x86_64-Ntho e 'ngoe le e' ngoe-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-litšoantšo
Lebitso: dns.qcow2 Mofuta: Matla a faele: Kabo ea 10.00 GiB: 1.56 GiB

Etsa setšoantšo sa disk ka molumo

virsh # vol-create-as --pool vms-litšoantšo --name dns2.raw - bokhoni ba 20G
Vol dns2.raw e thehiloe

virsh # vol-lenane vms-litšoantšo
 Tsela ea Lebitso ----------------------------------- ------------------------------ CentOS-7-x86_64-Ntho e ngoe le e ngoe-1511.iso / tera / vms / CentOS-7- x86_64-Ntho e 'ngoe le e' ngoe-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 .qox2 /tera/vms/sysadmin.qcow2

Ikopanya le setšoantšo se sa tsoa thehoa sebakeng se sebetsang

virsh # ntlo ea dns
mathang

virsh # dominfo dns
Id: 4 Lebitso: dns UUID: 9e69ebc6-213e-42f7-99bf-83b333e93958 OS Type: hvm State: running CPU (s): 1 CPU time: 25.2s Max memory: 262144 KiB memory: 262144 KiB Persistent: yes Autostart: thibela Ho boloka ho laoloang: ha ho mofuta oa Ts'ireletso: ha ho na Ts'ireletso DOI: 0

virsh # domblklist dns
Mohloli o lebisitsoeng ------------------------------------------------ vda /tera/vms/dns.qcow2 hda -

virsh # attach-disk dns /tera/vms/dns2.raw vdb - e tsitsitseng - phela
Disk e hoketsoe ka katleho

virsh # domblklist dns
Mohloli o lebisitsoeng ------------------------------------------------ vda /tera/vms/dns.qcow2 vdb /tera/vms/dns2.raw hda -

mofuta # 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 flush_operations 0 vdb rd_total_times 28976780 vdb wr_total_times 0 vdb flush_total_times 0

Re arola, re fomata ebe re kenya disk e ncha

virsh # tlohela
buzz @ sysadmin: ~ $ ssh buzz@192.168.10.5
phasewete ea buzz@192.168.10.5:

buzz @ dns: ~ $ sudo fdisk / dev / vdb
[sudo] phasewete bakeng sa buzz: Rea u amohela ho fdisk (util-linux 2.25.2). Liphetoho li tla lula li hopoloa feela, ho fihlela u nka qeto ea ho li ngola. Hlokomela pele o sebelisa taelo ea ho ngola. Taelo (m bakeng sa thuso): n Mofuta oa karohano p primary (0 primary, 0 extended, 4 free) e atolositsoeng (setshelo bakeng sa likarolo tse utloahalang) Khetha (default p): p Karolo ea karohano (1-4, default 1): Lekala la pele (2048-41949951, default 2048): Lekala la ho qetela, + likarolo kapa + size {K, M, G, T, P} (2048-41949951, default 41949951): Ho thehiloe karohano e ncha 1 ea mofuta oa 'Linux' le boholo 20 GiB. Laela (m bakeng sa thuso): p Disk / dev / vdb: 20 GiB, 21478375424 byte, li-unit tsa 41949952: likarolo tsa 1 * 512 = 512 byte Boholo ba lekala (bo utloahalang / ba 'mele): 512 byte / 512 byte Boholo ba I / O ( bonyane / optimal): 512 byte / 512 byte Disklabel type: dos Disk identifier: 0x12e1497e Sesebelisoa sa Boot Start End Sectors Type Id Type / dev / vdb1 2048 41943039 41940992 20G 83 Linux Command (m for help): w Tafole ea karohano e fetotsoe . Ho letsetsa ioctl () ho bala tafoleng ea likarolo. Ho lumellana li-disk.

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

buzz @ dns: ~ $ sudo fdisk -l

Disk / dev / vda: 10 GiB, 10737418240 byte, 20971520 likarolo tsa lihlopha: likarolo tsa 1 * 512 = 512 byte Boholo ba lekala (bo utloahalang / ba 'mele): 512 byte / 512 byte Boholo ba I / O (bonyane / bo nepahetseng): 512 byte / Mofuta oa Disklabel oa 512: mofuta oa boitsebiso ba Disk: swap / Solaris Disk / dev / vdb: 0 GiB, 1 bytes, Makala a 40216: likarolo tsa 1 * 2048 = 20013055 byte Boholo ba lekala (bo utloahalang / ba 'mele): 20011008 byte / 9.6 byte Boholo ba I / O (bonyane / bo nepahetseng): 83 bytes / 2 byte Disklabel mofuta: dos Disk identifier: 20015102x20969471e954370e Sesebelisoa sa Boot Start End Sectors Type Id Type / dev / vdc466 5 5 20015104 20969471G 954368 Linux

buzz @ dns: ~ $ sudo mkdir / lebenkele
buzz @ dns: ~ $ sudo nano / etc / fstab 
/ dev / vdb1 / lebenkele ext4 liphoso tsa 0 0

buzz @ dns: ~ $ sudo mount -a
buzz @ dns: ~ $ ls -l / kakaretso ea lebenkele 16 drwx ------ 2 motso motso 16384 Dec 10 17: 34 e lahlehileng + e fumanoe

Re khutlela ho virsh console

buzz @ sysadmin: ~ $ sudo virsh Rea u amohela ho virsh, e leng virtualization interactive terminal Tlanya: 'thuso' bakeng sa thuso ka litaelo 'tlohela' ho tlohela

virsh # 

Re tima

virsh # ntlo ea dns
mathang

virsh # ho koala dns
Domain dns e ntse e koaloa

Kakaretso

Ho fihlela joale re se re tsamaile ka mabopo a Leoatle la Virsh. Bakeng sa tlhaiso-leseling e batsi, phethisa taelo monna virsh. Leha ho le joalo, re siea faele e hlakileng ea mongolo e bitsoang thuso-vir.txt hore re e nolofaletse bophelo ho ba kenang le Super Command ena bakeng sa tsamaiso le taolo ea Hypervisors le Virtual Machines tsa bona.

Re khothaletsa haholo leka liteko tse kantle ho tikoloho ea tlhahiso.


Litaba tsa sengoloa sena li latela melao-motheo ea rona ea melao ea boitšoaro ea bongoli. Ho tlaleha phoso tlanya mona.

Maikutlo a 7, siea ea hau

Siea maikutlo a hau

aterese ya hao ya imeile ke ke ho phatlalatswa. masimo a hlokahala a tšoailoe ka *

*

*

  1. E ikarabella bakeng sa data: Miguel Ángel Gatón
  2. Morero oa data: Laola SPAM, tsamaiso ea maikutlo.
  3. Molao: Tumello ea hau
  4. Puisano ea data: Lintlha li ke ke tsa tsebisoa batho ba boraro ntle le ka tlamo ea molao.
  5. Polokelo ea data: Database e hapiloeng ke Occentus Networks (EU)
  6. Litokelo: Nako efe kapa efe o ka fokotsa, oa hlaphoheloa mme oa hlakola tlhaiso-leseling ea hau.

  1.   sethoto a re

    Ke kopa ho sebelisa Virsh bakeng sa lintho tse ling, hajoale ke metheo feela, qala, emisa, ntho e ngoe le e ngoe eo ke e sebelisang mosa oa bo-mpoli, ke rata hore o ka ba le li-server tsa N tse sebelisang libvirt mme o li laole ho tloha mosebetsing oa hau o nang le manejara ea mosa.

  2.   federico a re

    Dumela tsala Dhunter !!! Ke se ke le mosebetsing. Khoasolla file virsh-help.txt e tla u thusa haholo. Ke e entse ka virsh console ka boeona, ebe ke etsa script ho e tlatsa. Ke nahana hore, ho hlophisoa ke mantsoe a bohlokoa a thuso, e ea noa. Sehloohong se latelang ke ama lihlooho tse ling tsa taelo ena.

  3.   Zodiac ea Carburus a re

    Lumeliso Federico. Ke latetse lingoloa tsa hau tse khahlisang ho li-SME. Ho bonolo haholo ho sebelisa console bakeng sa tsamaiso e potlakileng le e sebetsang. Ba boetse ba sebelisa lisebelisoa tse fokolang. Ke emetse liphallelo tse latelang.

  4.   crespo88 a re

    Hantle Federico, u se u kopane le nna. Ke leboha mpho ena eo u re fileng eona. Poso e ntle, esale ke emetse sengoloa sena ka virsh. Kea leboha moena, bohle re tla tseba ho e sebelisa ka nepo.

  5.   FEIE a re

    Oa amohela, Crespo88. Bakeng sa seo re leng ho DesdeLinux.

  6.   Ismael Alvarez Wong a re

    hello, ke ile ka makatsoa ke bokhoni ba taelo ea virsh, ha ke fumane mantsoe a ho hlalosa seo ke se nahanang ka eona, se makatsang, mme seo u se pepesang posong ke borashe feela, u sebelisa mantsoe a hau «Ho fihlela joale re na le tsamaea ka sekepe mabopong a Leoatle la Virsh. "
    e na le thuso haholo ha u hlalosa mokhoa oa ho etsa lipatlisiso ka ts'ebeliso ea ts'oaetso u sebelisa mantsoe a hau a bohlokoa.
    mohlala o moholo o ntlafalitsoeng oa Theha setšoantšo sa disk ka molumo ebe o Join (eketsa) ho domain (kapa MV) e nang le virsh; ebe ho tloha WK sysadmin ea rona e hokahantsoe ke SSH ho domain le kahare ho eona, theha karohano le sistimi ea eona ea file ea ext4 hore qetellong e hlole ho fstab.
    Ha ho letho leo u lokelang ho le latela ka lipehelo tse latelang letotong la bok qemu-kvm mme re leboha haholo ka ho arolelana tsena tsohle.

    1.    federico a re

      U fumane moko-taba oa molaetsa, motsoalle Wong. Haeba feela ka kenyelletso ea taelo ea Virsh, ho ka etsoa mehlolo, hobaneng o sa tsoelepele ka ho ithuta le ho e sebelisa. Moferefere ke, ka tlhaloso, sehokelo sa Qemu-KVM, se emotsoeng ke baetsi ba sona ho Red Hat, Inc mme se tšehelitsoe ke k'hamphani e kholo eo. Le ha re tseba hore ho na le likarolo tse ling tse joalo ka Virt-Manager le oVirt, Virsh e ntse e le eona e felletseng ho sebetsana le laeborari libvirt. Kea leboha motsoalle Wong ka litlhaloso tsa hau tsa bohlokoa.