Difference between revisions of "Manage VM in console"

From vpsget wiki
Jump to: navigation, search
Line 1: Line 1:
 
Notice: 101 is taken as a sample vmID which should be altered with actual vmID.
 
  
 
== '''KVM''' ==
 
== '''KVM''' ==
Line 13: Line 11:
 
Soft shutdown VM. This will sent shutdown command to VMs OS.
 
Soft shutdown VM. This will sent shutdown command to VMs OS.
 
<pre>
 
<pre>
virsh shutdown kvm101
+
virsh shutdown kvm<ID>  #for example kvm101
 
</pre>
 
</pre>
 
Soft reboot VM
 
Soft reboot VM
 
<pre>
 
<pre>
virsh reboot kvm101
+
virsh reboot kvm<ID>
 
</pre>
 
</pre>
 
Hard power off. This will be equal to unplugging power cord from physical machine.
 
Hard power off. This will be equal to unplugging power cord from physical machine.
 
<pre>
 
<pre>
virsh destroy kvm101
+
virsh destroy kvm<ID>
 
</pre>
 
</pre>
 
Hard power on
 
Hard power on
 
<pre>
 
<pre>
virsh start kvm101
+
virsh start kvm<ID>
 
</pre>
 
</pre>
 
For extended description refer to man virsh.
 
For extended description refer to man virsh.
Line 37: Line 35:
 
Stop container:
 
Stop container:
 
<pre>
 
<pre>
vzctl stop 101
+
vzctl stop <vmID>
 
</pre>
 
</pre>
 
Srart container:
 
Srart container:
 
<pre>
 
<pre>
vzctl start 101
+
vzctl start <vmID>
 
</pre>
 
</pre>
 
Restart container:
 
Restart container:
 
<pre>
 
<pre>
vzctl restart 101
+
vzctl restart <vmID>
 
</pre>
 
</pre>
 
Create container:
 
Create container:
 
<pre>
 
<pre>
vzctl create 101
+
vzctl create <vmID>
 
</pre>
 
</pre>
 +
More details about CT creation: http://openvz.org/Configuring_container_creation<br/>
 
Remove container:
 
Remove container:
 
<pre>
 
<pre>

Revision as of 14:12, 1 April 2013

KVM

Show all Virtual Machines (logical volumes):

lvdisplay

Show state of Virtual Machines:

virsh list --all

Soft shutdown VM. This will sent shutdown command to VMs OS.

virsh shutdown kvm<ID>  #for example kvm101

Soft reboot VM

virsh reboot kvm<ID>

Hard power off. This will be equal to unplugging power cord from physical machine.

virsh destroy kvm<ID>

Hard power on

virsh start kvm<ID>

For extended description refer to man virsh.

OpenVZ

Show all OpenVZ containers:

vzlist -a

Stop container:

vzctl stop <vmID>

Srart container:

vzctl start <vmID>

Restart container:

vzctl restart <vmID>

Create container:

vzctl create <vmID>

More details about CT creation: http://openvz.org/Configuring_container_creation
Remove container:

vzctl destroy

For extended description refer to man vzctl. ""