Version 14 vs 15
Version 14 vs 15
Content Changes
Content Changes
==Waking up a VM
When the monitor of the VM is off, you can ssh to the host machine to see if the host machine is not turn off accidentally.
If the host machine is on(which means that you can ssh to it), you can check the status of the corresponding VM by :
Use `systemctl status hmux@ecc-a-(machine number)` to check the status of the vms.
Use `uptime` to check how long the machine have been running.
``` lang=bash
# systemctl status hmux@ecc-(Lab)-(Machine Number)
$ systemctl status hmux@ecc-a-09
```
To wake up the vm
``` lang=bash
# socat - UNIX-CONNECT:/var/run/qemu/ecc-(Lab)-(Machine Number)/monitor
$ socat - UNIX-CONNECT:/var/run/qemu/ecc-a-09/monitor
```
IMPORTANT: In socat, do not just quit using the {key q} or type in `quit` because that will completely shutdown the virtual machine. Use {key Ctrl C} to exit the current session.
==VM is not responding
To gently shutdown the vm, first login to the host machine and connect to the monitor file as root
``` lang=bash
$ socat - UNIX-CONNECT:/var/run/qemu/ecc-a-${COMP_NUMBER}/monitor
```
Once connected to the monitor, type **quit** and the machine should attempt to shutdown gracefully.
If the machine is still not responding, a more forceful command will be required. First, find the process id of the rogue VM
``` lang=bash
$ ps aux | grep qemu
```
This will output the processes being run with qemu, one of which should be the machine that is causing issues. Once the correct pid is found, kill the process by typing
``` lang=bash
$ sudo kill ${pid}
```
==Qemu Host not responding to start command
If the virtual machines are not responding after the the host restarted, use the unbind script with the following command with root.
``` lang=bash
$ /var/qemu/unbind.sh
```
NOTE: ecc-a-qemu04.rd.unr.edu would mostly encounter this issue.
==Create a new Virtual Machine
1. ssh to the host machine
2. get root access by entering `$ sudo su`
3. `$ cd /var/tmp`
4. `$ ls` to make sure `win10.iso` and `virtio.iso` are within the directory
5. Remove the old volume
``` lang=bash
# lvremove (volume group)/(Vm name)
$ lvremove vg0/ecc-a-17
```
6. Create a new blank volume:
``` lang=bash
# lvcreate (Size) -n (Vm name ) (volume group)
$ lvcreate -L300G -n ecc-a-17 vg0
```
==Waking up a VM
When the monitor of the VM is off, you can ssh to the host machine to see if the host machine is not turn off accidentally.
If the host machine is on(which means that you can ssh to it), you can check the status of the corresponding VM by :
Use `systemctl status hmux@ecc-a-(machine number)` to check the status of the vms.
Use `uptime` to check how long the machine have been running.
``` lang=bash
# systemctl status hmux@ecc-(Lab)-(Machine Number)
$ systemctl status hmux@ecc-a-09
```
To wake up the vm
``` lang=bash
# socat - UNIX-CONNECT:/var/run/qemu/ecc-(Lab)-(Machine Number)/monitor
$ socat - UNIX-CONNECT:/var/run/qemu/ecc-a-09/monitor
```
IMPORTANT: In socat, do not just quit using the {key q} or type in `quit` because that will completely shutdown the virtual machine. Use {key Ctrl C} to exit the current session.
==VM is not responding
# Try to **Stop** Vms:
``` lang=bash
# systemctl stop hmux@ecc-(Lab)-(Machine Number)
$ systemctl stop hmux@ecc-a-01
```
# If Stop Does Not Work, Use **Socat**
To gently shutdown the vm, first login to the host machine and connect to the monitor file as root
``` lang=bash
$ socat - UNIX-CONNECT:/var/run/qemu/ecc-a-${COMP_NUMBER}/monitor
```
Once connected to the monitor, type **quit** and the machine should attempt to shutdown gracefully.
# If Stop and Socat Do Not Work, **Kill the Proccess**
If the machine is still not responding, a more forceful command will be required. First, find the process id of the rogue VM
``` lang=bash
$ ps aux | grep qemu
```
This will output the processes being run with qemu, one of which should be the machine that is causing issues. Once the correct pid is found, kill the process by typing
``` lang=bash
$ sudo kill ${pid}
```
==Qemu Host not responding to start command
If the virtual machines are not responding after the the host restarted, use the unbind script with the following command with root.
``` lang=bash
$ /var/qemu/unbind.sh
```
NOTE: ecc-a-qemu04.rd.unr.edu would mostly encounter this issue.
==Create a new Virtual Machine
1. ssh to the host machine
2. get root access by entering `$ sudo su`
3. `$ cd /var/tmp`
4. `$ ls` to make sure `win10.iso` and `virtio.iso` are within the directory
5. Remove the old volume
``` lang=bash
# lvremove (volume group)/(Vm name)
$ lvremove vg0/ecc-a-17
```
6. Create a new blank volume:
``` lang=bash
# lvcreate (Size) -n (Vm name ) (volume group)
$ lvcreate -L300G -n ecc-a-17 vg0
```
==Waking up a VM
When the monitor of the VM is off, you can ssh to the host machine to see if the host machine is not turn off accidentally.
If the host machine is on(which means that you can ssh to it), you can check the status of the corresponding VM by :
Use `systemctl status hmux@ecc-a-(machine number)` to check the status of the vms.
Use `uptime` to check how long the machine have been running.
``` lang=bash
# systemctl status hmux@ecc-(Lab)-(Machine Number)
$ systemctl status hmux@ecc-a-09
```
To wake up the vm
``` lang=bash
# socat - UNIX-CONNECT:/var/run/qemu/ecc-(Lab)-(Machine Number)/monitor
$ socat - UNIX-CONNECT:/var/run/qemu/ecc-a-09/monitor
```
IMPORTANT: In socat, do not just quit using the {key q} or type in `quit` because that will completely shutdown the virtual machine. Use {key Ctrl C} to exit the current session.
==VM is not responding
# Try to **Stop** Vms:
``` lang=bash
# systemctl stop hmux@ecc-(Lab)-(Machine Number)
$ systemctl stop hmux@ecc-a-01
```
# If Stop Does Not Work, Use **Socat**
To gently shutdown the vm, first login to the host machine and connect to the monitor file as root
``` lang=bash
$ socat - UNIX-CONNECT:/var/run/qemu/ecc-a-${COMP_NUMBER}/monitor
```
Once connected to the monitor, type **quit** and the machine should attempt to shutdown gracefully.
# If Stop and Socat Do Not Work, **Kill the Proccess**
If the machine is still not responding, a more forceful command will be required. First, find the process id of the rogue VM
``` lang=bash
$ ps aux | grep qemu
```
This will output the processes being run with qemu, one of which should be the machine that is causing issues. Once the correct pid is found, kill the process by typing
``` lang=bash
$ sudo kill ${pid}
```
==Qemu Host not responding to start command
If the virtual machines are not responding after the the host restarted, use the unbind script with the following command with root.
``` lang=bash
$ /var/qemu/unbind.sh
```
NOTE: ecc-a-qemu04.rd.unr.edu would mostly encounter this issue.
==Create a new Virtual Machine
1. ssh to the host machine
2. get root access by entering `$ sudo su`
3. `$ cd /var/tmp`
4. `$ ls` to make sure `win10.iso` and `virtio.iso` are within the directory
5. Remove the old volume
``` lang=bash
# lvremove (volume group)/(Vm name)
$ lvremove vg0/ecc-a-17
```
6. Create a new blank volume:
``` lang=bash
# lvcreate (Size) -n (Vm name ) (volume group)
$ lvcreate -L300G -n ecc-a-17 vg0
```