Changes

Jump to: navigation, search

OPS245 Lab 2 dev

14 bytes removed, 23:14, 29 January 2023
Part 3: Using the Command Line for VM State Management
:'''Perform the following steps:'''
# Start the '''centos1rhel1''' virtual machine, and stop the '''centos2rhel2''' and '''centos3rhel3''' virtual machines.# Switch to the '''c7hostr9host''' machine, and open a shell terminal.# Enter these admin commands into your '''c7hostr9host''' machine and note the result:
:: <b><code><span style="color:#3366CC;font-size:1.2em;">sudo virsh list</span></code></b>
:: <b><code><span style="color:#3366CC;font-size:1.2em;">sudo virsh list --all</span></code></b>
:: <b><code><span style="color:#3366CC;font-size:1.2em;">sudo virsh list --inactive</span></code></b>
<ol><li value="4">Now, shut-down your centos1 rhel1 VM normally, and close the centos1 rhel1 VM window.</li><li>Switch to your terminal and issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">sudo virsh start centos1rhel1</span></code></b></li><li>Using the appropriate command check to see if your centos1 rhel1 VM is now running.</li><li>There are other commands that can be used (such as '''suspend''', or '''shutdown'''). The "shutdown" command may not always work since it relies on the guest handling a particular ACPI event. Why do you think it is useful to have commands to manipulate VMs?</li></ol>
{{Admon/important|Virtual Machine Does not Shutdown from Command|If the Virtual machine fails to shutdown from the <code>virsh shutdown</code> command, then you can go to the '''Virtual Machine manager''' and '''halt''' or '''shutdown''' within the VM itself, then you can click the '''PowerOff''' button in the VM window. You'll want to avoid a forced shutdown since those are equivalent to yanking the power cord out of the wall on a physical machine!|}}
<br/>

Navigation menu