1
0
mirror of https://github.com/gryf/boxpy.git synced 2026-02-02 14:15:49 +01:00

64 Commits
1.0 ... 1.11.1

Author SHA1 Message Date
88172acd67 Refactor Run class.
When using capture=True together with subprocess.run, interactive
session will not work, as all the output will be captured. Perfectly
well seen with `boxpy ssh`. This commit will fix this issue.
2025-05-05 13:09:09 +02:00
4c3aef3a85 Fix ssh command.
There was a leftover call for changed Run object initialization.
With this commit it's correct now.
2025-05-02 12:42:17 +02:00
189fbab17d Removed license classifier in favor of SPDX entry. 2025-04-18 16:04:42 +02:00
eeebab74ad Fix some linting issues.
Also, changing workflow for image downloading fails.
2024-11-17 19:27:37 +01:00
81ab5de7c4 Bump Fedora version 2024-11-15 08:18:46 +01:00
62b86d5f81 Added poweroff option for stopping machine 2024-05-14 19:30:56 +02:00
14cd805e00 Bump the version.
Also, clean up raising exceptions.
2024-04-30 15:14:39 +02:00
86b02fca1b Keep image information right in the appropriate image subclass. 2024-04-30 15:14:13 +02:00
3d840de3ee Bump Debian, Fedora and Ubuntu versions.
Also, set Ubuntu latest LTS as default.
2024-04-30 15:10:03 +02:00
2a1a4cf40a Use pyproject.toml for installing box module. 2024-03-30 20:34:01 +01:00
71bf5b6d99 Bump Fedora version, remove archived versions prior to 37 2023-12-05 11:54:05 +01:00
e73d5ce458 Update kuryr multinode setup example 2023-07-23 12:58:12 +02:00
d623114f69 Update example for wmaker 2023-07-23 12:54:09 +02:00
51f642bea0 Updated ubuntu devstack example 2023-07-23 12:39:18 +02:00
12df0e97df Updated fedora devstack example 2023-07-23 11:53:59 +02:00
5f0def3103 Bump distribution latest version.
Also, updated mapping for the Fedora images.
2023-07-05 15:58:56 +02:00
43eabb9947 Fix nasty bug for debian images 2023-07-04 18:48:18 +02:00
55416db13d Added --type switch for start command 2023-04-20 19:42:21 +02:00
86a5655025 Improve detecting VM Operating System. 2023-04-20 19:21:24 +02:00
259d11e409 Don't reset Debian Bookworm on first run.
Issue/glitch with kernel panic on first run seems to be fixed on Debian
Bookworm (12). Do not reset VM for that version (and hopefully
upcoming).
2023-04-20 17:01:57 +02:00
b2457d497e Add experimental Debian support.
Note, there is something weird with those images, as the will segfault
on the first run (I've checked that with latest Debian 11 images, maybe
it will change in the future), so there is forced reboot after certain
amount of time as a workaround.
2023-04-18 21:48:19 +02:00
15a6ecb540 Use predefined os types for vbox VMs.
It might have impact on how operating system inside VM is treated by
VirtualBox, so let's stick with proper distro for every OS. As an
outcome, it turns out, that for graphical side of the vm, for Linux OS
the vmsvga driver is recommended, as a little more amount of vram.
2023-04-18 21:39:56 +02:00
10543cb506 Don't create vm till it's still there during rebuild 2023-04-02 10:05:06 +02:00
1f1084f294 Readme update. 2023-02-26 19:20:11 +01:00
f5ed3d37ac readme update 2023-02-22 21:10:59 +01:00
1483f49461 Added debug info about ssh connection to the vm 2023-02-22 21:08:43 +01:00
f0282874f8 Added information regarding url for the dl image 2023-02-12 11:45:50 +01:00
4db0b422b8 Added missing fname from Centos class constructor 2023-02-12 11:45:19 +01:00
c3ee529d95 Make 22.04 default version for ubuntu. 2022-12-24 12:29:49 +01:00
cdcb7ffdce Added implementation for custom image. 2022-11-17 20:34:13 +01:00
9658a9ef36 Add commandline options for providing custom image.
Two new commandline options are added: image and default-user. When
image parameter has been add there are implications that:

- default-user is also provided by commandline - regardless it is
  already present in yaml config
- distro parameter is ignored
- custom username, which might be provided by yaml file will become
  default-user if absent.

All of that is the consequence, that by providing custom qcow2 image
there is no easy way to determine what operating system is passed by,
therefore it is purely declarative way of creating VM with such image.
2022-11-17 20:27:58 +01:00
706dfe8688 Decrease memory/disk size of default vm 2022-11-17 19:22:16 +01:00
8252e189cc Fix issue with condition for extra data 2022-11-16 09:11:27 +01:00
e6d4d8ab7a Fix minor issue with pattern for centos image 2022-11-16 09:10:49 +01:00
b7b4ba5cbc Readme update 2022-11-15 20:33:10 +01:00
47766b6cd9 Added ability to point to local qcow2 image.
Instead of downloading image from the network, there is a way to point
out cloud user and image within yaml configuration.
2022-11-15 20:27:14 +01:00
55cb8d5e30 Better messagingn in conf/modules vbox issues 2022-10-16 08:52:55 +02:00
276ddd8681 Added bash completion for start/stop commands. 2022-05-23 12:02:58 +02:00
0fb0d64db6 Added two new commands for starting and stopping VMs. 2022-05-23 12:02:28 +02:00
847279a990 Align case for command help messages. 2022-05-23 12:01:59 +02:00
38ed618b5b Added info if vm is running.
Also, added command for acpi shutdown.
2022-05-23 12:00:55 +02:00
1c39cd1985 Add ability to set different default username.
During cloud init user might want to change default user from the
distribution to something else. It will not be possible to ssh to such
machine using boxpy ssh command - only using ssh directly with the
correct user name would be possible. In this change there is added
possibility for setting username in boxpy_data section with desired
value to be used in ssh command.
2022-04-22 07:53:50 +02:00
ed25a0d208 Fix typo in message. 2022-04-22 07:53:04 +02:00
20120d898a Add error message in case of wrong config 2022-04-22 07:52:22 +02:00
e63d83fc7f Don't clutter current directory with checksum files.
In case of Centos, there is a need to get the checksum file first to
figure out the correct image filename, during that process checksum file
was left alone in the current directory. Place it in the temp dir in the
first place and than remove after we know the right image filename.
2022-02-08 20:39:03 +01:00
0093e32b74 Fix for rebuild command and calling vmdestroy function. 2021-11-04 09:26:38 +01:00
353d848072 Pass more than one machine to destroy command.
From now on, there is a possibility to pass more than one machine to be
destroyed.
2021-11-04 08:41:13 +01:00
4581ab0ed0 Specify from which Python version boxpy is supported. 2021-10-19 19:33:15 +02:00
deba0aa621 Narrow down proposed VMs to running only for ssh command. 2021-10-19 19:32:30 +02:00
6528813d6a Update examples for multinode setup 2021-10-19 19:31:18 +02:00
9699e61b35 Exit, if image checksum is wrong. 2021-10-03 19:08:15 +02:00
f46432546e Added ability to add url for write_files section. 2021-10-01 19:15:25 +02:00
fe422576cd Fixed long param for listing VMs. 2021-10-01 19:09:14 +02:00
a7b0984f77 Handle nonexisted VMs for commands. 2021-09-30 21:11:18 +02:00
085785af46 Added sudo to cloud init status command.
Some systems have to have a strict control, even in system state
information. Prefixed with "sudo" to command to gather information how
cloud init is doing.
2021-09-30 21:00:18 +02:00
9288179474 Added support for Centos Stream.
Currently default and only version supported is 8, since 9 behaves
differently with similar config drive.
2021-09-29 17:16:09 +02:00
a5702254ca Removed owner field on examples, since it's in a way. 2021-09-29 17:13:35 +02:00
74053995c8 Refactored Image classes.
There were very similar methods for downloading/proceeding with
checksum for both Ubuntu and Fedora classes. Extracted those two into
methods in base class.
2021-09-29 14:47:03 +02:00
1999f1dc7e Fixed checking existence of func in args. 2021-09-26 18:53:08 +02:00
7f99f91933 Fail on yaml parse errors 2021-09-02 18:36:57 +02:00
db8a42518e Rephrase help for VM type option. 2021-09-02 09:27:34 +02:00
c19f4f1a61 Update devstack deployment examples. 2021-08-20 08:24:50 +02:00
d7544f52f6 Added run type option to create and rebuild subcommand.
For now, the only mode VirtualBox VM has launched was headless. For
debugging purposes, there were other types allowed using --type switch
for command create and rebuild, while headless will remain the default
one.
2021-08-19 21:09:06 +02:00
3c43263bb9 Fix clashing version from boxpy and subcommands.
Currently, you could pass long version of '--version' option to either
boxpy itself and subcommands create and rebuild. With this patch proper
context is now detected.
2021-08-19 21:08:34 +02:00
9 changed files with 878 additions and 279 deletions

View File

@@ -2,8 +2,8 @@
box.py
======
Box.py is a simple automation tool meant to run Ubuntu or Fedora cloud images
on top of VirtualBox.
Box.py is a simple automation tool meant to run Ubuntu, Fedora, Centos Stream
or Debian cloud images on top of VirtualBox.
What it does is simply download official cloud image, set up VM, tweak it up
and do the initial pre-configuration using generated config drive.
@@ -16,37 +16,69 @@ weird named options for ``vboxmanage`` ;P)
Requirements
------------
- Python 3.x
- Python >=3.8
- `pyyaml`_
- `requests`_
- Virtualbox (obviously)
- ``mkisofs`` or ``genisoimage`` command for generating iso image
- ``mkisofs`` or ``genisoimage`` command for generating ISO image
- ``wget`` command for fetching images
- ``sha256sum`` command for checksum check
- ``sha256sum`` and ``sha512sum`` commands for checksum check
- ``qemu-img`` from *qemu-utils* package command for converting between images
formats
Tested distros
--------------
- Ubuntu
- 18.04
- 20.04
- 22.04
- 24.04
- Fedora
- 37
- 38
- 39
- 40
- 41
- Centos Stream
- 8
- 9
- Debian
- 10 (buster)
- 11 (bullseye)
- 12 (bookworm)
- 13 (trixie) - prerelease
There is possibility to use whatever OS image which supports cloud-init. Use
the ``--image`` param for ``create`` command to pass image filename, although
it's wise to at least discover (or not, but it may be easier in certain
distributions) what username is supposed to be used as a default user and pass
it with ``--username`` param.
How to run it
-------------
First, make sure you fulfill the requirements; either by using packages from
your operating system, or by using virtualenv for Python requirements, i.e.:
your operating system, or by using virtualenv, i.e.:
.. code:: shell-session
$ python -m virtualenv .venv
$ . .venv/bin/activate
(.venv) $ pip install requirements.txt
(.venv) $ pip install .
then you can issue:
You'll have ``boxpy`` command created for you as well.
.. code:: shell-session
$ alias boxpy='python /path/to/box.py'
$ boxpy -V
boxpy 1.9.2
or simply link it somewhere in the path:
Other option is simply link it somewhere in the path:
.. code:: shell-session
@@ -54,25 +86,25 @@ or simply link it somewhere in the path:
$ chmod +x ~/bin/boxpy
and now you can issue some command. For example, to spin up a VM with Ubuntu
18.04 with one CPU, 2GB of memory and 10GB of disk:
20.04 with one CPU, 1GB of memory and 6GB of disk:
.. code:: shell-session
$ boxpy create --version 18.04 myvm
$ boxpy create --version 20.04 myvm
note, that Ubuntu is default distribution you don't need to specify
``--distro`` nor ``--version`` it will pick up latest LTS version. Now, let's
recreate it with 20.04:
recreate it with 22.04:
.. code:: shell-session
$ boxpy rebuild --version 20.04 myvm
$ boxpy rebuild --version 22.04 myvm
or recreate it with Fedora and add additional CPU:
.. code:: shell-session
$ boxpy rebuild --distro fedora --version 34 --cpu 2 myvm
$ boxpy rebuild --distro fedora --version 39 --cpu 2 myvm
now, let's connect to the VM using either ssh command, which is printed out at
as last ``boxpy`` output line, or simply by using ssh boxpy command:
@@ -90,17 +122,23 @@ use it ad-hoc, or place on your ``.bashrc`` or whatever:
Currently, following commands are available:
- ``list`` - for quickly listing all/running VMs
- ``info`` - to get summary about VM
- ``destroy`` - that is probably obvious one
- ``completion`` - as described above
- ``create`` - create new VM
- ``destroy`` - that is probably obvious one
- ``info`` - to get summary about VM
- ``list`` - for quickly listing all/running VMs
- ``rebuild`` - recreate specified VM
- ``ssh`` - connect to the VM using ssh
- ``completion`` - as described above
- ``start`` - stop the running VM
- ``stop`` - start stopped VM
All of the commands have a range of options, and can be examined by using
``--help`` option.
YAML Configuration
------------------
What is more interesting though, is the fact, that you can pass your own
`cloud-init`_ yaml file, so that VM can be provisioned in easy way.
@@ -140,11 +178,20 @@ pass filenames to the custom config, instead of filling up
permissions: '0644'
filename: /path/to/local/file.txt
during processing this file, boxpy will look for ``filename`` key in the yaml
file for the ``write_files`` sections, and it will remove that key, read the
file and put its contents under ``content`` key. What is more important, that
will be done after template processing, so there will be no interference for
possible ``$`` characters.
or
.. code:: yaml
write_files:
- path: /opt/somefile.txt
permissions: '0644'
url: https://some.url/content
during processing this file, boxpy will look for ``filename`` or ``url`` keys
in the yaml file for the ``write_files`` sections, and it will remove that key,
read the file and put its contents under ``content`` key. What is more
important, that will be done after template processing, so there will be no
interference for possible ``$`` characters.
What is more interesting is the fact, that you could use whatever cloud-init
accepts, and a special section, for keeping configuration, so that you don't
@@ -193,6 +240,19 @@ configuration additional NIC for virtual machine, i.e:
advanced:
nic2: intnet
To select image from local file system, it is possible to set one by providing
it under ``boxpy_data.image`` key:
.. code:: yaml
…
boxpy_data:
image: /path/to/the/qcow2/image
default_user: cloud-user
Note, that default_user is also needed to be provided, as there is no guess,
what is the default username for cloud-init configured within provided image.
License
-------
@@ -202,3 +262,4 @@ This work is licensed under GPL-3.
.. _pyyaml: https://github.com/yaml/pyyaml
.. _cloud-init: https://cloudinit.readthedocs.io
.. _requests: https://docs.python-requests.org

727
box.py

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
package_update: true
packages:
- bash-completion
- ctags-etags
- ctags
- git
- git-review
- htop
@@ -12,7 +12,6 @@ packages:
write_files:
- path: /tmp/local.conf
permissions: '0644'
owner: fedora:fedora
content: |
[[local|localrc]]
ADMIN_PASSWORD=pass
@@ -24,13 +23,13 @@ write_files:
disable_service n-vnc
disable_service dstat
runcmd:
- [su, -, fedora, -c, "git clone https://opendev.org/openstack/devstack ~/devstack"]
- [su, -, fedora, -c, "cp /tmp/local.conf /home/fedora/devstack/"]
- [su, -, fedora, -c, "echo 'export HOST_IP=10.0.2.15' >> .bashrc"]
- su - fedora -c "git clone https://opendev.org/openstack/devstack ~/devstack"
- su - fedora -c "cp /tmp/local.conf /home/fedora/devstack/"
- su - fedora -c "echo 'export HOST_IP=10.0.2.15' >> .bashrc"
boxpy_data:
key: vm
cpus: 2
memory: 4GB
disk_size: 10GB
distro: fedora
version: 32
version: 36

View File

@@ -7,7 +7,7 @@ packages:
- ipython3
- jq
- mc
- python-apsw
- python3-apsw
- python3-flake8
- python3-jedi
- python3-pip
@@ -19,7 +19,6 @@ packages:
write_files:
- path: /tmp/local.conf
permissions: '0644'
owner: ubuntu:ubuntu
content: |
[[local|localrc]]
ADMIN_PASSWORD=pass
@@ -27,15 +26,15 @@ write_files:
RABBIT_PASSWORD=$$ADMIN_PASSWORD
SERVICE_PASSWORD=$$ADMIN_PASSWORD
runcmd:
- [su, -, ubuntu, -c, "git clone https://github.com/gryf/vmstrap"]
- [su, -, ubuntu, -c, "vmstrap/bootstrap.sh"]
- [rm, -fr, /home/ubuntu/vmstrap]
- [su, -, ubuntu, -c, "cp /tmp/local.conf /home/ubuntu/devstack/"]
- [su, -, ubuntu, -c, "echo 'export HOST_IP=10.0.2.15' >> .bashrc"]
- apt purge -y python3-pyasn1-modules
- apt purge -y python3-simplejson
- su - ubuntu -c "git clone https://opendev.org/openstack/devstack ~/devstack"
- su - ubuntu -c "cp /tmp/local.conf /home/ubuntu/devstack/"
- su - ubuntu -c "echo 'export HOST_IP=10.0.2.15' >> .bashrc"
boxpy_data:
key: vm
cpus: 2
memory: 6GB
disk_size: 10GB
distro: ubuntu
version: 20.04
version: 22.04

View File

@@ -7,7 +7,7 @@ packages:
- ipython3
- jq
- mc
- python-apsw
- python3-apsw
- python3-flake8
- python3-jedi
- python3-pip
@@ -31,13 +31,10 @@ write_files:
- 192.168.10.10/24
- path: /tmp/local.conf
permissions: '0644'
owner: ubuntu:ubuntu
content: |
[[local|localrc]]
disable_all_services
disable_service tls-proxy
# Cinder
disable_service c-api
disable_service c-bak
@@ -81,15 +78,20 @@ write_files:
enable_service n-cond
enable_service n-cpu
enable_service n-sch
# Neutron
enable_service neutron
enable_service neutron-tag-ports-during-bulk-creation
# Octavia
enable_service o-api
enable_service o-cw
enable_service o-da
enable_service o-hk
enable_service o-hm
enable_service octavia
# OVN
# Neutron ovn services
enable_service ovn-controller
enable_service ovn-northd
enable_service ovs-vswitchd
@@ -100,64 +102,93 @@ write_files:
enable_service placement-client
# Neutron services
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service q-ovn-metadata-agent
enable_service q-qos
enable_service q-svc
enable_service q-trunk
enable_service rabbit
# Swift
disable_service s-account
disable_service s-container
disable_service s-object
disable_service s-proxy
# Tempest
enable_service tempest
enable_service tls-proxy
# TLS
disable_service tls-proxy
# Vars
ADMIN_PASSWORD="secretadmin"
CONTAINER_ENGINE="crio"
DATABASE_PASSWORD="secretdatabase"
ETCD_USE_RAMDISK="True"
KURYR_ENABLED_HANDLERS="vif,endpoints,service,namespace,pod_label,policy,kuryrnetworkpolicy,kuryrnetwork,kuryrport,kuryrloadbalancer"
KURYR_EP_DRIVER_OCTAVIA_PROVIDER="amphora"
KURYR_K8S_API_PORT="6443"
KURYR_K8S_CLOUD_PROVIDER="False"
KURYR_K8S_CONTAINERIZED_DEPLOYMENT="True"
KURYR_ENFORCE_SG_RULES="False"
KURYR_EP_DRIVER_OCTAVIA_PROVIDER="ovn"
KURYR_K8S_MULTI_WORKER_TESTS="True"
KURYR_K8S_OCTAVIA_MEMBER_MODE="L2"
KURYR_LB_ALGORITHM="SOURCE_IP_PORT"
KURYR_NEUTRON_DEFAULT_ROUTER="kuryr-router"
KURYR_SG_DRIVER="policy"
KURYR_SUBNET_DRIVER="namespace"
KURYR_SUPPORT_POD_SECURITY="True"
LOGFILE="/opt/stack/logs/devstacklog.txt"
LOG_COLOR="False"
ML2_L3_PLUGIN="router"
ML2_L3_PLUGIN="ovn-router,trunk,qos"
OCTAVIA_AMP_IMAGE_FILE="/tmp/test-only-amphora-x64-haproxy-ubuntu-bionic.qcow2"
OCTAVIA_AMP_IMAGE_NAME="test-only-amphora-x64-haproxy-ubuntu-bionic"
OCTAVIA_AMP_IMAGE_SIZE="3"
Q_AGENT="openvswitch"
Q_ML2_TENANT_NETWORK_TYPE="vxlan"
Q_ML2_PLUGIN_MECHANISM_DRIVERS="openvswitch,linuxbridge"
OVN_BRANCH="v21.06.0"
OVN_BUILD_FROM_SOURCE="True"
OVN_DBS_LOG_LEVEL="dbg"
OVN_L3_CREATE_PUBLIC_NETWORK="True"
OVS_BRANCH="a4b04276ab5934d087669ff2d191a23931335c87"
VAR_RUN_PATH="/usr/local/var/run"
RABBIT_PASSWORD="secretrabbit"
RECLONE="no"
SERVICE_PASSWORD="secretservice"
SERVICE_TOKEN="password"
TEMPEST_PLUGINS="/opt/stack/kuryr-tempest-plugin"
USE_PYTHON3="True"
LIBS_FROM_GIT=cinder,devstack,devstack-gate,devstack-plugin-container,glance,keystone,kuryr-kubernetes,kuryr-tempest-plugin,neutron,nova,octavia,placement,python-octaviaclient,requirements,swift,tempest
LIBS_FROM_GIT=cinder,devstack,devstack-gate,devstack-plugin-container,glance,keystone,kuryr-kubernetes,kuryr-tempest-plugin,neutron,nova,octavia,octavia-tempest-plugin,ovn-octavia-provider,placement,python-octaviaclient,requirements,swift,tempest
TEMPEST_PLUGINS="/opt/stack/kuryr-tempest-plugin /opt/stack/octavia-tempest-plugin"
# enabled plugins
enable_plugin devstack-plugin-container https://opendev.org/openstack/devstack-plugin-container
enable_plugin kuryr-kubernetes https://github.com/gryf/kuryr-kubernetes
enable_plugin kuryr-kubernetes https://opendev.org/openstack/kuryr-kubernetes
enable_plugin kuryr-tempest-plugin https://opendev.org/openstack/kuryr-tempest-plugin
enable_plugin neutron https://opendev.org/openstack/neutron
enable_plugin octavia https://opendev.org/openstack/octavia
enable_plugin octavia-tempest-plugin https://opendev.org/openstack/octavia-tempest-plugin
enable_plugin ovn-octavia-provider https://opendev.org/openstack/ovn-octavia-provider
[[post-config|$$OCTAVIA_CONF]]
[api_settings]
enabled_provider_drivers = amphora:'Octavia Amphora driver',ovn:'Octavia OVN driver'
runcmd:
- [su, -, ubuntu, -c, "git clone https://github.com/gryf/vmstrap"]
- [su, -, ubuntu, -c, "vmstrap/bootstrap.sh"]
- [rm, -fr, /home/ubuntu/vmstrap]
- [su, -, ubuntu, -c, "echo 'export HOST_IP=192.168.10.10' >> .bashrc"]
- [su, -, ubuntu, -c, "cp /tmp/local.conf /home/ubuntu/devstack/"]
- systemctl stop systemd-resolved.service
- systemctl disable systemd-resolved.service
- echo "nameserver 1.1.1.1" > /etc/resolv.conf
- apt purge -y snapd
- apt purge -y python3-pyasn1-modules
- apt purge -y python3-simplejson
- su - ubuntu -c "git clone https://opendev.org/openstack/devstack"
- su - ubuntu -c "cp /tmp/local.conf /home/ubuntu/devstack/"
- su - ubuntu -c "echo 'export HOST_IP=192.168.10.10' >> .bashrc"
- systemctl restart systemd-networkd
boxpy_data:
key: vm
cpus: 4
memory: 16GB
disk_size: 50GB
version: 20.04
advanced:
nic2: intnet

View File

@@ -7,7 +7,7 @@ packages:
- ipython3
- jq
- mc
- python-apsw
- python3-apsw
- python3-flake8
- python3-jedi
- python3-pip
@@ -31,13 +31,10 @@ write_files:
- 192.168.10.11/24
- path: /tmp/local.conf
permissions: '0644'
owner: ubuntu:ubuntu
content: |
[[local|localrc]]
disable_all_services
disable_service tls-proxy
# Cinder
disable_service c-bak
disable_service c-vol
@@ -56,46 +53,68 @@ write_files:
enable_service kuryr-daemon
disable_service kuryr-kubernetes
# Nova
enable_service n-cpu
# OVN
# Neutron
enable_service neutron
enable_service ovn-controller
disable_service ovn-northd
enable_service ovn-octavia-provider
enable_service ovs-vswitchd
enable_service ovsdb-server
# Placement API
enable_service placement-client
# Neutron services
# Neutron services cd
enable_service q-ovn-metadata-agent
disable_service q-svc
# tempest
disable_service tempest
# tls
disable_service tls-proxy
# Vars
ADMIN_PASSWORD="secretadmin"
CONTAINER_ENGINE="crio"
DATABASE_HOST="192.168.10.10"
DATABASE_PASSWORD="secretdatabase"
ENABLE_CHASSIS_AS_GW="False"
GLANCE_HOSTPORT="192.168.10.10:9292"
ML2_L3_PLUGIN="router"
# turn on ovn-provider
KURYR_ENFORCE_SG_RULES="False"
KURYR_EP_DRIVER_OCTAVIA_PROVIDER="ovn"
KURYR_K8S_OCTAVIA_MEMBER_MODE="L2"
KURYR_LB_ALGORITHM="SOURCE_IP_PORT"
KURYR_NEUTRON_DEFAULT_ROUTER="kuryr-router"
VAR_RUN_PATH="/usr/local/var/run"
KURYR_ENABLED_HANDLERS="vif,endpoints,service,namespace,pod_label,policy,kuryrnetworkpolicy,kuryrnetwork,kuryrport,kuryrloadbalancer"
KURYR_FORCE_IMAGE_BUILD="True"
KURYR_EP_DRIVER_OCTAVIA_PROVIDER="amphora"
KURYR_K8S_API_PORT="6443"
KURYR_K8S_CLOUD_PROVIDER="False"
KURYR_K8S_CONTAINERIZED_DEPLOYMENT="True"
KURYR_SG_DRIVER="policy"
KURYR_SUBNET_DRIVER="namespace"
OVN_BRANCH="v21.06.0"
OVN_BUILD_FROM_SOURCE="True"
OVN_DBS_LOG_LEVEL="dbg"
OVN_L3_CREATE_PUBLIC_NETWORK="True"
OVS_BRANCH="a4b04276ab5934d087669ff2d191a23931335c87"
LIBVIRT_TYPE="qemu"
LOGFILE="/opt/stack/logs/devstacklog.txt"
LOG_COLOR="False"
Q_AGENT="openvswitch"
Q_ML2_TENANT_NETWORK_TYPE="vxlan"
Q_ML2_PLUGIN_MECHANISM_DRIVERS="openvswitch,linuxbridge"
Q_HOST="192.168.10.10"
RABBIT_HOST="192.168.10.10"
RABBIT_PASSWORD="secretrabbit"
RECLONE="no"
SERVICE_HOST="192.168.10.10"
SERVICE_PASSWORD="secretservice"
SERVICE_TOKEN="password"
TEMPEST_PLUGINS="/opt/stack/kuryr-tempest-plugin"
USE_PYTHON3="True"
LIBS_FROM_GIT=cinder,devstack,devstack-gate,devstack-plugin-container,glance,keystone,kuryr-kubernetes,kuryr-tempest-plugin,neutron,nova,octavia,placement,python-octaviaclient,requirements,swift,tempest
@@ -103,16 +122,21 @@ write_files:
enable_plugin devstack-plugin-container https://opendev.org/openstack/devstack-plugin-container
enable_plugin kuryr-kubernetes https://opendev.org/openstack/kuryr
runcmd:
- [su, -, ubuntu, -c, "git clone https://github.com/gryf/vmstrap"]
- [su, -, ubuntu, -c, "vmstrap/bootstrap.sh"]
- [rm, -fr, /home/ubuntu/vmstrap]
- [su, -, ubuntu, -c, "echo 'export HOST_IP=192.168.10.11' >> .bashrc"]
- [su, -, ubuntu, -c, "cp /tmp/local.conf /home/ubuntu/devstack/"]
- systemctl stop systemd-resolved.service
- systemctl disable systemd-resolved.service
- echo "nameserver 1.1.1.1" > /etc/resolv.conf
- apt purge -y snapd
- apt purge -y python3-pyasn1-modules
- apt purge -y python3-simplejson
- su - ubuntu -c "git clone https://opendev.org/openstack/devstack"
- su - ubuntu -c "cp /tmp/local.conf /home/ubuntu/devstack/"
- su - ubuntu -c "echo 'export HOST_IP=192.168.10.11' >> .bashrc"
- systemctl restart systemd-networkd
boxpy_data:
key: vm
cpus: 4
memory: 16GB
disk_size: 50GB
version: 20.04
advanced:
nic2: intnet
port: 2223

View File

@@ -1,5 +1,6 @@
packages:
- build-essential
- exuberant-ctags
- gettext
- libfontconfig1-dev
- libgif-dev
@@ -21,13 +22,17 @@ packages:
- libxrender-dev
- libxt-dev
- make
- mc
- sharutils
- silversearcher-ag
- tmux
- vim-nox
- xinit
runcmd:
- [su, -, ubuntu, -c, "git clone https://github.com/gryf/wmaker -b experimental"]
- [su, -, ubuntu, -c, "git clone https://github.com/gryf/vmstrap"]
- [su, -, ubuntu, -c, "vmstrap/bootstrap.sh"]
- [rm, -fr, /home/ubuntu/vmstrap]
- su - ubuntu -c "git clone https://github.com/gryf/wmaker -b experimental"
- su - ubuntu -c "git clone https://github.com/gryf/vmstrap"
- su - ubuntu -c "vmstrap/bootstrap.sh -c"
- rm -fr /home/ubuntu/vmstrap
boxpy_data:
key: vm
cpus: 4

66
pyproject.toml Normal file
View File

@@ -0,0 +1,66 @@
[build-system]
requires = ["setuptools >= 77.0"]
build-backend = "setuptools.build_meta"
[project]
name = "boxpy"
dynamic = ["version"]
authors = [
{name = "Roman Dobosz", email = "gryf73@gmail.com"}
]
license = "GPL-3.0-or-later"
description = "Run Linux cloud image on top of VirtualBox using commandline tool"
readme = "README.rst"
requires-python = ">=3.8"
keywords = ["vboxmanage", "virtualbox", "vm", "virtual machine", "automation"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: End Users/Desktop",
"Topic :: Terminals",
"Topic :: Utilities",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only"
]
dependencies = [
"pyyaml>=5.4.1",
"requests>=2.26.0"
]
[project.urls]
Homepage = "https://github.com/gryf/boxpy"
[project.scripts]
boxpy = "box:main"
[tool.setuptools]
py-modules = ["box"]
[tool.setuptools.dynamic]
version = {attr = "box.__version__"}
[tool.ruff]
line-length = 79
indent-width = 4
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"E", # pycodestyle
"F", # pyflakes
"FA", # flake8-future-annotations
"G", # flake8-logging-format
"N", # pep8-naming
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"RET", # flake8-return
"SIM", # flake8-simplify
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
]

View File

@@ -1 +0,0 @@
pyyaml>=5.4.1