SYS: Start and stop virtual machines.

Share this link

Note: This is an RHCSA 7 exam objective.

Presentation

When talking about virtual machines, it is mainly question of KVM management through the virsh and virt-* commands.

VM Management

To start a virtual machine (here vm.example.com), type:

# virsh start vm.example.com

To stop a virtual machine (here vm.example.com), type:

# virsh shutdown vm.example.com

To stop immediately a virtual machine (here vm.example.com), type:

# virsh destroy vm.example.com

To delete a virtual machine (here vm.example.com), type:

# virsh undefine vm.example.com

To reboot a virtual machine (here vm.example.com), type:

# virsh reboot vm.example.com

To display configuration information (memory, state, autostart, etc) about a virtual machine (here vm.example.com), type:

# virsh dominfo vm.example.com

VM Reporting

To get the list of all the virtual machines (active and inactive), type:

# virsh list --all

Note: Remove the –all option to only get the list of the active virtual machines.

To get a global picture of the VM activities, type:

# virt-top
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...

Leave a Reply

Please Login to comment
  Subscribe  
Notify of

RHCSA7: Task of the day

Allowed time: 10 minutes.
Create a XFS file system of 100MB. Mount it under /mnt. Then, increase its size by 50MB.

RHCE7: Task of the day

Allowed time: 8 minutes.
Set up an iScsi target based on a fileio backstore of 100MB called /opt/shareddata with CHAP authentication (username=usr/password=pwd), xfs filesystem and standard firewall configuration.

Follow me on Twitter

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...