1
0
mirror of https://github.com/gryf/boxpy.git synced 2025-12-19 05:30:18 +01:00
Commit Graph

73 Commits

Author SHA1 Message Date
e5173c707d Fixed case when there is no user data provided. 2021-07-05 12:08:32 +02:00
be91f6b827 Removed unused variable 2021-07-05 12:07:56 +02:00
2d83519b1c Minor logging fixes. 2021-06-30 15:31:54 +02:00
822609504d Added info command. 2021-06-27 19:34:05 +02:00
21dc3ec2ce Adding extra data 'creator'.
This field would help to distinguish if VM has been created by boxpy, or
manually.
2021-06-27 19:32:18 +02:00
ac47f126c0 Removed surplus get_vm_info call in config. 2021-06-27 19:31:32 +02:00
a975232042 Added additional parameter for get_media_size function. 2021-06-27 19:30:46 +02:00
7a9336f179 Minor fixes for logging. Removed unused exception classes. 2021-06-27 17:26:06 +02:00
d1481ea02f Added logging messages here and there. Now it should looks better. 2021-06-27 17:17:13 +02:00
a56b76f16d Changing approach with detecting if cloud init finished.
Till now, boxpy was based on the fact, that there was power_state
section, and there was a check if VM is down already. That approach have
their own issues.

Now, there will be no more power-off, there is a check by using
`cloud-init status` command through ssh.

Cleanup/destroy parts has needed some modification, so that there will
be no leftovers from cloud init ISO image.

And finally, there was some tweaks for user-data cloud-init part (mainly
for ssh handling), so that `cloud-init status` will not report phony
errors.
2021-06-26 15:48:43 +02:00
cc4b4da253 Added wrapper on subprocess.run 2021-06-26 11:13:59 +02:00
82c52030c8 Fixes for log verbosity calculations 2021-06-26 10:35:29 +02:00
ca20f8dbe3 Added colored "logging" with adjusted verbosity. 2021-06-25 20:03:18 +02:00
8b28914deb Do not overwrite previously set options.
If user doesn't provide options from commandline during rebuild, such
option will be overwritten by those stored in VM XML, even if user
change such option in config file. This commit fixing that.
2021-06-20 14:30:22 +02:00
cbb0c6b5af Change description for create/rebuild and boxpy itself. 2021-06-20 14:29:44 +02:00
9bae81a993 Removed unneeded condition. 2021-06-20 11:33:24 +02:00
f8f3d3f819 Move setting defaults to Config class. 2021-06-05 20:23:53 +02:00
cd4bc42e54 Added check for already used port. 2021-06-05 20:12:25 +02:00
5cf00a3e09 Rework port for the ssh forwarding.
Till now, user has to provide port number (by commandline or through
config file), otherwise 2222 will be set. That's unfortunate in case you
need to have multiple machines and forgot about setting the correct
port. In this patch random port will be used if no port is provided.
2021-06-05 19:14:49 +02:00
81da9d7c13 Added ssh command 2021-06-05 17:54:14 +02:00
3f8dec1f2d Fix config behavior in case of empty args 2021-06-05 17:09:02 +02:00
1a058a1e2a Added fedora cloud to supported distros. 2021-06-04 18:39:10 +02:00
de61390d5e Added ability to select distro. Yet, we still have only one ;) 2021-06-04 18:37:03 +02:00
d78ed6db8b Parametrize user information 2021-06-04 16:43:06 +02:00
38e37f6274 Fixing some linting issues. 2021-06-04 16:38:00 +02:00
6e84b3befa Process template before reading files into cloud init. 2021-05-19 19:44:30 +02:00
4a46d793cb Parse filenames in global write_files section 2021-05-17 18:56:44 +02:00
074025c089 Make temporary files begin with meaningful prefix 2021-05-17 18:55:01 +02:00
c0e4ad966b Add ability to write files to be written on guest by providing filename. 2021-05-14 15:07:57 +02:00
d890f28eba Fixed bash completion for config; added default completion for all other options. 2021-05-14 14:19:00 +02:00
3b59622a68 Added warning if config file doesn't exists. 2021-05-14 13:46:15 +02:00
f6a458e1f9 Save absolute path to the user config file 2021-05-14 13:45:26 +02:00
3ebe6ff529 Changing option cloud-config to config 2021-05-14 13:44:17 +02:00
1e8bd7a37d Do not relay on vboxmanage output.
There is a function which retrieve information about VM by looking on
the 'vboxmanage vminfo' command. The output wasn't consistent, yet it
was fixed recently so that amount of memory was all wrong.

Currently the only thing which is searched for is the VM configuration
path, and all the rest is taken out from the XML VM definition.
2021-05-06 20:53:36 +02:00
78d696656e Rebuild now pass the config to the create function.
This will avoid overwriting all of the configuration during executing
vmcreate function, which initially doesn't know anything about existing
data - it only knows about passed through command line parameters. Now
it should be fixed.
2021-05-06 20:53:29 +02:00
6d0fa3445f Rearranged a bit Config class. 2021-05-06 20:53:21 +02:00
b557a6353d Added advanced feature.
In boxpy_data section it is possible to specify another nic and its type
to be attached to the vm:

boxpy_data:
  advanced:
    nic2: intnet
    nic3: hostonly

It's a stub for now, and only intnet will work by providing another nic,
which user should take care about providing configuration.
2021-05-06 20:50:33 +02:00
1bded7f75c Wait for VM to truly power off.
Added small sleep to wait for the machine to be truly down before
detaching ISO image.
2021-05-06 20:50:02 +02:00
30b7f1ab59 Fixed name clash on Config and VBoxManage objects.
There were two different things named with the same name in both
classes, which lead to conflict. This patch is fixing it.
2021-05-06 20:48:07 +02:00
8df0d31d25 Some minor tweaks 2021-05-05 20:42:39 +02:00
91f0019c78 Added cleanup for interrupted cloud-init 2021-05-05 20:24:07 +02:00
da1ae93fa2 Added ability for merging options using all possible ways.
Currently specifying attributes of VM was done by using command options
during creation, or only required VM name for rebuilding (due to smart
way of storing information within VM definition).

Now, there is possibility for providing all the information using
special key "boxpy_data" in user-script, so that there is no need to
provide that information from command line.

All three ways are respected with following order:

- default, which are hard coded in defaults
- custom user script passed by --cloud-config (or stored in vm in case
  of rebuild)
- information which is stored in VM definition (if exists - this only
  affects "rebuild" command)
- and finally highest priority have parameters passed by command line.
2021-05-05 20:15:39 +02:00
359d1cf440 Changed user-data-path param to cloud-config 2021-05-05 17:29:21 +02:00
ed5535cd4e Guard against interruption during invalid cloud config. 2021-05-05 17:25:59 +02:00
9da0e3f6ff Cacluate hostname out of vm name. 2021-04-20 11:56:46 +02:00
d4afa6e90b Added ssh port forwarding port option 2021-04-20 09:57:20 +02:00
03b6fdb8ec Remove irrelevant options from completion 2021-04-20 09:55:12 +02:00
c51603644b Added missing gnu sed definition and some cosmetic changes for completion script. 2021-04-13 21:44:14 +02:00
2984109bd5 Made a poor-man progress bar for waiting for cloud init. 2021-04-12 20:58:32 +02:00
05c3259c76 Changed defaults to use less resources 2021-04-12 20:57:52 +02:00