差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| linux:qemu-kvm:virsh [2019/01/04 11:18] – [ゲストの一覧表示] ともやん | linux:qemu-kvm:virsh [2023/09/07 09:16] (現在) – ともやん | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| ====== virsh による仮想マシンの操作 ====== | ====== virsh による仮想マシンの操作 ====== | ||
| + | |||
| ===== ゲストの一覧表示 ===== | ===== ゲストの一覧表示 ===== | ||
| - | <code> | + | <WRAP color_term> | 
| - | $ sudo virsh list --all | + | <WRAP color_command>< | 
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result>< | ||
|  |  | ||
| ---------------------------------------------------- | ---------------------------------------------------- | ||
| 行 9: | 行 13: | ||
|  |  | ||
| - | </code> | + | </pre></ | 
| + | </WRAP> | ||
| ===== ゲストの自動起動 ===== | ===== ゲストの自動起動 ===== | ||
| - | + | <WRAP color_term> | |
| - | <code> | + | <WRAP color_command>< | 
| - | $ sudo virsh autostart CentOS_6_x86_64_001 | + | <b class=GRN> | 
| + | </ | ||
| + | <WRAP color_result>< | ||
| ドメイン CentOS_6_x86_64_001 が自動起動に設定されました | ドメイン CentOS_6_x86_64_001 が自動起動に設定されました | ||
| - | </code> | + | </pre></ | 
| + | </WRAP> | ||
| ===== ゲストの自動起動解除 ===== | ===== ゲストの自動起動解除 ===== | ||
| - | <code> | + | <WRAP color_term> | 
| - | $ sudo virsh autostart CentOS_6_x86_64_001 | + | <WRAP color_command>< | 
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result>< | ||
| ドメイン CentOS_6_x86_64_001 が自動起動設定が解除されました | ドメイン CentOS_6_x86_64_001 が自動起動設定が解除されました | ||
| - | </code> | + | </pre></ | 
| + | </WRAP> | ||
| ===== ゲストの起動 ===== | ===== ゲストの起動 ===== | ||
| - | <code> | + | <WRAP color_term> | 
| - | $ sudo virsh start CentOS_6_x86_64_001 | + | <WRAP color_command>< | 
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result>< | ||
| ドメイン CentOS_6_x86_64_001 が起動されました | ドメイン CentOS_6_x86_64_001 が起動されました | ||
| - | </code> | + | </pre></ | 
| + | </WRAP> | ||
| ===== ゲストの休止 ===== | ===== ゲストの休止 ===== | ||
| - | <code> | + | <WRAP color_term> | 
| - | $ sudo virsh suspend CentOS_6_x86_64_001 | + | <WRAP color_command>< | 
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result>< | ||
| ドメイン CentOS_6_x86_64_001 は一時停止されました | ドメイン CentOS_6_x86_64_001 は一時停止されました | ||
| - | </code> | + | </pre></ | 
| + | </WRAP> | ||
| ===== ゲストの復帰 ===== | ===== ゲストの復帰 ===== | ||
| - | <code> | + | <WRAP color_term> | 
| - | $ sudo virsh resume CentOS_6_x86_64_001 | + | <WRAP color_command>< | 
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result>< | ||
| ドメイン CentOS_6_x86_64_001 が再開されました | ドメイン CentOS_6_x86_64_001 が再開されました | ||
| - | </code> | + | </pre></ | 
| + | </WRAP> | ||
| ===== ゲストの状態を保存して停止 ===== | ===== ゲストの状態を保存して停止 ===== | ||
| - | <code> | + | <WRAP color_term> | 
| - | $ sudo virsh save CentOS_6_x86_64_001 savefile | + | <WRAP color_command>< | 
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result>< | ||
| ドメイン CentOS_6_x86_64_001 が savefile に保存されました | ドメイン CentOS_6_x86_64_001 が savefile に保存されました | ||
| - | </code> | + | </pre></ | 
| + | </WRAP> | ||
| ===== ゲストを保存ファイルから復帰 ===== | ===== ゲストを保存ファイルから復帰 ===== | ||
| - | <code> | + | <WRAP color_term> | 
| - | $ sudo virsh restore savefile | + | <WRAP color_command>< | 
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result>< | ||
| ドメインが savefile から復元されました | ドメインが savefile から復元されました | ||
| - | </code> | + | </pre></ | 
| + | </WRAP> | ||
| ===== ゲストのシャットダウン ===== | ===== ゲストのシャットダウン ===== | ||
| - | <code> | + | <WRAP color_term> | 
| - | $ sudo virsh shutdown CentOS_6_x86_64_001 | + | <WRAP color_command>< | 
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result>< | ||
| ドメイン CentOS_6_x86_64_001 をシャットダウンしています | ドメイン CentOS_6_x86_64_001 をシャットダウンしています | ||
| - | </code> | + | </pre></ | 
| + | </ | ||
| ===== ゲストの再起動 ===== | ===== ゲストの再起動 ===== | ||
| - | <code> | + | <WRAP color_term> | 
| - | $ sudo virsh reboot CentOS_6_x86_64_001 | + | <WRAP color_command>< | 
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result>< | ||
| ドメイン CentOS_6_x86_64_001 を再起動しています | ドメイン CentOS_6_x86_64_001 を再起動しています | ||
| - | </code> | + | </pre></ | 
| + | </WRAP> | ||
| ===== ゲストの強制停止 ===== | ===== ゲストの強制停止 ===== | ||
| - | <code> | + | <WRAP color_term> | 
| - | $ sudo virsh destroy CentOS_6_x86_64_001 | + | <WRAP color_command>< | 
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result>< | ||
| ドメイン CentOS_6_x86_64_001 は強制停止されました | ドメイン CentOS_6_x86_64_001 は強制停止されました | ||
| - | </code> | + | </pre></ | 
| + | </WRAP> | ||
| ===== ドメインのディスプレイ接続URI ===== | ===== ドメインのディスプレイ接続URI ===== | ||
| - | <code> | + | <WRAP color_term> | 
| - | $ sudo virsh domdisplay CentOS_6_x86_64_001 | + | <WRAP color_command>< | 
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result>< | ||
| spice:// | spice:// | ||
| - | </code> | + | </pre></ | 
| + | </WRAP> | ||
| ===== ドメインの編集 ===== | ===== ドメインの編集 ===== | ||
| - | <code> | + | <WRAP color_term> | 
| - | $ sudo virsh edit CentOS_6_x86_64_001 | + | <WRAP color_command>< | 
| - | </code> | + | <b class=GRN> | 
| + | </pre></ | ||
| + | <WRAP color_result>< | ||
| + | </ | ||
| + | </ | ||
| ==== ハイパーバイザーの変更 ==== | ==== ハイパーバイザーの変更 ==== | ||
| kvm -> qemu | kvm -> qemu | ||
| - | <code xml> | + | <WRAP color_term> | 
| + | <WRAP color_mincode> | ||
| <domain type=' | <domain type=' | ||
| < | < | ||
| 行 97: | 行 149: | ||
| < | < | ||
| <memory unit=' | <memory unit=' | ||
| - | </ | + | </ | 
| + | </ | ||
| + | |||
| + | ===== CPU モデルの表示 [cpu-models] ===== | ||
| + | <WRAP color_term> | ||
| + | <WRAP color_command>< | ||
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result_long>< | ||
| + | 486 | ||
| + | pentium | ||
| + | pentium2 | ||
| + | pentium3 | ||
| + | pentiumpro | ||
| + | coreduo | ||
| + | n270 | ||
| + | core2duo | ||
| + | qemu32 | ||
| + | kvm32 | ||
| + | cpu64-rhel5 | ||
| + | cpu64-rhel6 | ||
| + | qemu64 | ||
| + | kvm64 | ||
| + | Conroe | ||
| + | Penryn | ||
| + | Nehalem | ||
| + | Nehalem-IBRS | ||
| + | Westmere | ||
| + | Westmere-IBRS | ||
| + | SandyBridge | ||
| + | SandyBridge-IBRS | ||
| + | IvyBridge | ||
| + | IvyBridge-IBRS | ||
| + | Haswell-noTSX | ||
| + | Haswell-noTSX-IBRS | ||
| + | Haswell | ||
| + | Haswell-IBRS | ||
| + | Broadwell-noTSX | ||
| + | Broadwell-noTSX-IBRS | ||
| + | Broadwell | ||
| + | Broadwell-IBRS | ||
| + | Skylake-Client | ||
| + | Skylake-Client-IBRS | ||
| + | Skylake-Client-noTSX-IBRS | ||
| + | Skylake-Server | ||
| + | Skylake-Server-IBRS | ||
| + | Skylake-Server-noTSX-IBRS | ||
| + | Cascadelake-Server | ||
| + | Cascadelake-Server-noTSX | ||
| + | Icelake-Client | ||
| + | Icelake-Client-noTSX | ||
| + | Icelake-Server | ||
| + | Icelake-Server-noTSX | ||
| + | Cooperlake | ||
| + | Snowridge | ||
| + | athlon | ||
| + | phenom | ||
| + | Opteron_G1 | ||
| + | Opteron_G2 | ||
| + | Opteron_G3 | ||
| + | Opteron_G4 | ||
| + | Opteron_G5 | ||
| + | EPYC | ||
| + | EPYC-IBPB | ||
| + | EPYC-Rome | ||
| + | EPYC-Milan | ||
| + | Dhyana | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== ヘルプ [help] ===== | ||
| + | <WRAP color_term> | ||
| + | <WRAP color_command>< | ||
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result_long>< | ||
| + | グループ別コマンド: | ||
| + | |||
| + |  | ||
| + | attach-device | ||
| + | attach-disk | ||
| + | attach-interface | ||
| + | autostart | ||
| + | blkdeviotune | ||
| + | blkiotune | ||
| + | blockcommit | ||
| + | blockcopy | ||
| + | blockjob | ||
| + | blockpull | ||
| + | blockresize | ||
| + | change-media | ||
| + | console | ||
| + | cpu-stats | ||
| + | create | ||
| + | define | ||
| + | desc | ||
| + | destroy | ||
| + | detach-device | ||
| + | detach-device-alias | ||
| + | detach-disk | ||
| + | detach-interface | ||
| + | domdisplay | ||
| + | domfsfreeze | ||
| + | domfsthaw | ||
| + | domfsinfo | ||
| + | domfstrim | ||
| + | domhostname | ||
| + | domid ドメイン名または UUID からドメイン ID への変換 | ||
| + | domif-setlink | ||
| + | domiftune | ||
| + | domjobabort | ||
| + | domjobinfo | ||
| + | domlaunchsecinfo | ||
| + | domsetlaunchsecstate | ||
| + | domname | ||
| + | domrename | ||
| + | dompmsuspend | ||
| + | dompmwakeup | ||
| + | domuuid | ||
| + | domxml-from-native | ||
| + | domxml-to-native | ||
| + | dump | ||
| + | dumpxml | ||
| + | edit | ||
| + | event Domain Events | ||
| + | get-user-sshkeys | ||
| + | inject-nmi | ||
| + | iothreadinfo | ||
| + | iothreadpin | ||
| + | iothreadadd | ||
| + | iothreadset | ||
| + | iothreaddel | ||
| + | send-key | ||
| + | send-process-signal | ||
| + | lxc-enter-namespace | ||
| + | managedsave | ||
| + | managedsave-remove | ||
| + | managedsave-edit | ||
| + | managedsave-dumpxml | ||
| + | managedsave-define | ||
| + | memtune | ||
| + | perf Get or set perf event | ||
| + | metadata | ||
| + | migrate | ||
| + | migrate-setmaxdowntime | ||
| + | migrate-getmaxdowntime | ||
| + | migrate-compcache | ||
| + | migrate-setspeed | ||
| + | migrate-getspeed | ||
| + | migrate-postcopy | ||
| + | numatune | ||
| + | qemu-attach | ||
| + | qemu-monitor-command | ||
| + | qemu-monitor-event | ||
| + | qemu-agent-command | ||
| + | guest-agent-timeout | ||
| + | reboot | ||
| + | reset ドメインのリセット | ||
| + | restore | ||
| + | resume | ||
| + | save | ||
| + | save-image-define | ||
| + | save-image-dumpxml | ||
| + | save-image-edit | ||
| + | schedinfo | ||
| + | screenshot | ||
| + | set-lifecycle-action | ||
| + | set-user-sshkeys | ||
| + | set-user-password | ||
| + | setmaxmem | ||
| + | setmem | ||
| + | setvcpus | ||
| + | shutdown | ||
| + | start 停止状態の(定義済み)ドメインの起動 | ||
| + | suspend | ||
| + | ttyconsole | ||
| + | undefine | ||
| + | update-device | ||
| + | update-memory-device | ||
| + | vcpucount | ||
| + | vcpuinfo | ||
| + | vcpupin | ||
| + | emulatorpin | ||
| + | vncdisplay | ||
| + | guestvcpus | ||
| + | setvcpu | ||
| + | domblkthreshold | ||
| + | guestinfo | ||
| + | domdirtyrate-calc | ||
| + | |||
| + |  | ||
| + | domblkerror | ||
| + | domblkinfo | ||
| + | domblklist | ||
| + | domblkstat | ||
| + | domcontrol | ||
| + | domif-getlink | ||
| + | domifaddr | ||
| + | domiflist | ||
| + | domifstat | ||
| + | dominfo | ||
| + | dommemstat | ||
| + | domstate | ||
| + | domstats | ||
| + | domtime | ||
| + | list | ||
| + | |||
| + | Host and Hypervisor (ヘルプのキーワード ' | ||
| + | allocpages | ||
| + | capabilities | ||
| + | cpu-baseline | ||
| + | cpu-compare | ||
| + | cpu-models | ||
| + | domcapabilities | ||
| + | freecell | ||
| + | freepages | ||
| + | hostname | ||
| + | hypervisor-cpu-baseline | ||
| + | hypervisor-cpu-compare | ||
| + | maxvcpus | ||
| + | node-memory-tune | ||
| + | nodecpumap | ||
| + | nodecpustats | ||
| + | nodeinfo | ||
| + | nodememstats | ||
| + | nodesevinfo | ||
| + | nodesuspend | ||
| + | sysinfo | ||
| + | uri ハイパーバイザーの正規化 URI の表示 | ||
| + | version | ||
| + | |||
| + |  | ||
| + | checkpoint-create | ||
| + | checkpoint-create-as | ||
| + | checkpoint-delete | ||
| + | checkpoint-dumpxml | ||
| + | checkpoint-edit | ||
| + | checkpoint-info | ||
| + | checkpoint-list | ||
| + | checkpoint-parent | ||
| + | |||
| + |  | ||
| + | iface-begin | ||
| + | iface-bridge | ||
| + | iface-commit | ||
| + | iface-define | ||
| + | iface-destroy | ||
| + | iface-dumpxml | ||
| + | iface-edit | ||
| + | iface-list | ||
| + | iface-mac | ||
| + | iface-name | ||
| + | iface-rollback | ||
| + | iface-start | ||
| + | iface-unbridge | ||
| + | iface-undefine | ||
| + | |||
| + |  | ||
| + | nwfilter-define | ||
| + | nwfilter-dumpxml | ||
| + | nwfilter-edit | ||
| + | nwfilter-list | ||
| + | nwfilter-undefine | ||
| + | nwfilter-binding-create | ||
| + | nwfilter-binding-delete | ||
| + | nwfilter-binding-dumpxml | ||
| + | nwfilter-binding-list | ||
| + | |||
| + |  | ||
| + | net-autostart | ||
| + | net-create | ||
| + | net-define | ||
| + | net-destroy | ||
| + | net-dhcp-leases | ||
| + | net-dumpxml | ||
| + | net-edit | ||
| + | net-event | ||
| + | net-info | ||
| + | net-list | ||
| + | net-name | ||
| + | net-start | ||
| + | net-undefine | ||
| + | net-update | ||
| + | net-uuid | ||
| + | net-port-list | ||
| + | net-port-create | ||
| + | net-port-dumpxml | ||
| + | net-port-delete | ||
| + | |||
| + | Node Device (ヘルプのキーワード ' | ||
| + | nodedev-create | ||
| + | nodedev-destroy | ||
| + | nodedev-detach | ||
| + | nodedev-dumpxml | ||
| + | nodedev-list | ||
| + | nodedev-reattach | ||
| + | nodedev-reset | ||
| + | nodedev-event | ||
| + | nodedev-define | ||
| + | nodedev-undefine | ||
| + | nodedev-start | ||
| + | nodedev-autostart | ||
| + | nodedev-info | ||
| + | |||
| + |  | ||
| + | secret-define | ||
| + | secret-dumpxml | ||
| + | secret-event | ||
| + | secret-get-value | ||
| + | secret-list | ||
| + | secret-set-value | ||
| + | secret-undefine | ||
| + | |||
| + |  | ||
| + | snapshot-create | ||
| + | snapshot-create-as | ||
| + | snapshot-current | ||
| + | snapshot-delete | ||
| + | snapshot-dumpxml | ||
| + | snapshot-edit | ||
| + | snapshot-info | ||
| + | snapshot-list | ||
| + | snapshot-parent | ||
| + | snapshot-revert | ||
| + | |||
| + |  | ||
| + | backup-begin | ||
| + | backup-dumpxml | ||
| + | |||
| + |  | ||
| + | find-storage-pool-sources-as | ||
| + | find-storage-pool-sources | ||
| + | pool-autostart | ||
| + | pool-build | ||
| + | pool-create-as | ||
| + | pool-create | ||
| + | pool-define-as | ||
| + | pool-define | ||
| + | pool-delete | ||
| + | pool-destroy | ||
| + | pool-dumpxml | ||
| + | pool-edit | ||
| + | pool-info | ||
| + | pool-list | ||
| + | pool-name | ||
| + | pool-refresh | ||
| + | pool-start | ||
| + | pool-undefine | ||
| + | pool-uuid | ||
| + | pool-event | ||
| + | pool-capabilities | ||
| + | |||
| + |  | ||
| + | vol-clone | ||
| + | vol-create-as | ||
| + | vol-create | ||
| + | vol-create-from | ||
| + | vol-delete | ||
| + | vol-download | ||
| + | vol-dumpxml | ||
| + | vol-info | ||
| + | vol-key | ||
| + | vol-list | ||
| + | vol-name | ||
| + | vol-path | ||
| + | vol-pool | ||
| + | vol-resize | ||
| + | vol-upload | ||
| + | vol-wipe | ||
| + | |||
| + | Virsh itself (ヘルプのキーワード ' | ||
| + | cd | ||
| + | echo echo arguments. Used for internal testing. | ||
| + | exit | ||
| + | help | ||
| + | pwd カレントディレクトリーの表示 | ||
| + | quit | ||
| + | connect | ||
| + | |||
| + | |||
| + | </ | ||
| + | </ | ||