Commit ab3da0d1 authored by k.elaammari's avatar k.elaammari
Browse files

readme

parent 5ec09489
# Getting started
# Long Term Storage Project
# Getting started
## Publickeys
Publickeys added to this folder ```shared\authorized_keys.d``` will be added for authorization at the hypervisor and vm.
## Packer
## Creating an diskimage
### Packer
1.Create a ed25519 host key with follwing name "ssh_host_ed25519_key" accordingly "ssh_host_ed25519_key.pub" and move it into prvisioning/secrets.
```shell
......@@ -11,15 +15,13 @@ cd secrets
ssh-keygen -t ed25519
```
2.Create in also in folder ```alxmonitoring/offline/packer/provisioning``` a ```authorized_keys``` file and paste here the key you want use to connect via ssh.
3.Now you are ready to build the diskimage. Change into ```alxmonitoring/offline/packer``` folder and run the following command.
2.Now you are ready to build the diskimage. Change into ```alxmonitoring/offline/packer``` folder and run the following command.
```shell
./build.sh archlinux-monitoring.json
```
## Ansible
### Ansible
4.Create the necessary TLS certificates with following script.
......@@ -27,7 +29,7 @@ ssh-keygen -t ed25519
alxmonitoring/playbooks/files/openssl/script/generate.sh
```
5.Start the newly created diskimage with your hypervisor and obtain the assigned ip address. e.g.:
5.Start the newly created diskimage with your local hypervisor and obtain the assigned ip address. e.g.:
```shell
arp -i %virtual_network_name% -n
......@@ -47,3 +49,40 @@ passwd ansible
```shell
ansible-playbook alxmonitoring.yml --extra-vars "ansible_sudo_pass=%sudopassword%"
```
## Uploading diskimage to hypervisor
To upload your created diskimage to hypervisor into following folder. ```/var/lib/ltsvms/<dev|op>```
```shell
scp -i ~/.ssh/<key> diskimage/archlinux-monitoring root@mon-storage-test:/var/lib/ltsvms/dev
```
## Managing vm with virsh
### Connect virsh
```
virsh connect qemu:///system
```
Connects locally as the root user to the daemon supervising guest virtual machines on the KVM hypervisor.
### List all KVM guests (vms)
```
virsh list --all
```
### Install new VM
```
virt-install --help
```
### Show/Edit KVM vm configuration (libvirt-XML file)
```
virsh <dumxml|editxml> VM_NAME
```
### Start/Stop/Reboot
```
virsh <start|reboot|shutdown> VM_NAME
```
### Delete VM
```
virsh destroy VM_NAME && virsh undefine VM_NAME
```
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment