1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-01-26 15:15:20 +00:00

Compare commits

...

4 commits

Author SHA1 Message Date
catborise
6c0cc3c274
Merge pull request #620 from MisterBlueBear/global_setting_nic_type
Global setting for NIC type
2023-11-02 11:06:30 +03:00
catborise
bcf91ad7b7
Merge pull request #621 from MisterBlueBear/install_script_default_hostname
Install script accepts default hostname
2023-11-02 11:01:48 +03:00
MisterBlueBear
2f24f77368 Install script accepts default hostname 2023-11-01 20:35:15 -04:00
MisterBlueBear
7e8c05fff9 Global setting for NIC type 2023-11-01 18:08:38 -04:00
5 changed files with 58 additions and 5 deletions

View file

@ -0,0 +1,18 @@
# Generated by Django 4.2.5 on 2023-10-30 17:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('appsettings', '0008_auto_20220905_1459'),
]
operations = [
migrations.AlterField(
model_name='appsettings',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
]

View file

@ -0,0 +1,28 @@
# Generated by Django 4.2.5 on 2023-10-30 17:05
from django.db import migrations
from django.utils.translation import gettext_lazy as _
def add_default_settings(apps, schema_editor):
setting = apps.get_model("appsettings", "AppSettings")
db_alias = schema_editor.connection.alias
setting.objects.using(db_alias).bulk_create([
setting(35, _("VM NIC Type"), "INSTANCE_NIC_DEFAULT_TYPE", "default", "default,e1000,e1000e,rt18139,virtio", _("Change instance default NIC type"))
])
def del_default_settings(apps, schema_editor):
setting = apps.get_model("appsettings", "AppSettings")
db_alias = schema_editor.connection.alias
setting.objects.using(db_alias).filter(key="INSTANCE_NIC_DEFAULT_TYPE").delete()
class Migration(migrations.Migration):
dependencies = [
('appsettings', '0009_alter_appsettings_id')
]
operations = [
migrations.RunPython(add_default_settings,del_default_settings)
]

View file

@ -200,7 +200,7 @@
<div class="col-sm-7">
<select class="form-select" name="net_model">
{% for model in net_models_host %}
<option value="{{ model }}" {% if model == 'default' %} selected {% endif %}>{{ model }}</option>
<option value="{{ model }}" {% if model == default_nic_type %} selected {% endif %}>{{ model }}</option>
{% endfor %}
</select>
</div>
@ -476,7 +476,7 @@
<div class="col-sm-7">
<select class="form-select" name="net_model">
{% for model in net_models_host %}
<option value="{{ model }}" {% if model == 'default' %} selected {% endif %}>{{ model }}</option>
<option value="{{ model }}" {% if model == default_nic_type %} selected {% endif %}>{{ model }}</option>
{% endfor %}
</select>
</div>
@ -728,7 +728,7 @@
<div class="col-sm-7">
<select class="form-select" name="net_model">
{% for model in net_models_host %}
<option value="{{ model }}" {% if model == 'default' %} selected {% endif %}>{{ model }}</option>
<option value="{{ model }}" {% if model == default_nic_type %} selected {% endif %}>{{ model }}</option>
{% endfor %}
</select>
</div>

View file

@ -1692,6 +1692,7 @@ def create_instance(request, compute_id, arch, machine):
networks = sorted(conn.get_networks())
nwfilters = conn.get_nwfilters()
net_models_host = conn.get_network_models()
default_nic_type = app_settings.INSTANCE_NIC_DEFAULT_TYPE
storages = sorted(conn.get_storages(only_actives=True))
default_graphics = app_settings.QEMU_CONSOLE_DEFAULT_TYPE
default_cdrom = app_settings.INSTANCE_CDROM_ADD

View file

@ -424,9 +424,15 @@ until [[ $setupfqdn == "yes" ]] || [[ $setupfqdn == "no" ]]; do
case $setupfqdn in
[yY] | [yY][Ee][Ss] )
echo -n " Q. What is the FQDN of your server? ($(hostname --fqdn)): "
read -r fqdn
fqdn=$(hostname --fqdn)
echo -n " Q. What is the FQDN of your server? ($fqdn): "
read -r fqdn_from_user
setupfqdn="yes"
if [ ! -z $fqdn_from_user ]; then
fqdn=$fqdn_from_user
fi
echo " Setting to $fqdn"
echo ""
;;