Basic KVM Operations with Virish command
Virsh Command Operation.
Note: test and cent are virtual machine names which I have created in my lab.
> List of active virtual machines.
Command: #virsh list
test: Virtual machine name which is ruining currently.
> List of all virtual machines.
Command: #virsh list --all
test: Virtual machine name which is ruining currently.
cent: Switch off Virtual machine.
> Shutdown virtual machine.
Command: #virsh shutdown <virtual machine name >
In the following screen shot "test" is a virtual machine name.
> Suspend virtual machine
Command: #virsh suspend cent
Pause virtual machine cent on current state.
> Resume suspended virtual machine.
Command: #virsh resume cent
Resume virtual machine cent.
> Switch console of guest virtual machine.
Command: #virsh console test
Opening console of test virtual machine.
> Start power off virtual machine.
Command: #virsh start cent
Start virtual machine cent.
> Restart virtual machine. ( Soft reboot machine )
Command: #virsh reboot cent
Reboot virtual machine cent
> Reset virtual machine. ( Hard reboot machine )
Command: #virsh reset cent
Reset virtual machine cent.
> Check command parameters of virsh command.
Command: #virsh --help
Display all the virsh command options.
> Edit virtual machine's xml configuration file.
Command: #virsh edit cent
Edit xml file of virtual machine cent
Following edit menu will open once press Enter key.
Once editing done press :wq to save and exit the file.
> Save virtual machine current-state in file.
Command: #virsh save cent centfile
cent: This is virtual machine name
centfile: This is file name given to save the current state of virtual machine.
> Restore virtual machine from saved file.
Command: #virsh restore centfile
centfile is store a virtual machine state data.
> Virtual machine mark for auto start
Command: #virsh autostart cent
Virtual machine cent mark for auto start.
> Disable virtual machine for auto start
Command: #virsh autostart --disable cent
> Show virsh version
Command: #virsh version
EOF
Note: test and cent are virtual machine names which I have created in my lab.
> List of active virtual machines.
Command: #virsh list
test: Virtual machine name which is ruining currently.
> List of all virtual machines.
Command: #virsh list --all
test: Virtual machine name which is ruining currently.
cent: Switch off Virtual machine.
> Shutdown virtual machine.
Command: #virsh shutdown <virtual machine name >
In the following screen shot "test" is a virtual machine name.
> Suspend virtual machine
Command: #virsh suspend cent
Pause virtual machine cent on current state.
> Resume suspended virtual machine.
Command: #virsh resume cent
Resume virtual machine cent.
> Switch console of guest virtual machine.
Command: #virsh console test
Opening console of test virtual machine.
> Start power off virtual machine.
Command: #virsh start cent
Start virtual machine cent.
> Restart virtual machine. ( Soft reboot machine )
Command: #virsh reboot cent
Reboot virtual machine cent
> Reset virtual machine. ( Hard reboot machine )
Command: #virsh reset cent
Reset virtual machine cent.
> Check command parameters of virsh command.
Command: #virsh --help
Display all the virsh command options.
> Edit virtual machine's xml configuration file.
Command: #virsh edit cent
Edit xml file of virtual machine cent
Following edit menu will open once press Enter key.
Once editing done press :wq to save and exit the file.
> Save virtual machine current-state in file.
Command: #virsh save cent centfile
cent: This is virtual machine name
centfile: This is file name given to save the current state of virtual machine.
> Restore virtual machine from saved file.
Command: #virsh restore centfile
centfile is store a virtual machine state data.
> Virtual machine mark for auto start
Command: #virsh autostart cent
Virtual machine cent mark for auto start.
> Disable virtual machine for auto start
Command: #virsh autostart --disable cent
> Show virsh version
Command: #virsh version
EOF
Comments
Post a Comment