Подготовка к 0.11: общий модуль core.py, каталог облачных образов, образцы вывода virsh
- web/core.py: настройки, авторизация, run_cmd, хранилище фоновых операций и шаблоны вынесены в общий модуль, чтобы новые функции жили в отдельных модулях; app.py пока не переключён; - web/catalog.py: официальные облачные образы Ubuntu 26.04/24.04, Debian 13, Alpine 3.23 (amd64/arm64) и типы ОС для установки с ISO; - tests/fixtures: реалистичный вывод virsh для тестов будущих парсеров; - presenters.format_bytes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LEUXMcdZo7b87mjkUsPgg
Этот коммит содержится в:
Vendored
@@ -0,0 +1,3 @@
|
||||
Capacity: 42949672960
|
||||
Allocation: 6442450944
|
||||
Physical: 6443499520
|
||||
@@ -0,0 +1,4 @@
|
||||
Type Device Target Source
|
||||
------------------------------------------------------------
|
||||
file disk vda /var/lib/virtuality/images/web01.qcow2
|
||||
file cdrom sda -
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
Domain: 'web01'
|
||||
cpu.time=48123456789
|
||||
cpu.user=30000000000
|
||||
cpu.system=18123456789
|
||||
balloon.current=2097152
|
||||
balloon.maximum=2097152
|
||||
balloon.rss=1534208
|
||||
vcpu.current=2
|
||||
vcpu.maximum=2
|
||||
vcpu.0.state=1
|
||||
vcpu.0.time=24000000000
|
||||
vcpu.0.wait=0
|
||||
vcpu.1.state=1
|
||||
vcpu.1.time=24123456789
|
||||
vcpu.1.wait=0
|
||||
|
||||
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
<domain type='kvm' id='1'>
|
||||
<name>web01</name>
|
||||
<uuid>6c1b3c1e-0000-0000-0000-000000000001</uuid>
|
||||
<title>Сайт компании</title>
|
||||
<description>Nginx + база. Бэкап по пятницам.</description>
|
||||
<memory unit='KiB'>2097152</memory>
|
||||
<currentMemory unit='KiB'>2097152</currentMemory>
|
||||
<vcpu placement='static'>2</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64' machine='pc-q35-10.2'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<disk type='file' device='disk'>
|
||||
<driver name='qemu' type='qcow2'/>
|
||||
<source file='/var/lib/virtuality/images/web01.qcow2'/>
|
||||
<target dev='vda' bus='virtio'/>
|
||||
</disk>
|
||||
<disk type='file' device='cdrom'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<target dev='sda' bus='sata'/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
<interface type='network'>
|
||||
<mac address='52:54:00:aa:bb:cc'/>
|
||||
<source network='virtuality-nat'/>
|
||||
<model type='virtio'/>
|
||||
</interface>
|
||||
<channel type='unix'>
|
||||
<target type='virtio' name='org.qemu.guest_agent.0'/>
|
||||
</channel>
|
||||
<graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
|
||||
<listen type='address' address='127.0.0.1'/>
|
||||
</graphics>
|
||||
</devices>
|
||||
</domain>
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
<network connections='2'>
|
||||
<name>virtuality-nat</name>
|
||||
<uuid>6c1b3c1e-1111-2222-3333-444444444444</uuid>
|
||||
<forward mode='nat'>
|
||||
<nat>
|
||||
<port start='1024' end='65535'/>
|
||||
</nat>
|
||||
</forward>
|
||||
<bridge name='virbr100' stp='on' delay='0'/>
|
||||
<mac address='52:54:00:12:34:56'/>
|
||||
<ip address='192.168.100.1' netmask='255.255.255.0'>
|
||||
<dhcp>
|
||||
<range start='192.168.100.50' end='192.168.100.200'/>
|
||||
<host mac='52:54:00:aa:bb:cc' name='web01' ip='192.168.100.51'/>
|
||||
</dhcp>
|
||||
</ip>
|
||||
</network>
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"children": [],
|
||||
"virtual-size": 42949672960,
|
||||
"filename": "/var/lib/virtuality/images/web01.qcow2",
|
||||
"cluster-size": 65536,
|
||||
"format": "qcow2",
|
||||
"actual-size": 6443499520,
|
||||
"format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "refcount-bits": 16, "corrupt": false}},
|
||||
"dirty-flag": false
|
||||
}
|
||||
Vendored
@@ -0,0 +1,9 @@
|
||||
Name: clean
|
||||
Domain: web01
|
||||
Current: yes
|
||||
State: running
|
||||
Location: internal
|
||||
Parent: -
|
||||
Children: 1
|
||||
Descendants: 1
|
||||
Metadata: yes
|
||||
Vendored
@@ -0,0 +1,4 @@
|
||||
Name Creation Time State
|
||||
------------------------------------------------------
|
||||
before-upd 2026-09-25 10:12:03 +0000 shutoff
|
||||
clean 2026-09-24 09:00:41 +0000 running
|
||||
Ссылка в новой задаче
Block a user