#VM instructions for virt-todolist vm
virt-builder fedora-39 --size 8G --format qcow2 --update --firstboot-command 'useradd -m -p dog8code test ; chage -d 0 test'
virt-install --name todolist-mariadb-1 \
--memory memory=3072 --cpu host --vcpus 2 --graphics none \
--os-variant fedora39 --import \
--disk /var/lib/libvirt/images/Fedora-Cloud-Base-39-1.5.x86_64.qcow2,format=qcow2,bus=virtio \
--disk size=8 \
--network type=network,source=default,model=virtio \
--cloud-init user-data=/var/lib/libvirt/boot/cloud-init/todolist-data
# login
sudo cloud-init schema --system
dnf install golang, git, mariadb, mariadb-server, net-tools, python-requests
sudo dnf install mariadb-server -y
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql -uroot -e "CREATE DATABASE todolist; USE todolist; CREATE USER 'test'@'localhost' IDENTIFIED BY 'test';"
sudo mysql -uroot -e "grant all privileges on todolist.* to test@'localhost' identified by 'test'; FLUSH PRIVILEGES; "
systemctl stop firewalld
git clone https://github.com/weshayutin/todolist-mariadb-go.git
See README.MD
or
go mod tidy
go run todolist.go
cd /home/test/todolist-mariadb-go/test/
python test.py
open browser to http://:8000$ip
Learn More →
https://gist.github.com/smurugap/a6c862a76c99331a7f929a14aaa30551
https://github.com/kubevirt/kubevirt/blob/main/examples/vm-cirros.yaml
volumes:
- dataVolume:
name: fedora-determined-kingfisher
name: rootdisk
- cloudInitConfigDrive:
userData: |-
#cloud-config
users:
- name: fedora
password: ry8p-hokq-hy8t
chpasswd: { expire: False }
- name: test
password: dog8code
chpasswd: { expire: False }
packages:
- mariadb-server
- unzip
runcmd:
- systemctl stop firewalld
- systemctl disable firewalld
- systemctl start mariadb
- systemctl enable mariadb
- mysql -uroot -e "CREATE DATABASE todolist; USE todolist; CREATE USER 'test'@'localhost' IDENTIFIED BY 'test';"
- mysql -uroot -e "grant all privileges on todolist.* to test@'localhost' identified by 'test'; FLUSH PRIVILEGES;"
- pushd /home/test/
- wget https://github.com/weshayutin/todolist-mariadb-go/releases/download/testing1/todolist-linux-amd64.zip
- unzip todolist-linux-amd64.zip
- cp systemd/todolist-mariadb.service /etc/systemd/user
- popd
- sudo systemctl --user daemon-reload
- sudo systemctl --user start todolist-mariadb.service
- sudo systemctl --user enable todolist-mariadb.service
- systemctl disable cloud-init
name: cloudinitdisk
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: fedora-xeric-grasshopper
namespace: openshift-virtualization-os-images
spec:
dataVolumeTemplates:
- metadata:
name: fedora-xeric-grasshopper-volume
spec:
sourceRef:
kind: DataSource
name: tinyfedora
namespace: openshift-virtualization-os-images
storage:
resources:
requests:
storage: '33285996544'
storageClassName: gp3-csi
instancetype:
name: cx1.large
preference:
name: fedora
running: true
template:
spec:
domain:
devices:
disks:
- disk:
bus: virtio
name: fedora-xeric-grasshopper-disk
- disk:
bus: virtio
name: cloudinitdisk
volumes:
- dataVolume:
name: fedora-xeric-grasshopper-volume
name: fedora-xeric-grasshopper-disk
- cloudInitConfigDrive:
userData: |-
#cloud-config
users:
- name: fedora
password: dog8code
chpasswd: { expire: False }
- name: test
password: dog8code
chpasswd: { expire: False }
packages:
- mariadb-server
- unzip
runcmd:
- systemctl stop firewalld
- systemctl disable firewalld
- systemctl start mariadb
- systemctl enable mariadb
- mysql -uroot -e "CREATE DATABASE todolist; USE todolist; CREATE USER 'test'@'localhost' IDENTIFIED BY 'test';"
- mysql -uroot -e "grant all privileges on todolist.* to test@'localhost' identified by 'test'; FLUSH PRIVILEGES;"
- pushd /home/test/
- wget https://github.com/weshayutin/todolist-mariadb-go/releases/download/testing1/todolist-linux-amd64.zip
- unzip todolist-linux-amd64.zip
- cp systemd/todolist-mariadb.service /etc/systemd/user
- popd
- sudo systemctl --user daemon-reload
- sudo systemctl --user start todolist-mariadb.service
- sudo systemctl --user enable todolist-mariadb.service
- systemctl disable cloud-init
name: rootdisk
- cloudInitConfigDrive:
userData: |-
#cloud-config
user: fedora
password: dog8code
chpasswd: { expire: False }
name: cloudinitdisk
https://github.com/openshift/oadp-operator/pull/1363
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up