parent
9f67ff4880
commit
45742ccac7
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,67 @@ |
||||
--- |
||||
- name: create mirror vm |
||||
hosts: localhost |
||||
connection: local |
||||
|
||||
|
||||
start and set autostart libvirtd |
||||
$ systemctl enable --now libvirtd |
||||
$ virsh |
||||
troubleshooting: try to load the kvm module with `modprobe kvm_intel` |
||||
|
||||
create storage pool for mirror |
||||
> pool-define-as mirror dir --target="~/.local/mirror/images" |
||||
> pool-build mirror |
||||
> pool-start mirror |
||||
> pool-autostart mirror |
||||
|
||||
create virtual disks |
||||
> vol-create-as mirror mirror_root1.qcow2 10G |
||||
> vol-create-as mirror mirror_root2.qcow2 10G |
||||
> vol-create-as mirror mirror_disk1.qcow2 5G |
||||
> vol-create-as mirror mirror_disk2.qcow2 5G |
||||
> vol-create-as mirror mirror_disk3.qcow2 5G |
||||
> vol-create-as mirror mirror_disk4.qcow2 5G |
||||
(exit virsh shell) |
||||
|
||||
get ubuntu iso |
||||
$ curl -O https://releases.ubuntu.com/20.04/ubuntu-20.04.2-live-server-amd64.iso |
||||
|
||||
create the vm |
||||
$ virt-install \ |
||||
--name=mirror \ |
||||
--memory=2048 \ |
||||
--vcpus=1 \ |
||||
--boot uefi \ |
||||
--location="./ubuntu-20.04.2-live-server-amd64.iso" \ |
||||
--disk vol=mirror/mirror_root1.qcow2 \ |
||||
--disk vol=mirror/mirror_root2.qcow2 \ |
||||
--disk vol=mirror/mirror_disk1.qcow2 \ |
||||
--disk vol=mirror/mirror_disk2.qcow2 \ |
||||
--disk vol=mirror/mirror_disk3.qcow2 \ |
||||
--disk vol=mirror/mirror_disk4.qcow2 \ |
||||
|
||||
interface should automatically come up but can also use |
||||
$ virt-viewer --domain-name mirror |
||||
if vm is on a remote machine |
||||
$ virt-viewer --connect qemu+ssh://user@host.example.com/system vmnamehere |
||||
|
||||
for now just have a folder of screenshots |
||||
- change name of lvm volume from "lv0-root" to just "root" |
||||
troubleshooting: ignore "failed to unmount /cdrom" and just ctrl+c in viewer |
||||
|
||||
login into your created user (from install), change to root, and create password for root |
||||
$ sudo su |
||||
type in your password |
||||
$ passwd |
||||
create root password |
||||
|
||||
create zpool (use /dev/disk/by-id/.. instead) |
||||
$ apt update |
||||
$ apt install zfsutils-linux nginx rsync |
||||
$ mkdir -p /mirror/root/.cscmirror |
||||
$ zpool create -f -m /mirror/root/.cscmirror cscmirror raidz2 /dev/vdc /dev/vdd /dev/vde /dev/vdf |
||||
|
||||
may already be mounted but just to be sure |
||||
$ zfs mount -a |
||||
|
@ -0,0 +1,95 @@ |
||||
remarks |
||||
- vm will not have autostart |
||||
- storage req: 40GB |
||||
- root size: 10GB (x2 for raid 1) |
||||
- storage size: 5GB (x4 for raid-z2) |
||||
|
||||
install (debian) |
||||
$ apt install qemu-kvm libvirt virt-install virt-viewer |
||||
|
||||
install (arch) |
||||
$ pacman -S qemu libvirt virt-install virt-viewer |
||||
|
||||
start and set autostart libvirtd |
||||
$ systemctl enable --now libvirtd |
||||
$ virsh |
||||
troubleshooting: try to load the kvm module with `modprobe kvm_intel` |
||||
|
||||
create storage pool for mirror |
||||
> pool-define-as mirror dir --target="~/.local/mirror/images" |
||||
> pool-build mirror |
||||
> pool-start mirror |
||||
> pool-autostart mirror |
||||
|
||||
create virtual disks |
||||
> vol-create-as mirror mirror_root1.qcow2 10G |
||||
> vol-create-as mirror mirror_root2.qcow2 10G |
||||
> vol-create-as mirror mirror_disk1.qcow2 5G |
||||
> vol-create-as mirror mirror_disk2.qcow2 5G |
||||
> vol-create-as mirror mirror_disk3.qcow2 5G |
||||
> vol-create-as mirror mirror_disk4.qcow2 5G |
||||
(exit virsh shell) |
||||
|
||||
get ubuntu iso |
||||
$ curl -O https://releases.ubuntu.com/20.04/ubuntu-20.04.2-live-server-amd64.iso |
||||
|
||||
create the vm |
||||
$ virt-install \ |
||||
--name=mirror \ |
||||
--memory=2048 \ |
||||
--vcpus=1 \ |
||||
--boot uefi \ |
||||
--location="./ubuntu-20.04.2-live-server-amd64.iso" \ |
||||
--disk vol=mirror/mirror_root1.qcow2 \ |
||||
--disk vol=mirror/mirror_root2.qcow2 \ |
||||
--disk vol=mirror/mirror_disk1.qcow2 \ |
||||
--disk vol=mirror/mirror_disk2.qcow2 \ |
||||
--disk vol=mirror/mirror_disk3.qcow2 \ |
||||
--disk vol=mirror/mirror_disk4.qcow2 \ |
||||
|
||||
interface should automatically come up but can also use |
||||
$ virt-viewer --domain-name mirror |
||||
if vm is on a remote machine |
||||
$ virt-viewer --connect qemu+ssh://user@host.example.com/system vmnamehere |
||||
|
||||
for now just have a folder of screenshots |
||||
- change name of lvm volume from "lv0-root" to just "root" |
||||
troubleshooting: ignore "failed to unmount /cdrom" and just ctrl+c in viewer |
||||
|
||||
login into your created user (from install), change to root, and create password for root |
||||
$ sudo su |
||||
type in your password |
||||
$ passwd |
||||
create root password |
||||
|
||||
create zpool (use /dev/disk/by-id/.. instead) |
||||
$ apt update |
||||
$ apt install zfsutils-linux nginx rsync |
||||
$ mkdir -p /mirror/root/.cscmirror |
||||
$ zpool create -f -m /mirror/root/.cscmirror cscmirror raidz2 /dev/vdc /dev/vdd /dev/vde /dev/vdf |
||||
|
||||
may already be mounted but just to be sure |
||||
$ zfs mount -a |
||||
|
||||
|
||||
TODO |
||||
- configure symlinking from /mirror/root/.cscmirror to /mirror/root |
||||
- configure ssh for push sync |
||||
- configure nginx |
||||
- configure rsync |
||||
- set motd? |
||||
- configure FTP (using proftpd) |
||||
- Merlin in ~mirror/merlin -> /home/mirror/merlin |
||||
- ~mirror/merlin/arthur.py status |
||||
- ~mirror/merlin/arthur.py sync:PROJECT_NAME |
||||
- Sync Scripts in ~mirror/bin (and repo, but repo has less) |
||||
- take params local_dir rsync_host rsync_dir |
||||
- check out csclub wiki mirror administration for adding a new project and project sync |
||||
|
||||
|
||||
- ask if can ignore /mirror/newroot |
||||
- mirror hosts |
||||
- http://mirror.csclub.uwaterloo.ca (the mirror) |
||||
- http://ca.releases.ubuntu.com (ubuntu releases) |
||||
- http://ca.ceph.com (ceph releases) |
||||
- http://debian.csclub.uwaterloo.ca (csclub's debian packages) |
@ -0,0 +1,14 @@ |
||||
<network> |
||||
<name>mirbr0</name> |
||||
<forward mode='nat'> |
||||
<nat> |
||||
<port start='1024' end='65535'/> |
||||
</nat> |
||||
</forward> |
||||
<bridge name='mirbr0' stp='on' delay='0'/> |
||||
<ip address='192.168.123.1' netmask='255.255.255.0'> |
||||
<dhcp> |
||||
<range start='192.168.123.2' end='192.168.123.254'/> |
||||
</dhcp> |
||||
</ip> |
||||
</network> |
@ -0,0 +1,30 @@ |
||||
create network and storage interface? |
||||
|
||||
<interface type='network'> |
||||
<mac address='52:54:00:64:dd:f2'/> |
||||
<source network='default' bridge='virbr0'/> |
||||
<target dev='vnet0'/> |
||||
<model type='virtio'/> |
||||
<alias name='net0'/> |
||||
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> |
||||
</interface> |
||||
|
||||
|
||||
<graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'> |
||||
<listen type='address' address='127.0.0.1'/> |
||||
<image compression='off'/> |
||||
</graphics> |
||||
<graphics type='vnc' port='5901' autoport='yes' listen='127.0.0.1'> |
||||
<listen type='address' address='127.0.0.1'/> |
||||
</graphics> |
||||
|
||||
|
||||
|
||||
<graphics type='spice' port='5902' autoport='yes' listen='127.0.0.1'> |
||||
<listen type='address' address='127.0.0.1'/> |
||||
<image compression='off'/> |
||||
</graphics> |
||||
<graphics type='vnc' port='5903' autoport='yes' listen='127.0.0.1'> |
||||
<listen type='address' address='127.0.0.1'/> |
||||
</graphics> |
||||
|
Loading…
Reference in new issue