diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 709b55a4f65baf9dc4a1cda8148ba209750eade4..c3b1d6af95b7d8d98e5d4e5489629564fa75e9b2 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -8,7 +8,8 @@ on: # - cron: "0 0 * * 0" jobs: main: - runs-on: "ubuntu-20.04" + #! runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" steps: - name: "Checkout" uses: "actions/checkout@v2" @@ -44,10 +45,26 @@ jobs: # ali's| size, none-arch, layers; export DOCKER_REGISTRY_USER_infrastSubUser2=${{ secrets.DOCKER_REGISTRY_USER_INFRASTSUBUSER2 }} export DOCKER_REGISTRY_PW_infrastSubUser2=${{ secrets.DOCKER_REGISTRY_PW_INFRASTSUBUSER2 }} - + # tencloud| type:Docker-Manifest-List; none: size, arch, layers; x10:x500; slowPushBack; + export DOCKER_REGISTRY_TENCLOUD_USER=${{ secrets.DOCKER_REGISTRY_TENCLOUD_USER }} + export DOCKER_REGISTRY_TENCLOUD_PASS=${{ secrets.DOCKER_REGISTRY_TENCLOUD_PASS }} + # qingcloud| tag, size-only; none-arch,layer; + export DOCKER_REGISTRY_QCLOUD_USER=${{ secrets.DOCKER_REGISTRY_QCLOUD_USER }} + export DOCKER_REGISTRY_QCLOUD_PASS=${{ secrets.DOCKER_REGISTRY_QCLOUD_PASS }} + export REPO_HUB=registry-1.docker.io export REPO_ALI=registry.cn-shenzhen.aliyuncs.com + export REPO_TEN=ccr.ccs.tencentyun.com + export REPO_TEN_HK=hkccr.ccs.tencentyun.com + export REPO_QING=dockerhub.qingcloud.com export REPO=$REPO_ALI #REPO_HUB REPO_ALI ##without "xx/" + + + # JUST LOGIN HERE + # echo "${DOCKER_REGISTRY_TENCLOUD_PASS}" |docker login --username=${DOCKER_REGISTRY_TENCLOUD_USER} --password-stdin $REPO_TEN + echo "${DOCKER_REGISTRY_TENCLOUD_PASS}" |docker login --username=${DOCKER_REGISTRY_TENCLOUD_USER} --password-stdin $REPO_TEN_HK + # echo "${DOCKER_REGISTRY_QCLOUD_PASS}" |docker login --username=${DOCKER_REGISTRY_QCLOUD_USER} --password-stdin $REPO_QING + echo doBuild; doBuild=true test "true" == "$doBuild" && bash build/buildx.sh #nginx diff --git a/README.md b/README.md index 9c46c66fb8260c99a3c6a0fc0e5845f7932b0dfd..4a6c4bd15db7cce7ff1397b6bfcc12bb228cbd05 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,11 @@ - -**Docs** - -- arm64 - - [250107a-arm64-vm.md](./docs/250107a-arm64-vm.md) 「alpine313.ARM环境虚机: virter.vm模板调整+`share/qemu/firmware/60-edk2-aarch64.json`修正」 - - [250107b-arm64-images.md](./docs/250107b-arm64-images.md) 「Debian/Ubuntu, Alma/Rocky, Alpine的尝试」 - - [250113-arm64-rk3588.md](./docs/250113-arm64-rk3588.md) 「两台AIEC板子,Linaro系统下的KVM运行尝试」 -- virter - - [vt-250108-images.md](./docs/vt-250108-images.md) 「vtOrgDocs, http-reg.availabel, ophub-armbian」 - - vtOrgDocs:`images,import,network,provision,ssh.nux/win` - - ophub-armbian:`ubt22-jammy,ubt24-noble; deb11-bullseye, deb12-bookworm` - - [vt-250111-network.md](./docs/vt-250111-network.md) 「vt/virtMgr网络模式: `nat bridge route, none; +open, isolated, SR-IOV`」 - - [vt-250124-registry.md](./docs/vt-250124-registry.md) 「testPush`(aliFail, harborOK)`;镜像转存harbor」 -- kubeVirt - - [kvirt-250509-ins01.md](./docs/kvirt-250509-ins01.md) 「citydev集群-v1.21.10版、k3s,ke集群-v1.26版」 - - [kvirt-250512-use01.md](./docs/kvirt-250512-use01.md) 「vmi vmCreate vmAccess vmTypes,Refs」 - -## docker-libvirtd +```markdown +# docker-libvirtd Alpine Linux libvirt (qemu+kvm) docker image, GitHub action is setup ~~so this image is __updated every week__.~~ -**QuickStart** +## QuickStart -_docker run_: +### docker run: ```sh mkdir -p run var @@ -38,10 +22,29 @@ echo REPO=registry.cn-shenzhen.aliyuncs.com/ > .env dcp pull; dcp up -d ``` -_libvirtd clients_ examples: +### libvirtd clients examples: ```sh virsh -c qemu:///system?socket=$(pwd)/run/libvirt-sock virt-manager -c qemu:///system?socket=$(pwd)/run/libvirt-sock +``` + +## Docs + +### arm64 +- [250107a-arm64-vm.md](./docs/250107a-arm64-vm.md) 「alpine313.ARM环境虚机: virter.vm模板调整+`share/qemu/firmware/60-edk2-aarch64.json`修正」 +- [250107b-arm64-images.md](./docs/250107b-arm64-images.md) 「Debian/Ubuntu, Alma/Rocky, Alpine的尝试」 +- [250113-arm64-rk3588.md](./docs/250113-arm64-rk3588.md) 「两台AIEC板子,Linaro系统下的KVM运行尝试」 + +### virter +- [vt-250108-images.md](./docs/vt-250108-images.md) 「vtOrgDocs, http-reg.availabel, ophub-armbian」 + - vtOrgDocs:`images,import,network,provision,ssh.nux/win` + - ophub-armbian:`ubt22-jammy,ubt24-noble; deb11-bullseye, deb12-bookworm` +- [vt-250111-network.md](./docs/vt-250111-network.md) 「vt/virtMgr网络模式: `nat bridge route, none; +open, isolated, SR-IOV`」 +- [vt-250124-registry.md](./docs/vt-250124-registry.md) 「testPush`(aliFail, harborOK)`;镜像转存harbor」 + +### kubeVirt +- [kvirt-250509-ins01.md](./docs/kvirt-250509-ins01.md) 「citydev集群-v1.21.10版、k3s,ke集群-v1.26版」 +- [kvirt-250512-use01.md](./docs/kvirt-250512-use01.md) 「vmi vmCreate vmAccess vmTypes,Refs」 ``` \ No newline at end of file diff --git a/build/Dockerfile.ubt b/build/Dockerfile.ubt new file mode 100644 index 0000000000000000000000000000000000000000..2413ae34e4e60780f393927c73531c959a1464ee --- /dev/null +++ b/build/Dockerfile.ubt @@ -0,0 +1,240 @@ +# https://github.com/iYongHsu/debian-libvirtkvm/blob/main/Dockerfile #arm +# https://github.com/iYongHsu/debian-libvirtkvm/blob/main/Dockerfile.x86 +# FROM debian:11 +# LABEL maintainer='iYong' +ARG VER=20.04 +FROM registry.cn-shenzhen.aliyuncs.com/infrasync/v2025:library--ubuntu---${VER} +ARG TARGETPLATFORM +ARG VER=20.04 +ENV \ + DEBIAN_FRONTEND=noninteractive +RUN echo "Acquire {\n\ + APT::Get::Allow-Unauthenticated \"true\";\n\ + GPG::Ignore \"true\";\n\ + AllowInsecureRepositories \"true\";\n\ + AllowDowngradeToInsecureRepositories \"true\";\n\ +}" > /etc/apt/apt.conf.d/skip-gpg-check-ig; \ + # default:echo -e; + echo "path-exclude /usr/share/doc/*\n\ +path-exclude /usr/share/man/*\n\ +path-exclude /usr/share/locale/*\n\ +path-exclude /usr/share/info/*\n\ +path-exclude /usr/share/help/*\n\ +path-exclude /usr/share/lintian/*\n\ +" > /etc/dpkg/dpkg.cfg.d/excludes; +RUN export DOMAIN="mirrors.ustc.edu.cn"; \ + case ${VER} in \ + "14.04") V2=trusty ;; \ + "16.04") V2=xenial ;; \ + "18.04") V2=bionic ;; \ + "20.04") V2=focal ;; \ + "22.04") V2=jammy ;; \ + "24.04") V2=noble ;; \ + esac; \ + # test -z "$(echo $TARGETPLATFORM |grep arm)" && target=ubuntu || target=ubuntu-ports; \ + # test "24.04" != "${VER}" && echo "deb http://${DOMAIN}/$target ${V2} main restricted universe multiverse" > /etc/apt/sources.list \ + # test "24.04" != "${VER}" && echo "deb http://${DOMAIN}/$target ${V2}-updates main restricted universe multiverse">> /etc/apt/sources.list; \ + # https://mirrors.ustc.edu.cn/help/ubuntu.html + sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list; \ + sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list; \ + sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list.d/ubuntu.sources; \ + sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/ubuntu.sources; \ + # rm -f /etc/apt/sources.list.d/*; \ + echo 'apt update -qq && apt install -yq --no-install-recommends $@ && apt clean; rm -rf /var/lib/apt/lists/*; ' > /usr/local/bin/apt.sh \ + && chmod +x /usr/local/bin/apt.sh; + +RUN \ + apt.sh wget ca-certificates \ + curl \ + htop rsync tree tmux lrzsz psmisc fuse net-tools iputils-ping \ + procps sudo iproute2 iptables zip unzip xz-utils vim-tiny \ + # lame \ + openssh-sftp-server lftp jq + +# # root@00d274c95a5f:/# apt install qemu-system-* +# Note, selecting 'qemu-system-x86' for glob 'qemu-system-*' +# Note, selecting 'qemu-system-x86-microvm' for glob 'qemu-system-*' +# Note, selecting 'qemu-system-x86-xen' for glob 'qemu-system-*' +# # Note, selecting 'qemu-system-x86-64' for glob 'qemu-system-*' +# # Note, selecting 'qemu-system-i386' for glob 'qemu-system-*' +# Note, selecting 'qemu-system-arm' for glob 'qemu-system-*' +# # Note, selecting 'qemu-system-aarch64' for glob 'qemu-system-*' +# Note, selecting 'qemu-system-mips' for glob 'qemu-system-*' +# Note, selecting 'qemu-system-s390x' for glob 'qemu-system-*' +# Note, selecting 'qemu-system-ppc' for glob 'qemu-system-*' +# # Note, selecting 'qemu-system-ppc64' for glob 'qemu-system-*' +# Note, selecting 'qemu-system-sparc' for glob 'qemu-system-*' +# # Note, selecting 'qemu-system-sparc64' for glob 'qemu-system-*' +# Note, selecting 'qemu-system-common' for glob 'qemu-system-*' +# Note, selecting 'qemu-system-gui' for glob 'qemu-system-*' +# Note, selecting 'qemu-system-misc' for glob 'qemu-system-*' +# Note, selecting 'qemu-system-data' for glob 'qemu-system-*' +# +# Note, selecting 'qemu-system-x86' instead of 'qemu-system-i386' +# Note, selecting 'qemu-system-x86' instead of 'qemu-system-x86-64' +# Note, selecting 'qemu-system-arm' instead of 'qemu-system-aarch64' +# Note, selecting 'qemu-system-ppc' instead of 'qemu-system-ppc64' +# Note, selecting 'qemu-system-sparc' instead of 'qemu-system-sparc64' +# +# qemu-system-x86-xen : Conflicts: qemu-system-x86 but 1:4.2-3ubuntu6.30 is to be installed + + +# ref.deb11.x64-for-arm?: without --no-install-recommends + # apt update -y \ + # && apt install -y gconf2 qemu-system-arm qemu-utils qemu-efi ipxe-qemu libvirt-daemon-system libvirt-clients bridge-utils virtinst virt-manager seabios vgabios gir1.2-spiceclientgtk-3.0 xauth +RUN apt.sh \ + qemu-system-x86 qemu-system-arm qemu-system-ppc qemu-utils ipxe-qemu \ + libvirt-daemon-system libvirt-clients virtinst \ + # virt-manager gir1.2-spiceclientgtk-3.0 xauth\ + bridge-utils seabios vgabios ; + # apt clean; rm -rf /var/lib/apt/lists/*; +# ubt24-none: qemu-efi gconf2 +RUN \ + test "24.04" != "${VER}" && apt.sh gconf2 qemu-efi; \ + exit 0 + +# $ pkgsize |grep noto +# 0.03 Mbs fonts-noto|20200323-1build1~ubuntu20.04.1 +# 0.15 Mbs fonts-noto-mono|20200323-1build1~ubuntu20.04.1 +# 34.98 Mbs fonts-noto-core|20200323-1build1~ubuntu20.04.1 +# +# 0.03 Mbs fonts-noto-hinted|20200323-1build1~ubuntu20.04.1 +# 0.96 Mbs fonts-noto-unhinted|20200323-1build1~ubuntu20.04.1 +# 4.54 Mbs fonts-noto-ui-core|20200323-1build1~ubuntu20.04.1 +# 10.36 Mbs fonts-noto-color-emoji|0~20200916-1~ubuntu20.04.1 +# 59.78 Mbs fonts-noto-ui-extra|20200323-1build1~ubuntu20.04.1 +# 87.73 Mbs fonts-noto-cjk|1:20190410+repack1-2 +# 206.75 Mbs fonts-noto-cjk-extra|1:20190410+repack1-2 +# 314.97 Mbs fonts-noto-extra|20200323-1build1~ubuntu20.04.1 +RUN \ + # xz-utils vim wget openssh-server + apt.sh fonts-noto fonts-noto-core fonts-noto-mono dnsmasq \ + supervisor dropbear git +RUN \ + # f=/etc/ssh/sshd_config; \ + # sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" $f; \ + # sed -i "s/#Port 22/Port 1022/g" $f; \ + # sed -i "s/#X11Forwarding yes/X11Forwarding yes/g" $f; \ + # sed -i "s/#X11DisplayOffset/X11DisplayOffset/g" $f; \ + # sed -i "s/#X11UseLocalhost yes/X11UseLocalhost no/g" $f; \ + # \ + sed -i 's/#user = "root"/user = "root"/' /etc/libvirt/qemu.conf; \ + sed -i 's/#group = "root"/group = "root"/' /etc/libvirt/qemu.conf; \ + # \ + # && echo 'root:debian' | chpasswd \ + # && echo '#!/bin/bash\nLOGTIME=$(date "+%Y-%m-%d %H:%M:%S")\necho "[$LOGTIME] startup run..."\nservice ssh start\nlibvirtd -d && virtlogd -d' >/init.sh + # && chmod +x /init.sh \ + # && echo 'if [ -f /init.sh ]; then\n ./init.sh\nfi' >>/root/.bashrc \ + exit 0; + + + + +# ref ./Dockerfile alpine's ver +# ohmybash: font> axin(badColorView@alpine3.13) >> axin-viewOK @3.13.12; +RUN \ + bash -c "$(wget https://gitee.com/g-system/oh-my-bash/raw/sam-custom/tools/install.sh -O -)"; \ + sed -i 's/OSH_THEME.*/OSH_THEME="axin"/g' /root/.bashrc; cat /root/.bashrc |grep axin; + +# tini,gosu +# https://github.com/krallin/tini/releases/download/v0.19.0/tini-static-muslc-amd64 +# https://github.com/tianon/gosu/releases/download/1.11/gosu-$arch + +# virter-v0.24.0 +RUN \ + case ${TARGETPLATFORM} in \ + "linux/amd64") arch=amd64 ;; \ + "linux/arm64") arch=arm64 ;; \ + "linux/arm/v7") arch=arm ;; \ + "linux/ppc64le") arch=ppc64le ;; \ + "linux/arm/v6") arch=NONE_armel ;; \ + "linux/386") arch=NONE_i386 ;; \ + esac; \ + file=virter-linux-$arch; \ + # https://github.com/infrastlabs/fk-virter/releases/download/v24.12/virter-linux-amd64 #none: xx-upx.tar.gz (err@23.2-kylin) + test -s $file || wget -O $file https://github.com/infrastlabs/fk-virter/releases/download/v24.12/$file; \ + chmod +x $file; mv $file /bin/virter; + +RUN \ + echo "welcome! virter." > /etc/motd; \ + TIMEZONE=Asia/Shanghai; \ + ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && echo $TIMEZONE > /etc/timezone; \ + #bin-link + mv /bin/sh /bin/busy_sh && ln -s /bin/bash /bin/sh; \ + \ + mkdir -p /etc/dropbear /var/log/supervisor; \ + # echo -e "#!/bin/bash\ntest -z "\$1" && exit 0; supervisord ctl \$@" > /usr/local/bin/sv; chmod +x /usr/local/bin/sv; \ + \ + # + ##ssh + sed -i "s^/bin/ash^/bin/bash^g" /etc/passwd; \ + echo "root:root" |chpasswd; + +ENV \ + TERM=xterm \ + SHELL=/bin/bash \ + # TIMEZONE=Asia/Shanghai \ + # LANG=C.UTF-8 \ + # SSHD_ENABLE=true \ + SSHD_PORT=60022 + + +# COPY --from=virter-alpine313 /usr/share/qemu/edk2-arm-vars.fd /usr/share/qemu/edk2-arm-vars.fd +ADD ./dot/ /root/ +COPY supervisord.conf /etc/supervisord.conf + +VOLUME ["/var/run/libvirt/", "/var/lib/libvirt"] +# ENTRYPOINT ["/sbin/tini","--"] +CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"] + +# ubt24 +# cat > /etc/apt/apt.conf.d/skip-gpg-check-ig < /dev/null 2>&1; errCode=$? +if [ "0" == "$errCode" ]; then + # ref pulse05.md + # apk stats + # apk list -I |egrep "ogg|opus|flac|vorbis|sndfile" |grep -v dev |sort + # apk info -s zstd-libs; #apk info -s -R -L + + # ref t8-pkg.md + pkgs=$(apk info --no-network --no-progress 2>/dev/null) + # apk info --no-network -s $pkgs |sed ":a;N;s/installed size:\n/ /g;ta" |grep -v "^$" |awk '{print $2$3"|"$1}' |sort + # echo xx |awk '{printf("%05d%s\n",5,"aa")}' + apk info --no-network -s $pkgs 2>/dev/null |sed ":a;N;s/installed size:\n/ /g;ta" |grep -v "^$" |awk '{printf("%03s|%04d|%s\n",$3,$2,$1)}' |sort + # TODO: + # alpine_3.8: pcmanfm-1.2.5-r2 442368 ##trans_like_rpm's + # alpine_319: zstd-libs-1.5.5-r8 712 KiB +fi + +apt --version > /dev/null 2>&1; errCode=$? #dpkg --version +if [ "0" == "$errCode" ]; then + # https://github.com/pointtonull/dotfiles/blob/ce4dea17af1c1ea26afcefd4794826f507e9e028/user/bin/dpkg-busca + LANG="C" + if [ $# = 0 ]; then + dpkg-query -W --showformat='${Installed-Size} ${Package}|${Version}\n' | awk 'BEGIN{formato="%4.2f Mbs\t%s\n"}{total+=$1; if ( NF == 1) printf formato, 0, $1; else; if ( NF == 2 ) printf formato, $1/1024, $2}; END{printf formato,total/1024, "TOTALES" }' | sort -n + exit 0 + else + dpkg-query -W --showformat='${Installed-Size} ${Package}|${Version}\n' $(apt-cache search $* | awk '{print $1}') 2>/dev/null | awk 'BEGIN{formato="%4.2f Mbs\t%s\n"}{total+=$1; if ( NF == 1) printf formato, 0, $1; else; if ( NF == 2 ) printf formato, $1/1024, $2}; END{printf formato,total/1024, "TOTALES" }' | sort -n + exit 0 + fi +fi + + +rpm --version > /dev/null 2>&1; errCode=$? +if [ "0" == "$errCode" ]; then + # rpm + # rpm -qa --queryformat '%11{SIZE}\n' | xargs -d '\n' -n 1 echo + # rpm -qa --queryformat '%{SIZE} %{NAME}-%{VERSION}-%{ARCH}\n' + # + # $1/1024/1024 + rpm -qa --queryformat '%{SIZE} %{NAME}-%{VERSION}-%{ARCH}\n' | awk 'BEGIN{formato="%4.2f Mbs\t%s\n"}{total+=$1; if ( NF == 1) printf formato, 0, $1; else; if ( NF == 2 ) printf formato, $1/1024/1024, $2}; END{printf formato,total/1024/1024, "TOTALES" }' | sort -n +fi diff --git a/build/buildx.sh b/build/buildx.sh index f4c4f9e94a48e2e503d8c4f3a5f2da824e177d83..f1c87011feb3bee6d8de96b34388360511533067 100644 --- a/build/buildx.sh +++ b/build/buildx.sh @@ -12,18 +12,21 @@ echo "${DOCKER_REGISTRY_PW_dockerhub}" |docker login --username=${DOCKER_REGISTR function doBuildx(){ local tag=$1 local dockerfile=$2 + local dver=$3; repo=registry-1.docker.io # repo=registry.cn-shenzhen.aliyuncs.com test ! -z "$REPO" && repo=$REPO #@gitac img="docker-libvirtd:$tag" # cache - ali="registry.cn-shenzhen.aliyuncs.com" + # ali="registry.cn-shenzhen.aliyuncs.com" + ali=$REPO_TEN_HK cimg="docker-libvirtd:$tag-cache" #tag-cache cache="--cache-from type=registry,ref=$ali/$ns/$cimg --cache-to type=registry,ref=$ali/$ns/$cimg" # plat="--platform linux/amd64,linux/arm64,linux/arm" - plat="--platform linux/amd64,linux/arm64" ##,linux/arm + plat="--platform linux/amd64,linux/arm64,linux/ppc64le" ##,linux/arm + # plat="--platform linux/amd64" compile="alpine-compile"; # test "$plat" != "--platform linux/amd64,linux/arm64,linux/arm" && compile="${compile}-dbg" @@ -31,14 +34,11 @@ function doBuildx(){ args=""" --provenance=false --build-arg REPO=$repo/ + --build-arg VER=$dver --build-arg COMPILE_IMG=$compile --build-arg NOCACHE=$(date +%Y-%m-%d_%H:%M:%S) """ - # cd flux - # test "$plat" != "--platform linux/amd64,linux/arm64,linux/arm" && img="${img}-dbg" - # test "$plat" != "--platform linux/amd64,linux/arm64,linux/arm" && cimg="${cimg}-dbg" - cache="--cache-from type=registry,ref=$ali/$ns/$cimg --cache-to type=registry,ref=$ali/$ns/$cimg" output="--output type=image,name=$repo/$ns/$img,push=true,oci-mediatypes=true,annotation.author=sam" docker buildx build $cache $plat $args $output -f $dockerfile . } @@ -46,4 +46,8 @@ function doBuildx(){ cd $cur/ ns=infrastlabs ver=v51 #base-v5 base-v5-slim -doBuildx v2501-alpine319 Dockerfile #latest> v2501 +# doBuildx v2501-alpine319 Dockerfile #latest> v2501 +doBuildx v2501-ubt2004 Dockerfile.ubt 20.04 & +doBuildx v2501-ubt2204 Dockerfile.ubt 22.04 & +doBuildx v2501-ubt2404 Dockerfile.ubt 24.04 & +wait diff --git a/build/dot/.config/virter/images.toml b/build/dot/.config/virter/images.toml index fa1658aee2941dff8c919e8df15f0b3af3f6d398..ac0509243ac31c3bc1b2a3c77e96fbfe1bc18eb6 100644 --- a/build/dot/.config/virter/images.toml +++ b/build/dot/.config/virter/images.toml @@ -8,83 +8,97 @@ url = "https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/cloud/nocloud_alpine-3.20.3-x86_64-bios-cloudinit-r0.qcow2" [alpine-v320-arm64] #212M url = "https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/cloud/nocloud_alpine-3.20.0-aarch64-uefi-cloudinit-r0.qcow2" +# https://dl-cdn.alpinelinux.org/alpine/v3.22/releases/cloud/ #v3.20/3.22: x64/arm64 only # TODO1: virter不支持xz # openEuler https://www.openeuler.org/zh/download/#cloud # qcow_acc: root:openEuler12#$ ##https://docs.openeuler.org/zh/docs/24.03_LTS_SP1/docs/Releasenotes/帐号清单.html [openeuler-v24] #508M > 1.49G unpack@40.253 # url = "https://mirrors.jxust.edu.cn/openeuler/openEuler-24.03-LTS-SP1/virtual_machine_img/x86_64/openEuler-24.03-LTS-SP1-x86_64.qcow2.xz" -url = "http://172.29.30.253:81/2501/qcow/openEuler-24.03-LTS-SP1-x86_64.qcow2" +url = "http://172.29.40.253:81/2501/qcow/openEuler-24.03-LTS-SP1-x86_64.qcow2" [openeuler-v24-arm64] #473M > 1.52G # url = "https://mirrors.jxust.edu.cn/openeuler/openEuler-24.03-LTS-SP1/virtual_machine_img/aarch64/openEuler-24.03-LTS-SP1-aarch64.qcow2.xz" -url = "http://172.29.30.253:81/2501/qcow/openEuler-24.03-LTS-SP1-aarch64.qcow2" +url = "http://172.29.40.253:81/2501/qcow/openEuler-24.03-LTS-SP1-aarch64.qcow2" [openeuler-v22] #508M > 1.49G unpack@40.253 # url = "https://mirror.nyist.edu.cn/openeuler/openEuler-22.03-LTS-SP4/virtual_machine_img/x86_64/openEuler-22.03-LTS-SP4-x86_64.qcow2.xz" -url = "http://172.29.30.253:81/2501/qcow/openEuler-22.03-LTS-SP4-x86_64.qcow2" +url = "http://172.29.40.253:81/2501/qcow/openEuler-22.03-LTS-SP4-x86_64.qcow2" [openeuler-v22-arm64] #473M > 1.52G # url = "https://mirror.nyist.edu.cn/openeuler/openEuler-22.03-LTS-SP4/virtual_machine_img/aarch64/openEuler-22.03-LTS-SP4-aarch64.qcow2.xz" -url = "http://172.29.30.253:81/2501/qcow/openEuler-22.03-LTS-SP4-aarch64.qcow2" - +url = "http://172.29.40.253:81/2501/qcow/openEuler-22.03-LTS-SP4-aarch64.qcow2" +# org-none; existed: aarch64 loongarch64 riscv64 x86_64 # openSUSE leapmicro https://get.opensuse.org/leapmicro/6.1/#download [opensuse-micro-v61] #1.2 GiB url = "https://download.opensuse.org/distribution/leap-micro/6.1/appliances/openSUSE-Leap-Micro.x86_64-Default-qcow.qcow2" [opensuse-micro-v61-arm64] #1.2 GiB url = "https://download.opensuse.org/distribution/leap-micro/6.1/appliances/openSUSE-Leap-Micro.aarch64-Default-qcow.qcow2" +# non-ppc64; https://download.opensuse.org/distribution/leap-micro/6.2/appliances/ # armbian: jammy_current_6.6.69-sdk # armbian https://github.com/armbian/sdk ##Armbian Jammy{x86/arm64, iso/qcow2, preinstalled Docker, TODO:autologin:armbian, } [armbian-v22] #1.03 GB> unpacck:4.11G # url = "https://github.com/armbian/sdk/releases/download/24.11.2/Armbian_24.11.2_Uefi-x86_jammy_current_6.6.69-sdk.img.qcow2.xz" -url = "http://172.29.30.253:81/2501/qcow/2025-01-10-12-25-20-sdk-Armbian_24.11.2_Uefi-x86_jammy_current_6.6.69-sdk.img.qcow2" +url = "http://172.29.40.253:81/2501/qcow/2025-01-10-12-25-20-sdk-Armbian_24.11.2_Uefi-x86_jammy_current_6.6.69-sdk.img.qcow2" [armbian-v22-arm64] #1020 MB> unpacck:4.11G # url = "https://github.com/armbian/sdk/releases/download/24.11.2/Armbian_24.11.2_Uefi-arm64_jammy_current_6.6.69-sdk.img.qcow2.xz" -url = "http://172.29.30.253:81/2501/qcow/2025-01-10-12-24-48-sdk-Armbian_24.11.2_Uefi-arm64_jammy_current_6.6.69-sdk.img.qcow2" +url = "http://172.29.40.253:81/2501/qcow/2025-01-10-12-24-48-sdk-Armbian_24.11.2_Uefi-arm64_jammy_current_6.6.69-sdk.img.qcow2" # ophub-armbian [ophub-armbian-deb11-arm64] #656 MB> 1.85G # url = "https://github.com/ophub/amlogic-s9xxx-armbian/releases/download/Armbian_bullseye_save_2025.01/Armbian_25.02.0-trunk_5.02.0.img.gz" -url = "http://172.29.30.253:81/2501/qcow/2025-01-10-14-35-48-amlogic-s9xxx-armbian-Armbian_25.02.0-trunk_5.02.0-deb11-bullseye.img" +url = "http://172.29.40.253:81/2501/qcow/2025-01-10-14-35-48-amlogic-s9xxx-armbian-Armbian_25.02.0-trunk_5.02.0-deb11-bullseye.img" [ophub-armbian-ubt24-arm64] #783 MB> 2.26G # url = "https://github.com/ophub/amlogic-s9xxx-armbian/releases/download/Armbian_noble_save_2025.01/Armbian_25.02.0-trunk_5.02.0.img.gz " -url = "http://172.29.30.253:81/2501/qcow/2025-01-10-12-36-06-amlogic-s9xxx-armbian-Armbian_25.02.0-trunk_5.02.0-ubt24-noble.img" +url = "http://172.29.40.253:81/2501/qcow/2025-01-10-12-36-06-amlogic-s9xxx-armbian-Armbian_25.02.0-trunk_5.02.0-ubt24-noble.img" ########################## +# https://cloud-images.ubuntu.com ##conn-err @25.8.20 +# cloud-images.ubuntu.com>> https://mirrors.huaweicloud.com/ubuntu-cloud-images ##error="bad http status: 418 " +# cloud-images.ubuntu.com>> https://mirrors.ustc.edu.cn/ubuntu-cloud-images ##error="bad http status: 403 Forbidden"; firefox:Verifying your browser +# cloud-images.ubuntu.com>> https://mirrors.tuna.tsinghua.edu.cn/ubuntu-cloud-images ##error="bad http status: 403 Forbidden" +# cloud-images.ubuntu.com>> http://172.29.40.253:81/2501/qcow_ubt/ # http://cloud-images.ubuntu.com/daily/server/focal/current/?C=D;O=A # https://cloud-images.ubuntu.com/focal/current/?C=D;O=A [ubuntu-v24] #581M| 无:amd64-disk-kvm.img -url = "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img" +url = "http://172.29.40.253:81/2501/qcow_ubt/noble/current/noble-server-cloudimg-amd64.img" [ubuntu-v22] #635M| 605M 有且仅:amd64-disk-kvm.img; UEFI/GPT Bootable disk image,with linux-kvm KVM optimised kernel -# url = "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img" -url = "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64-disk-kvm.img" +# url = "http://172.29.40.253:81/2501/qcow_ubt/jammy/current/jammy-server-cloudimg-amd64.img" +url = "http://172.29.40.253:81/2501/qcow_ubt/jammy/current/jammy-server-cloudimg-amd64-disk-kvm.img" [ubuntu-v20] #608M| 587M 有且仅:amd64-disk-kvm.img -# url = "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img" -url = "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64-disk-kvm.img" +# url = "http://172.29.40.253:81/2501/qcow_ubt/focal/current/focal-server-cloudimg-amd64.img" +url = "http://172.29.40.253:81/2501/qcow_ubt/focal/current/focal-server-cloudimg-amd64-disk-kvm.img" [ubuntu-v18] #387M, arm:359M| 无:amd64-disk-kvm.img -url = "https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img" +url = "http://172.29.40.253:81/2501/qcow_ubt/bionic/current/bionic-server-cloudimg-amd64.img" [ubuntu-v16] #301M, uefi:311M -# url = "https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img" -url = "https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-uefi1.img" +# url = "http://172.29.40.253:81/2501/qcow_ubt/xenial/current/xenial-server-cloudimg-amd64-disk1.img" +url = "http://172.29.40.253:81/2501/qcow_ubt/xenial/current/xenial-server-cloudimg-amd64-uefi1.img" [ubuntu-v16-arm64] #448M, uefi:461M, armhf:443M -# url = "https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-disk1.img" -url = "https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-uefi1.img" +# url = "http://172.29.40.253:81/2501/qcow_ubt/xenial/current/xenial-server-cloudimg-arm64-disk1.img" +url = "http://172.29.40.253:81/2501/qcow_ubt/xenial/current/xenial-server-cloudimg-arm64-uefi1.img" [ubuntu-v20-arm64] #579.92M -url = "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-arm64.img" +url = "http://172.29.40.253:81/2501/qcow_ubt/focal/current/focal-server-cloudimg-arm64.img" [ubuntu-v24-arm64] #574M -url = "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-arm64.img" +url = "http://172.29.40.253:81/2501/qcow_ubt/noble/current/noble-server-cloudimg-arm64.img" +[ubuntu-v16-ppc64] #306M +url = "http://172.29.40.253:81/2501/qcow_ubt/xenial/current/xenial-server-cloudimg-ppc64el-disk1.img" +[ubuntu-v20-ppc64] #608M +url = "http://172.29.40.253:81/2501/qcow_ubt/focal/current/focal-server-cloudimg-ppc64el.img" +[ubuntu-v24-ppc64] #607M +url = "http://172.29.40.253:81/2501/qcow_ubt/noble/current/noble-server-cloudimg-ppc64el.img" + ########################## # https://www.debian.org/distrib/ #Debian云映像; nocloud:本地QEMU虚拟机 # https://cloud.debian.org/images/cloud/ #HTTP.README -[debian-12] #419M| qcow:397M> tar.gz:250M |gen.cloud:329M x64/arm64都有 +[debian-12] #419M| qcow:397M> tar.gz:250M |gen.cloud:329M x64/arm64都有; +ppc64 # url = "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2" # url = "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-amd64.qcow2" url = "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2" -[debian-11] #342M| qcow:322M> tar.gz:207M |gen.cloud:270M x64/arm64都有 +[debian-11] #342M| qcow:322M> tar.gz:207M |gen.cloud:270M x64/arm64都有; none-ppc64 # url = "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-amd64.qcow2" # url = "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-nocloud-amd64.qcow2" url = "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.qcow2" -[debian-10] #290M| qcow:282M> tar.gz:184M |gen.cloud:241M 只x64才有 +[debian-10] #290M| qcow:282M> tar.gz:184M |gen.cloud:241M 只x64才有; none-ppc64 # url = "https://cloud.debian.org/images/cloud/buster/latest/debian-10-generic-amd64.qcow2" # url = "https://cloud.debian.org/images/cloud/buster/latest/debian-10-nocloud-amd64.qcow2" url = "https://cloud.debian.org/images/cloud/buster/latest/debian-10-genericcloud-amd64.qcow2" @@ -100,6 +114,8 @@ url = "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcl [debian-12-arm64] #qcow:386M> tar.gz:235M |gen.cloud:320M # url = "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-arm64.qcow2" url = "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-arm64.qcow2" +[debian-12-ppc64] #qcow:374M, tar.gz:236M, raw:3.0G +url = "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-ppc64el.qcow2" ########################## [centos-8] #1.2G @@ -108,6 +124,11 @@ url = "https://cloud.centos.org/centos/8/x86_64/images/CentOS-8-GenericCloud-8.4 url = "https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2" [centos-6] #769M url = "https://cloud.centos.org/centos/6/images/CentOS-6-x86_64-GenericCloud.qcow2" +[centos-8-arm64] #1.2G +url = "https://cloud.centos.org/centos/8/aarch64/images/CentOS-8-GenericCloud-8.4.2105-20210603.0.aarch64.qcow2" +[centos-8-ppc64] #1.3G +url = "https://cloud.centos.org/centos/8/ppc64le/images/CentOS-8-GenericCloud-8.4.2105-20210603.0.ppc64le.qcow2" + [amazonlinux-2] #1.3G # url = "https://cdn.amazonlinux.com/os-images/2.0.20230418.0/kvm/amzn2-kvm-2.0.20230418.0-x86_64.xfs.gpt.qcow2" @@ -121,6 +142,9 @@ url = "https://download.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-Generic url = "https://download.rockylinux.org/pub/rocky/8/images/x86_64/Rocky-8-GenericCloud.latest.x86_64.qcow2" [rocky-9-arm64] #494M url = "https://download.rockylinux.org/pub/rocky/9/images/aarch64/Rocky-9-GenericCloud.latest.aarch64.qcow2" +[rocky-9-ppc64] #510M +url = "https://download.rockylinux.org/pub/rocky/9/images/ppc64le/Rocky-9-GenericCloud.latest.ppc64le.qcow2" + [alma-9] #468M url = "https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2" [alma-8] #679M @@ -129,6 +153,11 @@ url = "https://repo.almalinux.org/almalinux/8/cloud/x86_64/images/AlmaLinux-8-Ge url = "https://repo.almalinux.org/almalinux/9/cloud/aarch64/images/AlmaLinux-9-GenericCloud-latest.aarch64.qcow2" [alma-8-arm64] #568M url = "https://repo.almalinux.org/almalinux/8/cloud/aarch64/images/AlmaLinux-8-GenericCloud-latest.aarch64.qcow2" +[alma-9-ppc64] #477M +url = "https://repo.almalinux.org/almalinux/9/cloud/ppc64le/images/AlmaLinux-9-GenericCloud-latest.ppc64le.qcow2" +[alma-8-ppc64] #625M +url = "https://repo.almalinux.org/almalinux/8/cloud/ppc64le/images/AlmaLinux-8-GenericCloud-latest.ppc64le.qcow2" + ########################## # barge-os{kernel-4.14} https://gitee.com/g-system/fk-barge-os @@ -148,5 +177,8 @@ url= "https://gitee.com/g-system/fk-barge-packer/releases/download/v23.0514/cirr [cirros-v063-arm64] #24 MB # url= "https://github.com/cirros-dev/cirros/releases/download/0.6.3/cirros-0.6.3-aarch64-disk.img" url= "https://gitee.com/g-system/fk-barge-packer/releases/download/v23.0514/cirros-0.6.3-aarch64-disk.img" +[cirros-v063-ppc64] #24 MB +url= "https://gitee.com/g-system/fk-barge-packer/releases/download/v23.0514/cirros-0.6.3-ppc64le-disk.img" + # fogproject-fos{kernel-6.6 https://gitee.com/g-system/fk-fos \ No newline at end of file diff --git a/build/entry.sh b/build/entry.sh index a8786878c85a8a51bcb091fe29b4cc77745cf6f0..742faac4baab98cbb6d63519b5f5aaef3234c3cd 100644 --- a/build/entry.sh +++ b/build/entry.sh @@ -4,9 +4,16 @@ cd $cur function init() { # bin,etc,usr,dot - chmod +x bin/*.sh; \cp -a bin/* /bin/ - \cp -a etc/* /etc/ - \cp -a usr/* /usr/ + chmod +x bin/*; \cp -a bin/* /bin/ + \cp -a etc/libvirt0 /etc/ + if [ ! -s "/usr/bin/apt" ]; then + \cp -a usr/* /usr/ + else + # sed -i 's/#user = "root"/user = "root"/' /etc/libvirt/qemu.conf; + # sed -i 's/#group = "root"/group = "root"/' /etc/libvirt/qemu.conf; + echo 'user = "root"' > /etc/libvirt/qemu.conf; + echo 'group = "root"' >> /etc/libvirt/qemu.conf; + fi \cp -a dot/. /root/; chmod 600 /root/.ssh/id_rsa*; #virter.toml dst=/root/.local/share/virter; mkdir -p $dst; : > $dst/images.toml #clear org's img-list @@ -30,19 +37,19 @@ function init() { # rm -f conf; ln -s /root/.config/virter conf # rm -f share; ln -s /root/.local/share/virter share - # virbr https://blog.csdn.net/hffwj/article/details/122322682 - ifconfig virbr0 down - brctl delbr virbr0 - - # ohos-docker.kvm: # virter容器内: https://blog.csdn.net/hkking/article/details/120996413 mkdir -p /dev/net mknod /dev/net/tun c 10 200 chmod 600 /dev/net/tun + + # ubt + mkdir -p /run/lock #/var/lock> /run/lock } # virshInit 2>&1 |tee -a init.log init 2>&1 |tee -a init.log virter -v +cat supervisord.conf> /etc/supervisord.conf +mkdir -p /var/log $cur/../log; rm -rf /var/log/supervisor; ln -s $cur/../log /var/log/supervisor exec /usr/bin/supervisord -c /etc/supervisord.conf diff --git a/build/supervisord.conf b/build/supervisord.conf index f73b86e07811bdb40a9bae2f4ea07c0af638f2d7..282ba29c8521c1776d0471f0ebf2cb72a2b1beaa 100644 --- a/build/supervisord.conf +++ b/build/supervisord.conf @@ -31,11 +31,26 @@ command=/usr/sbin/virtlockd [program:virtlogd] command=/usr/sbin/virtlogd +# 新版拆分; 二选一 +# https://libvirt.org/daemons.html IN; Work is underway for the monolithic daemon to be replaced by a new set of modular daemons virt${DRIVER}d==libvirt: Libvirt Daemons +# [program:virtnetworkd] +# command=/usr/sbin/virtnetworkd + +# $ virsh net-start virter ##已在跑:addr占用; + # error: Failed to start network virter + # error: internal error: Child process (VIR_BRIDGE_NAME=virbr0 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/virter.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper) unexpected exit status 2: + # dnsmasq: failed to create listening socket for 10.255.0.1: Address already in use +# for net autostart +# [program:dnsmasq] +# # dnsmasq: warning: interface virbr0 does not currently exist +# environment=VIR_BRIDGE_NAME=virbr0 +# command=/bin/bash -c "exec /usr/sbin/dnsmasq --no-daemon --conf-file=/var/lib/libvirt/dnsmasq/virter.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper" + [program:dropbear] priority=40 user=root # environment=DISPLAY=:$N -command=/bin/bash -c "exec dropbear -E -F -R -p $SSHD_PORT" +command=/bin/bash -c "bash /srv/local/libvirt/build/virtinit.sh; exec dropbear -E -F -R -p $SSHD_PORT" autostart=true autorestart=true stdout_logfile=/var/log/supervisor/dropbear.log diff --git a/build/virtinit.sh b/build/virtinit.sh new file mode 100644 index 0000000000000000000000000000000000000000..dceb45e0df706b1f829b5d3e29c6fb1441a9b424 --- /dev/null +++ b/build/virtinit.sh @@ -0,0 +1,50 @@ +#!/bin/bash +cur=$(dirname $(readlink -f "$0")) +cd $cur + + # virbr https://blog.csdn.net/hffwj/article/details/122322682 + # # ifconfig virbr0 down + # ip link set dev virbr0 down + # brctl delbr virbr0 + +####baiduAI: "linux 删除桥接网卡" >> brctl|ip link|nmcli + # brctl show + # brctl delif virbr1 virbr1-nic + # brctl delbr virbr1 + # + ip link show type bridge + # 移除接口(例如,eth0)从桥接网络(例如,br0) + ip link set dev virbr0-nic down + ip link set dev virbr0-nic master none + # 删除桥接网络(例如,br0) + ip link set dev virbr0 down + ip link delete dev virbr0 + # # add: try hand start + # ip link add dev virbr0 type bridge + # ip addr add 10.255.0.1/24 dev virbr0 + # ip link set dev virbr0 up #still down + # + # nmcli con show --active | grep bridge + # # 断开设备连接(例如,eth0连接到br0) + # nmcli con mod connection.slave-type none + # nmcli con down + # # 删除桥接连接(例如,br0) + # nmcli con del + +# check +# cmd="virsh list --all > /dev/null 2>&1" +while true; do + echo -n "."; sleep 1 + virsh list --all > /dev/null 2>&1; errCode=$? + test "0" == "$errCode" && break; +done + +vm.sh init + +echo -e "\n==[net-start]"; virsh net-start virter +ls /etc/libvirt/qemu/autostart/ |while read one; do + one=${one%.xml} + echo "=[virsh start $one]"; virsh start $one +done + + diff --git a/docker-compose.yml b/docker-compose.yml index 756c1d10a040b256965ac7f4c236bd7687a9777c..0bd42473a1357f44fb3c8d4349999ef853237895 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,13 +12,20 @@ services: # # image: registry.cn-shenzhen.aliyuncs.com/infrastlabs/docker-libvirtd:latest # image: registry.cn-shenzhen.aliyuncs.com/infrastlabs/docker-libvirtd:v2501 - image: registry.cn-shenzhen.aliyuncs.com/infrastlabs/docker-libvirtd:v2501-alpine319 + # image: registry.cn-shenzhen.aliyuncs.com/infrastlabs/docker-libvirtd:v2501-alpine319 + image: registry.cn-shenzhen.aliyuncs.com/infrastlabs/docker-libvirtd:v2501-ubt2004 # command: /srv/local/k3s/entry.sh entrypoint: /bin/bash /srv/local/libvirt/build/entry.sh restart: unless-stopped privileged: true network_mode: host #host #bridge working_dir: /srv/local/libvirt + # https://gitlab.com/libvirt/libvirt/-/issues/163 + # --cgroupns=host + # https://github.com/docker/compose/issues/8167 + # pid: host + cgroup: host + # cgroup_parent: /abc_group #cgroup-parent for systemd cgroup should be a valid slice named as "xxx.slice" # healthcheck: # test: ["CMD", "bash", "-c", "supervisorctl status |grep -v 'RUNNING' && exit 1 || exit 0 "] # environment: @@ -34,8 +41,10 @@ services: - ./:/srv/local/libvirt # - /var/lib/libvirt:/var/lib/libvirt # - /run/libvirt:/var/run/libvirt ## pve-deb10: /var/run -> /run/ - - ./var-lib-libvirt:/var/lib/libvirt - - ./var-run-libvirt:/var/run/libvirt + - ./data/var-lib-libvirt:/var/lib/libvirt + - ./data/var-run-libvirt:/var/run/libvirt + # - ./data/etc-libvirt:/etc/libvirt #conf; + - ./data/etc-libvirt-qemu:/etc/libvirt/qemu - /_ext:/_ext # - ./supervisord.conf:/etc/supervisord.conf # - /sys/fs/cgroup:/sys/fs/cgroup @@ -45,7 +54,8 @@ services: virt-manager: # image: mber5/virt-manager:latest # image: registry.cn-shenzhen.aliyuncs.com/infrasync/mber5-virt-manager:latest #x64,arm64 - image: ${REPO}infrasync/v2025:mber5--virt-manager---latest + # image: ${REPO}infrasync/v2025:mber5--virt-manager---latest + image: registry.cn-shenzhen.aliyuncs.com/infrastlabs/virt-manager:latest restart: always ports: - 8185:80 @@ -65,7 +75,8 @@ services: # - "/var/lib/libvirt/images:/var/lib/libvirt/images" # - "./var-run-libvirt/libvirt-sock:/var/run/libvirt/libvirt-sock" # - "./var-lib-libvirt/images:/var/lib/libvirt/images" - - ./var-lib-libvirt:/var/lib/libvirt - - ./var-run-libvirt:/var/run/libvirt + - ./data/var-lib-libvirt:/var/lib/libvirt + - ./data/var-run-libvirt:/var/run/libvirt + # - ./data/etc-libvirt:/etc/libvirt #conf; # devices: # - "/dev/kvm:/dev/kvm" diff --git a/docs/vt-250111-network.md b/docs/vt-250111-network.md index 183e79c5d5c365e571bc58eb0cbc8f651a7fce66..ad4219963096019fb18a74a0c8848d0520f42ccd 100644 --- a/docs/vt-250111-network.md +++ b/docs/vt-250111-network.md @@ -1,10 +1,47 @@ +- vt-network + - ok: `nat bridge route` + - `vt network add virter -m nat` -n 10.255.0.1/24 + - `vt network add virter3 -m route` -n 10.255.3.1/24 + - `vt network add virter2 -m bridge` + - ok:`none`; ERR:`direct internal user` `local,host-only`; + - `vt network add virter7 -m none` + - virt-manager ``open` [UI: nat,routed,open,isolated,sr-iov] + - `vt network add virter9 -m open` -n 10.255.4.1/24 +- TODO项 + - br桥接网卡: 手动设定IP/旁路dhcp + - virter-nat网: 自动dhcp/手动指定IP`vt network host add --id=xx` + - vm内bond聚合: cirros>openEuler-v2203`nmcli操作` + +```bash +root @ deb11-11 in ~ |16:53:49 +$ vt network add -h + Add a new network. VMs can be attached to such a network in addition to the default network used by virter. DHCP entries can be added directly to the new network. + Usage: + virter network add [flags] + Flags: + -p, --dhcp #Configure DHCP. Use together with '--network-cidr'. DHCP range is configured starting from --network-cidr+1 until the broadcast address + --dhcp-count uint Number of host entries to add + --dhcp-id uint ID which determines the MAC and IP addresses to associate + --dhcp-mac string Base MAC address to which ID is added. The default can be used to populate a virter access network (default "52:54:00:00:00:00") + -d, --domain string Configure DNS names for the network + -m, --forward-mode string Set the forward mode, for example 'nat' + -h, --help help for add + -n, --network-cidr string Configure the network range (IPv4) in CIDR notation. The IP will be assigned to the host device. + -6, --network-v6-cidr string Configure the network range (IPv6) in CIDR notation. The IP will be assigned to the host device. + Global Flags: + --config string config file (default is /root/.config/virter/virter.toml) + --logformat string Log format, current options: short (default "default") + -l, --loglevel string Log level, default may be set with environment variable "VIRTER_LOG_LEVEL" (default "info") +``` + + ### 1)VT操作 - ok: `nat bridge route` ```bash # ok: nat bridge route -vt network add virter -n 10.255.0.1/24 -m nat #iptable内核模块 REJECT ERR +vt network add virter -m nat -n 10.255.0.1/24 #iptable内核模块 REJECT ERR vt network add virter2 -m bridge #-n 10.255.2.1/24 #active, 但virsh net-start失败(网络存在?); vt network add virter3 -m route -n 10.255.3.1/24 #OK1, iptable内核模块 REJECT ERR vt network add virter8 -m bridge #try02, bridge-n2n? @@ -99,7 +136,7 @@ $ vt network add virter7 -m none ### 2)virtMgr参考 -- virt-manager `#nat bridge route, none; #open, isolated, SR-IOV` +- virt-manager `#nat bridge route, none;` `#open, isolated, SR-IOV` ```bash @@ -162,3 +199,601 @@ $ vt vm run --id=101 debian-11-arm64 # 最终: 调整vt模型后>> 该机现有kernel未打开KVM特性; 不能跑libvirtd-qemu-kvm ``` +### 4)250821|bridge桥接网卡 + +- info + - vt建的bridge网 开启时不提示不可用(`vt network add virter2 -m bridge` vm-start-err: `virter2 is a direct mode, but has no forward dev and no interface pool`) + - virtMgr:只nat/routed/open,无bridge + +```bash +# libvirt+添加桥接网络 #https://metaso.cn/search/8646786746017411072?q=libvirt+%E6%B7%BB%E5%8A%A0%E6%A1%A5%E6%8E%A5%E7%BD%91%E7%BB%9C + +# 1. 准备工作 + # 安装bridge-utils和libvirt相关的软件包 + sudo apt install bridge-utils libvirt-daemon-system libvirt-clients virt-manager + + # 禁用NetworkManager(如果需要):某些情况下,NetworkManager可能会覆盖手动配置,因此需要禁用它 + sudo systemctl disable NetworkManager; sudo systemctl stop NetworkManager + sudo systemctl enable network; sudo systemctl start network + +# 2. 创建物理桥接接口 + # 创建桥接接口:假设物理接口为eth0,创建名为br0的桥接接口。 + sudo brctl addbr br0 + sudo brctl addif br0 eth0 + sudo ip link set br0 up + sudo ip link set eth0 up + + # 配置IP地址:将物理接口的IP地址转移到桥接接口上。 + sudo ip addr del 192.168.1.131/24 dev eth0 + sudo ip addr add 192.168.1.131/24 dev br0 + + # 持久化配置:编辑网络配置文件以确保重启后配置仍然有效 + # 对于Debian/Ubuntu系统,编辑/etc/network/interfaces + auto eth0 + iface eth0 inet manual + + auto br0 + iface br0 inet static + address 192.168.1.131 + netmask 255.255.255.0 + gateway 192.168.1.1 + bridge_ports eth0 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + + # CentOS/RHEL系统,编辑/etc/sysconfig/network-scripts/ifcfg-eth0和/etc/sysconfig/network-scripts/ifcfg-br0 + # ifcfg-eth0 + DEVICE=eth0 + NAME=eth0 + TYPE=Ethernet + BOOTPROTO=none + ONBOOT=yes + BRIDGE=br0 + + # ifcfg-br0 + DEVICE=br0 + NAME=br0 + TYPE=Bridge + BOOTPROTO=static + IPADDR=192.168.1.131 + NETMASK=255.255.255.0 + GATEWAY=192.168.1.1 + ONBOOT=yes + DELAY=0 + +# 3. 配置libvirt网络 + # 创建libvirt网络XML文件:创建一个XML文件来定义libvirt网络 + + br0 + + + # mac,ip不允许存在; virtualport.openvswitch:允许存在但vm机启动报错>改配需先top/rm之再新加; + + + + + + + + + + # 定义并启动libvirt网络: + sudo virsh net-define /path/to/your/network.xml + sudo virsh net-start br0 + sudo virsh net-autostart br0 + +# 4. 验证配置 + # 检查桥接状态: + brctl show + ip addr show br0 + + # 检查libvirt网络状态: + virsh net-list --all + virsh net-info br0 + +``` + + +- 250827|genM-deb11:参考上1条先手动加br0后,virsh配置xml指向br0 + +```bash +################################## +# 01:br0网卡可用于vm,但无dhcp + 244 2025-08-27 10:50:39 ip a |grep "inet " + # 手动加br0 + 246 2025-08-27 10:53:29 brctl addbr br0 + 247 2025-08-27 10:53:41 apt install bridge-utils + # 已装/需sudo brctl xx + 249 2025-08-27 10:53:54 sudo brctl addbr br0 + 251 2025-08-27 10:54:23 sudo brctl addif br0 enx000ec6a566e5 + 252 2025-08-27 10:54:32 sudo ip link set br0 up + 253 2025-08-27 10:54:42 sudo ip link set enx000ec6a566e5 up + 254 2025-08-27 10:55:02 ip a |grep "state UP" + 255 2025-08-27 10:55:54 sudo ip addr add 172.29.40.238/24 dev br0 + # virsh加网 + 256 2025-08-27 10:57:05 cd /_ext/; mkdir t2_virt_br0; cd t2_virt_br0/ + 259 2025-08-27 10:57:38 touch br0.xml + 260 2025-08-27 10:57:40 vi br0.xml + 261 2025-08-27 10:59:16 cp br0.xml br0.xml-bk0 + 262 2025-08-27 10:59:30 vi br0.xml #改配:mac,ip不允许存在; virtualport.openvswitch:允许存在但vm机启动报错>改配需先top/rm之再新加; + # root @ deb11-11 in /_ext/t2_virt_br0 |13:12:13 + $ cat br0.xml + + br0 + + + + 263 2025-08-27 10:59:41 sudo virsh net-define br0.xml + 264 2025-08-27 10:59:49 sudo virsh net-start br0 + 265 2025-08-27 10:59:54 sudo virsh net-autostart br0 + # 调改再加网后: + # 1.vm可启 + # 2.cirros双卡都未取得IP:[virter网:使用的新卡mac不一样了] + # 3.virtMgr可看到网卡mac, 卡2手动设定IP后:内外可互ping通 + +########### +# 隔天,拔usb卡后 重使用: + # enx000ec6a566e5 #网卡明未变 + sudo ip link set enx000ec6a566e5 up + sudo brctl addif br0 enx000ec6a566e5 + # 手动up后灯亮+addif后vm方可ping通 + +################################## +# 02:尝试旁路dhcp tftpd32@本子40.241 +# 1.原未开tftpd:br0-vm-cirros获取的ipv6地址; +# 2.开tftpd:一样情况; +# 3.pool全占满: 30>5; 拔交换机进线/拔本子usb网卡;> 清理已配纪录:右键删/conf文件删还会加回来; > 再插本子usb网卡/cirros-vm重启:有crirros的记录了>>但其获取的依旧为ipv6..; +# 4.cirros下无nmcli,改用openeuler-v22: virter加挂两张新卡; + +# ff + vm.sh init + id=102; vt network host add --id=$id; vt vm run --id=$id cirros-v063 + +# https://gitee.com/g-golang/fk-virter +# Usage: virter vm run: + Adding additional disk(s): --disk "name=disk1,size=20GiB,format=qcow2,bus=virtio" + Adding a bridged interface --nic "type=bridge,source=br0,mac=1a:2b:3c:4d:5e:01" + Adding a NAT\ed interface: --nic "type=network,source=default,mac=1a:2b:3c:4d:5e:02" + +# 默认virter, +另两张网卡; +# virter vm run openeuler-v22 --nic "type=bridge,source=br0,mac=1a:2b:3c:4d:5e:01" --nic "type=network,source=default,mac=1a:2b:3c:4d:5e:02" +# --id=103 +$ virter vm run openeuler-v22 --id=103 --nic "type=bridge,source=br0,mac=1a:2b:3c:4d:5e:01" --nic "type=network,source=default,mac=1a:2b:3c:4d:5e:02" +FATA[0000] Failed to start VM 103: DHCP host entry for ID '103' not found (static DHCP mode) +vt network host add --id=103 #再retry:ok + +# auth +# https://docs.openeuler.org/zh/docs/24.03_LTS_SP1/docs/Releasenotes/帐号清单.html +root openEuler12#$ ##24.03; 22.03可用 +# 登录后:3张卡,两张已设IP,br0卡无IP(tftpd有新的分配记录); 有nmcli命令; + + +################################## +# 03:获取到IPV6,无IPV4 + +# tryC1:系统禁用IPV6(ctVirter内操作) +cat >> /etc/sysctl.conf<> /etc/sysctl.conf<> +# 3.oe-104删另两网络+改mac后做启动: 获取到的ip还是v6版; (tftpd太旧不兼容??) +# +# 4.停止tftpd+改mac后启: 还是ipv6; (网络中有多个dhcp服务器 分配逻辑会怎么样: 客户端通常会选择最先收到响应的DHCP服务器进行IP分配。其他服务器会释放为客户端保留的IP地址) +# https://metaso.cn/search/8648951728296378368?q=%E7%BD%91%E7%BB%9C%E4%B8%AD%E6%9C%89%E5%A4%9A%E4%B8%AAdhcp%E6%9C%8D%E5%8A%A1%E5%99%A8+%E5%88%86%E9%85%8D%E9%80%BB%E8%BE%91%E4%BC%9A%E6%80%8E%E4%B9%88%E6%A0%B7 +# +# 5.拔桥接usb网卡的网线; br0及usb网卡都在且为up; >> oe-104:改mac后启:取得ipv6; +``` + +- 250827|home.ap34-virter + +```bash + # 手动加br0 + brctl addbr br0; apt install bridge-utils + # 已装/需sudo brctl xx; env.PATH + iface=enp1s0 + sudo brctl addbr br0 + sudo brctl addif br0 $iface + sudo ip link set br0 up + sudo ip link set $iface up + + ip a |grep "state UP" + sudo ip addr add 172.17.0.123/24 dev br0 + sudo ip addr del 172.17.0.123/24 dev $iface + # virsh加网 + # cd /_ext/; mkdir t2_virt_br0; cd t2_virt_br0/ + cat > br0.xml< + br0 + + + +EOF + sudo virsh net-define br0.xml + sudo virsh net-start br0; sudo virsh net-autostart br0 + +########### +# 隔天,重使用: + iface=enp1s0 + sudo ip link set $iface up + sudo brctl addif br0 $iface + + +# vm-multiCard +vt network host add --id=100 +virter vm run cirros-v063 --id=100 --nic "type=bridge,source=br0,mac=1a:2b:3c:4d:51:01" --nic "type=network,source=default,mac=1a:2b:3c:4d:51:02" +# 启动后,vm经br0可获得dhcp分配的ip: 172.17.0.124 + + +vt network host add --id=101 +virter vm run barge214x --id=101 --nic "type=bridge,source=br0,mac=1a:2b:3c:4d:52:01" --nic "type=network,source=default,mac=1a:2b:3c:4d:52:02" +``` + +### 5)250827|oe-v22,bond双网卡做主备 + +> ref WXWork/xx/Cache/File/2025-08/CentOS7多网卡绑定.pdf + +- vm103-oe2203-bond + +```bash +# ens4>>br0 +[root@localhost network-scripts]# cat ifcfg-ens4 +TYPE=Ethernet +DEFROUTE=yes +DEVICE=ens4 +ONBOOT=yes +# +IPADDR=172.29.40.233 +NETMASK=255.255.255.0 +#GATEWAY= +DNS1=114.114.114.114 + + +# bond +net=10.255.0 +nmcli connection add type bond ifname bond0 mode 1 ip4 $net.199/24 gw4 $net.1 +nmcli connection add type bond-slave ifname ens3 master bond0 +nmcli connection add type bond-slave ifname ens5 master bond0 + +# cleanIP +# sudo ip addr add 192.168.1.131/24 dev br0 +sudo ip addr del 10.255.0.103/24 dev ens3 +sudo ip addr del 192.168.122.47/24 dev ens5 + +# 未能就绪:找不到profile? +nmcli connection reload +nmcli connection +# +ifup bond0 +cat /proc/net/bonding/bond0 +``` + +- reboot后验证 + +```bash +# reboot后: +[root@localhost network-scripts]# ls + ifcfg-bond-bond0 ifcfg-bond-slave-ens3 ifcfg-bond-slave-ens5 + ifcfg-ens3 ifcfg-ens4 ifcfg-ens5 +# 两个slave配置项; +[root@localhost network-scripts]# cat ifcfg-bond-slave-ens3 + TYPE=Ethernet + NAME=bond-slave-ens3 + UUID=ba207a79-c850-42e7-bddb-f76e583c4cdf + DEVICE=ens3 + ONBOOT=yes + MASTER=bond0 + SLAVE=yes + [root@localhost network-scripts]# cat ifcfg-bond-slave-ens5 + TYPE=Ethernet + NAME=bond-slave-ens5 + UUID=4647af46-8e7e-4c89-9149-5352ec6e64f7 + DEVICE=ens5 + ONBOOT=yes + MASTER=bond0 + SLAVE=yes + +# 之前手动配置的 不要它了;(有之干扰,导致slave-ens3未生效) +[root@localhost network-scripts]# cat ifcfg-ens3 + TYPE=Ethernet + PROXY_METHOD=none + BROWSER_ONLY=no + BOOTPROTO=none + DEFROUTE=no + IPV4_FAILURE_FATAL=no + IPV6INIT=no + IPV6_AUTOCONF=no + IPV6_DEFROUTE=no + IPV6_FAILURE_FATAL=no + IPV6_ADDR_GEN_MODE=stable-privacy + NAME=ens3 + #UUID=06630a45-7c95-42ec-9dd4-ab0d569312ac + DEVICE=ens3 + ONBOOT=yes + +[root@localhost network-scripts]# nmcli connection + NAME UUID TYPE DEVICE + bond-bond0 16fb0819-2b73-45f2-b220-d4ecb04727e2 bond bond0 + System ens4 e27f182b-d125-2c43-5a30-43524d0229ac ethernet ens4 + bond-slave-ens5 4647af46-8e7e-4c89-9149-5352ec6e64f7 ethernet ens5 + ens3 21d47e65-8523-1a06-af22-6f121086f085 ethernet ens3 + bond-slave-ens3 ba207a79-c850-42e7-bddb-f76e583c4cdf ethernet -- + ens5 8126c120-a964-e959-ff98-ac4973344505 ethernet -- + + +# 删两个ifcfg-ens3/5后 +[root@localhost network-scripts]# nmcli connection reload + [root@localhost network-scripts]# nmcli connection + NAME UUID TYPE DEVICE + bond-bond0 16fb0819-2b73-45f2-b220-d4ecb04727e2 bond bond0 + System ens4 e27f182b-d125-2c43-5a30-43524d0229ac ethernet ens4 + bond-slave-ens3 ba207a79-c850-42e7-bddb-f76e583c4cdf ethernet ens3 + bond-slave-ens5 4647af46-8e7e-4c89-9149-5352ec6e64f7 ethernet ens5 + +[root@localhost network-scripts]# cat /proc/net/bonding/bond0 + Ethernet Channel Bonding Driver: v5.10.0-216.0.0.115.oe2203sp4.x86_64 + + Bonding Mode: fault-tolerance (active-backup) + Primary Slave: None + Currently Active Slave: ens5 + MII Status: up + MII Polling Interval (ms): 100 + Up Delay (ms): 0 + Down Delay (ms): 0 + Peer Notification Delay (ms): 0 + + Slave Interface: ens5 + MII Status: up + Speed: Unknown + Duplex: Unknown + Link Failure Count: 0 + Permanent HW addr: 1a:2b:3c:4d:5e:02 + Slave queue ID: 0 + + Slave Interface: ens3 + MII Status: up + Speed: Unknown + Duplex: Unknown + Link Failure Count: 0 + Permanent HW addr: 52:54:00:00:00:67 + Slave queue ID: 0 +[root@localhost network-scripts]# ip route + default via 10.255.0.1 dev bond0 proto static metric 300 + 10.255.0.0/24 dev bond0 proto kernel scope link src 10.255.0.199 metric 300 + 172.29.40.0/24 dev ens4 proto kernel scope link src 172.29.40.233 metric 100 +``` + +- 固定MAC + +```bash +# mac: 1a:2b:3c:4d:5e:02 +[root@localhost network-scripts]# ip a + 2: ens3: mtu 1500 qdisc fq_codel master bond0 state UP group default qlen 1000 + link/ether 1a:2b:3c:4d:5e:02 brd ff:ff:ff:ff:ff:ff permaddr 52:54:00:00:00:67 + 3: ens4: mtu 1500 qdisc fq_codel state UP group default qlen 1000 + link/ether 1a:2b:3c:4d:5e:01 brd ff:ff:ff:ff:ff:ff + inet 172.29.40.233/24 brd 172.29.40.255 scope global noprefixroute ens4 + valid_lft forever preferred_lft forever + 4: ens5: mtu 1500 qdisc fq_codel master bond0 state UP group default qlen 1000 + link/ether 1a:2b:3c:4d:5e:02 brd ff:ff:ff:ff:ff:ff + 5: bond0: mtu 1500 qdisc noqueue state UP group default qlen 1000 + link/ether 1a:2b:3c:4d:5e:02 brd ff:ff:ff:ff:ff:ff + inet 10.255.0.199/24 brd 10.255.0.255 scope global noprefixroute bond0 + valid_lft forever preferred_lft forever + inet6 fe80::a51a:cce8:8500:26c6/64 scope link noprefixroute + valid_lft forever preferred_lft forever +[root@localhost network-scripts]# ls +ifcfg-bond-bond0 ifcfg-bond-slave-ens3 ifcfg-bond-slave-ens5 ifcfg-ens4 +[root@localhost network-scripts]# cat ifcfg-bond-bond0 + BONDING_OPTS=mode=active-backup + BONDING_MASTER=yes + TYPE=Bond + NAME=bond-bond0 + UUID=16fb0819-2b73-45f2-b220-d4ecb04727e2 + DEVICE=bond0 + ONBOOT=yes + PROXY_METHOD=none + BROWSER_ONLY=no + BOOTPROTO=none + IPADDR=10.255.0.199 + PREFIX=24 + GATEWAY=10.255.0.1 + DEFROUTE=yes + IPV4_FAILURE_FATAL=no + IPV6INIT=yes + IPV6_AUTOCONF=yes + IPV6_DEFROUTE=yes + IPV6_FAILURE_FATAL=no + IPV6_ADDR_GEN_MODE=stable-privacy +[root@localhost network-scripts]# cat ifcfg-bond-slave-ens3 + TYPE=Ethernet + NAME=bond-slave-ens3 + UUID=ba207a79-c850-42e7-bddb-f76e583c4cdf + DEVICE=ens3 + ONBOOT=yes + MASTER=bond0 + SLAVE=yes + + +[root@localhost network-scripts]# ls +ifcfg-bond-bond0 ifcfg-bond-slave-ens3 ifcfg-bond-slave-ens5 ifcfg-ens4 +[root@localhost network-scripts]# vi ifcfg-bond-bond0 +[root@localhost network-scripts]# echo MACADDR=1a:2b:3c:4d:5e:02 >> ifcfg-bond-slave-ens3 +[root@localhost network-scripts]# echo MACADDR=1a:2b:3c:4d:5e:02 >> ifcfg-bond-slave-ens5 +[root@localhost network-scripts]# pwd + /etc/sysconfig/network-scripts +# [root@localhost network-scripts]# ls |while read one; do echo $one; cat $one |grep MACADDR; done + ifcfg-bond-bond0 + MACADDR=1a:2b:3c:4d:5e:02 + ifcfg-bond-slave-ens3 + MACADDR=1a:2b:3c:4d:5e:02 + ifcfg-bond-slave-ens5 + MACADDR=1a:2b:3c:4d:5e:02 + ifcfg-ens4 + +``` + +- 配置检测时长`BONDING_OPTS="mode=1 miimon=100"` + +```bash +[root@localhost network-scripts]# cat ifcfg-bond-bond0 + BONDING_OPTS=mode=active-backup + BONDING_MASTER=yes + +[root@localhost network-scripts]# cat ifcfg-bond-bond0 + BONDING_OPTS="mode=1 miimon=100" + BONDING_MASTER=yes + +# connection reload +[root@localhost network-scripts]# nmcli connection reload +[root@localhost network-scripts]# nmcli connection +NAME UUID TYPE DEVICE +bond-bond0 16fb0819-2b73-45f2-b220-d4ecb04727e2 bond bond0 +System ens4 e27f182b-d125-2c43-5a30-43524d0229ac ethernet ens4 +bond-slave-ens3 ba207a79-c850-42e7-bddb-f76e583c4cdf ethernet ens3 +bond-slave-ens5 4647af46-8e7e-4c89-9149-5352ec6e64f7 ethernet ens5 +``` + +- nmcli改配ip, 测试换主 + +```bash +# nmcli改IP + # net=10.255.0 + net=192.168.122 + nmcli connection modify "bond-bond0" ipv4.addresses "$net.199/24" \ + ipv4.gateway "$net.1" ipv4.dns "8.8.8.8 114.114.114.114" ipv4.method manual + nmcli connection up "bond-bond0" + +# 测试换主 + 111 cat /proc/net/bonding/bond0 + 112 ifdown ens5 #无此配置 + + # 如下在机器内停止网卡可换主 + #bond-slave-ens3 + 114 ifdown bond-slave-ens3 + 115 cat /proc/net/bonding/bond0 + 116 ifup bond-slave-ens3 + 117 cat /proc/net/bonding/bond0 + # bond-slave-ens5 + 118 ifup bond-slave-ens5 + 119 cat /proc/net/bonding/bond0 + 120 ifdown bond-slave-ens5 + 121 cat /proc/net/bonding/bond0 + 122 ifup bond-slave-ens5 + 123 cat /proc/net/bonding/bond0 + + # 停vm网络 + # 1.把ens3在vm层停用,可切到ens5; + # 2.停止vm网络,不会触发换主操作; + # ff.mac: (对应上virtMgr的网卡MAC) + [root@localhost ~]# ip a + 3: ens4: mtu 1500 qdisc fq_codel state UP group default qlen 1000 + link/ether 1a:2b:3c:4d:5e:01 brd ff:ff:ff:ff:ff:ff + inet 172.29.40.233/24 brd 172.29.40.255 scope global noprefixroute ens4 + valid_lft forever preferred_lft forever + 2: ens3: mtu 1500 qdisc fq_codel state UP group default qlen 1000 + link/ether 52:54:00:00:00:67 brd ff:ff:ff:ff:ff:ff + 4: ens5: mtu 1500 qdisc fq_codel master bond0 state UP group default qlen 1000 + link/ether 1a:2b:3c:4d:5e:02 brd ff:ff:ff:ff:ff:ff + 5: bond0: mtu 1500 qdisc noqueue state UP group default qlen 1000 + link/ether 1a:2b:3c:4d:5e:02 brd ff:ff:ff:ff:ff:ff + inet 10.255.0.199/24 brd 10.255.0.255 scope global noprefixroute bond0 + valid_lft forever preferred_lft forever + +``` + +- 0828次日周四|genM-deb11-virter环境二验 + +```bash +##br0######### +# 隔天,拔usb卡后 重使用: + # enx000ec6a566e5 #网卡明未变 + sudo ip link set enx000ec6a566e5 up + sudo brctl addif br0 enx000ec6a566e5 + # 手动up后灯亮+addif后vm方可ping通 + + +##bond######### +1.添加arp_interval/iptarget ##arp_interval=200 arp_ip_target=192.168.122.1 + [root@localhost ~]# cd /etc/sysconfig/network-scripts/ + [root@localhost network-scripts]# cat ifcfg-bond-bond0 + BONDING_OPTS="mode=active-backup miimon=100 arp_interval=200 arp_ip_target=192.168.122.1" + TYPE=Bond + BONDING_MASTER=yes + +2.换ens3,5到同一default网 +3.ping -i 0.3的验证 + 1.vm-active的操作:可互切换/恢复 + 2.default网络的停止:停后不能再互通了; 需vm停止后再启动方可(直接reset还不行) + + + +# 下午16:00 +##iperf3加压######### +root @ deb11-11 in ~ |16:00:37 +$ iperf3 -s -i 1 +[root@localhost network-scripts]# iperf3 -c 192.168.122.1 -i 1 -t 3600 -P 2 #-b 100G +- - - - - - - - - - - - - - - - - - - - - - - - - +[ 5] 101.00-102.00 sec 980 MBytes 8.22 Gbits/sec 0 1.86 MBytes +[ 7] 101.00-102.00 sec 981 MBytes 8.23 Gbits/sec 0 1.88 MBytes +[SUM] 101.00-102.00 sec 1.92 GBytes 16.5 Gbits/sec 0 +^C- - - - - - - - - - - - - - - - - - - - - - - - - +[ 5] 102.00-102.78 sec 786 MBytes 8.50 Gbits/sec 0 1.93 MBytes +[ 7] 102.00-102.78 sec 790 MBytes 8.55 Gbits/sec 0 1.88 MBytes +[SUM] 102.00-102.78 sec 1.54 GBytes 17.1 Gbits/sec 0 +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Retr +[ 5] 0.00-102.78 sec 94.0 GBytes 7.86 Gbits/sec 4009 sender +[ 5] 0.00-102.78 sec 0.00 Bytes 0.00 bits/sec receiver +[ 7] 0.00-102.78 sec 93.1 GBytes 7.78 Gbits/sec 4190 sender +[ 7] 0.00-102.78 sec 0.00 Bytes 0.00 bits/sec receiver +[SUM] 0.00-102.78 sec 187 GBytes 15.6 Gbits/sec 8199 sender +[SUM] 0.00-102.78 sec 0.00 Bytes 0.00 bits/sec receiver +iperf3: interrupt - the client has terminated + + +##monitRec.bondChange######### +[root@localhost ~]# touch vals.txt; while true; do sleep 0.3; rq=$(date +%s.%N); val1=$(cat /proc/net/bonding/bond0 |grep Slave |grep Active |cut -d':' -f2 |awk '{print $1}'); val2=$(cat vals.txt |tail -1 |cut -d'|' -f1); test "$val1" != "$val2" && echo "$val1|$rq" >> vals.txt; done +^C +[root@localhost ~]# cat vals.txt +ens5|Thu Aug 28 07:26:53 AM UTC 2025 +ens3|1756366599.489801936 +ens5|1756366606.430280150 +ens3|1756366617.471193238 +ens5|1756366622.819769747 +ens3|1756366626.604647041 +ens5|1756367164.113782157 +ens3|1756367167.742887639 +ens5|1756367172.320771249 +ens3|1756367175.929728713 +ens5|1756367179.842796373 +ens3|1756367183.478345236 +ens5|1756367187.732110094 + + +# ping -D 记录时间搓 +ping -i 0.3 192.168.122.1 -D +``` + + + + diff --git a/docs/vt-250124-registry.md b/docs/vt-250124-registry.md index 168116519a4dbb69aa0b866d891dc0b1fdaa426a..d7ec8919ba589108756217e4b52ce1020c750222 100644 --- a/docs/vt-250124-registry.md +++ b/docs/vt-250124-registry.md @@ -5,16 +5,16 @@ ```bash root @ armbian in .../local/libvirt |11:53:52 |sam-custom U:2 ?:9 ?. $ vt image ls -Name Top Layer Created -alpine sha256:584760a4809c9d27ead880a549733db5adeb8da445a702d19099e5eaa2b605a9 19 hours ago -barge214x sha256:355685a6bee55e945239b282a0c75786ba8a7d3f8a67b50496e1912fa17aae60 46 hours ago -deb-12-arm64 sha256:0a4972c17b60d56504069ffd2846fa135210b51850e5cb020089b2cf1b231126 19 hours ago +Name Top Layer Created +alpine sha256:584760a4809c9d27ead880a549733db5adeb8da445a702d19099e5eaa2b605a9 19 hours ago +barge214x sha256:355685a6bee55e945239b282a0c75786ba8a7d3f8a67b50496e1912fa17aae60 46 hours ago +deb-12-arm64 sha256:0a4972c17b60d56504069ffd2846fa135210b51850e5cb020089b2cf1b231126 19 hours ago debian-10-arm64 sha256:9c76240d75ae9fe1ed855c3f930c0a3ef50d8b9181881032f53107dce6efbcf5 24 hours ago ubuntu-focal-arm64 sha256:23bb59a11a87596c701ad2acf128eee80541461616dc0f361597a5b63b01cac1 25 hours ago root @ armbian in .../local/libvirt |11:54:52 |sam-custom U:2 ?:9 ?. $ vt image push alpine harbor.pcitech.com/base/virt-alpine:latest -FATA[0000] not allowed to push error="creating push check transport for harbor.pcitech.com failed: Get \"https://harbor.pcitech.com/v2/\": dial tcp: lookup harbor.pcitech.com on 114.114.114.114:53: no such host" +FATA[0000] not allowed to push error="creating push check transport for harbor.pcitech.com failed: Get \"https://harbor.pcitech.com/v2/\": dial tcp: lookup harbor.pcitech.com on 114.114.114.114:53: no such host" # 初始ca, .docker/config.json @@ -27,7 +27,7 @@ main: line 117: docker: command not found root @ armbian in .../local/libvirt |11:56:48 |sam-custom U:2 ?:9 ?. $ vt image push alpine harbor.pcitech.com/base/virt-alpine:latest -FATA[0000] not allowed to push error="creating push check transport for harbor.pcitech.com failed: Get \"https://harbor.pcitech.com/v2/\": tls: failed to verify certificate: x509: certificate signed by unknown authority" ##/etc/docker/certs.d/harbor.pcitech.com/ca.crt无效; TODO /etc/trusted-ca.. +FATA[0000] not allowed to push error="creating push check transport for harbor.pcitech.com failed: Get \"https://harbor.pcitech.com/v2/\": tls: failed to verify certificate: x509: certificate signed by unknown authority" ##/etc/docker/certs.d/harbor.pcitech.com/ca.crt无效; TODO /etc/trusted-ca.. ``` @@ -43,13 +43,13 @@ root @ deb1013 in ~ |09:22:39 -----BEGIN CERTIFICATE----- MIIDpDCCAoygAwIBAgIUAfr7FX5mAHhc2ztvlgtJc+HegGQwDQYJKoZIhvcNAQEL -----END CERTIFICATE----- - $ mkdir -p /etc/ssl/certs; cat /etc/docker/certs.d/harbor.pcitech.com/ca.crt > /etc/ssl/certs/harbor115-ca.pem + # $ mkdir -p /etc/ssl/certs; cat /etc/docker/certs.d/harbor.pcitech.com/ca.crt > /etc/ssl/certs/harbor115-ca.pem root @ deb1013 in ~ |09:27:08 $ vt image push debian-10 harbor.pcitech.com/infrastlabs/vm-images:debian-10 - FATA[0000] not allowed to push error="POST https://harbor.pcitech.com/v2/infrastlabs/vm-images/blobs/uploads/: UNAUTHORIZED: project infrastlabs not found: project infrastlabs not found" #ns不存在 + FATA[0000] not allowed to push error="POST https://harbor.pcitech.com/v2/infrastlabs/vm-images/blobs/uploads/: UNAUTHORIZED: project infrastlabs not found: project infrastlabs not found" #ns不存在 root @ armbian in ~ |13:50:39 $ vt image push alpine-v320-arm64 harbor.pcitech.com/base/vm-images:alpine-v320-arm64 - FATA[0000] not allowed to push error="POST https://harbor.pcitech.com/v2/base/vm-images/blobs/uploads/: UNAUTHORIZED: unauthorized to access repository: base/vm-images, action: push: unauthorized to access repository: base/vm-images, action: push" #未auth + FATA[0000] not allowed to push error="POST https://harbor.pcitech.com/v2/base/vm-images/blobs/uploads/: UNAUTHORIZED: unauthorized to access repository: base/vm-images, action: push: unauthorized to access repository: base/vm-images, action: push" #未auth # auth mkdir -p ~/.docker; dockconf=~/.docker/config.json @@ -78,8 +78,8 @@ MOD_UNDOCK_AUTH="$(echo admin:suntek |tr -d '\n' |base64)" root @ deb1013 in ~ |09:18:47 $ vt image push debian-10 registry.cn-shenzhen.aliyuncs.com/infrastlabs/vm-images:debian-10 sha256:913c245aac3642cfb compress done [====] 282.41MiB / 282.41MiB -sha256:913c245aac3642cfb push [======>------------------] 90.00MiB / 280.51MiB -FATA[0072] failed to push image error="PUT https://registry.cn-shenzhen.aliyuncs.com/v2/infrastlabs/vm-images/manifests/debian-10: DENIED: unknown manifest class for application/vnd.com.linbit.virter.image.v1" +sha256:913c245aac3642cfb push [======>------------------] 90.00MiB / 280.51MiB +FATA[0072] failed to push image error="PUT https://registry.cn-shenzhen.aliyuncs.com/v2/infrastlabs/vm-images/manifests/debian-10: DENIED: unknown manifest class for application/vnd.com.linbit.virter.image.v1" ``` - harbor115-certs,pushOK @@ -139,17 +139,17 @@ $ vt image ls |awk '{print $1}' |grep -v "^Name$" |while read one; do echo $one; root @ host-172-25-21-18 in ~ |10:12:33 $ echo "alma-8,alpine-v320,barge214c,barge214d,barge214x,cirros-v063,debian-10,debian-11,openeuler-v24,rocky-8,rocky-9,ubuntu-v20" |tr ',' '\n' |while read one; do echo $one; vt image pull $one harbor.pcitech.com/base/vm-images:$one; done alma-8 - sha256:669bd580dcef5491d pull done [========================] 671.38MiB / 671.38MiB + sha256:669bd580dcef5491d pull done [========================] 671.38MiB / 671.38MiB virter:layer:sha256:669b buffer layer done [========================] 678.56MiB / 678.56MiB virter:layer:sha256:669b upload layer done [========================] 678.56MiB / 678.56MiB Pulled alma-8 alpine-v320 - sha256:0947c391f5bf4f305 pull done [========================] 108.14MiB / 108.14MiB + sha256:0947c391f5bf4f305 pull done [========================] 108.14MiB / 108.14MiB virter:layer:sha256:0947 buffer layer done [========================] 178.12MiB / 178.12MiB virter:layer:sha256:0947 upload layer done [========================] 178.12MiB / 178.12MiB Pulled alpine-v320 barge214c - sha256:fd01527eae851f763 pull done [==========================] 13.23MiB / 13.23MiB + sha256:fd01527eae851f763 pull done [==========================] 13.23MiB / 13.23MiB virter:layer:sha256:fd01 buffer layer done [==========================] 15.12MiB / 15.12MiB virter:layer:sha256:fd01 upload layer done [==========================] 15.12MiB / 15.12MiB Pulled barge214c @@ -165,7 +165,7 @@ $ echo "alma-8,alpine-v320,barge214c,barge214d,barge214x,cirros-v063,debian-10,d root @ armbian in ~ |13:50:39 $ vt image push alpine-v320-arm64 harbor.pcitech.com/base/vm-images:alpine-v320-arm64 - FATA[0000] not allowed to push error="POST https://harbor.pcitech.com/v2/base/vm-images/blobs/uploads/: UNAUTHORIZED: unauthorized to access repository: base/vm-images, action: push: unauthorized to access repository: base/vm-images, action: push" + FATA[0000] not allowed to push error="POST https://harbor.pcitech.com/v2/base/vm-images/blobs/uploads/: UNAUTHORIZED: unauthorized to access repository: base/vm-images, action: push: unauthorized to access repository: base/vm-images, action: push" $ vt image push alpine-v320-arm64 harbor.pcitech.com/base/vm-images:alpine-v320-arm64 sha256:584760a4809c9d27e compress done [============] 212.38MiB / 212.38MiB sha256:584760a4809c9d27e push done [============] 109.01MiB / 109.01MiB @@ -212,17 +212,17 @@ root @ armbian in ~ |13:52:30 root @ host-172-25-21-18 in ~ |10:12:33 $ echo "alma-9-arm64,alpine-v320-arm64,cirros-v063-arm64,debian-11-arm64,openeuler-v24-arm64,rocky-9-arm64,ubuntu-v20-arm64" |tr ',' '\n' |while read one; do echo $one; vt image pull $one harbor.pcitech.com/base/vm-images:$one; done alma-9-arm64 - sha256:5ede4affaad0a997a pull done [===] 380.26MiB / 380.26MiB + sha256:5ede4affaad0a997a pull done [===] 380.26MiB / 380.26MiB virter:layer:sha256:5ede buffer layer done [===] 383.00MiB / 383.00MiB virter:layer:sha256:5ede upload layer done [===] 383.00MiB / 383.00MiB Pulled alma-9-arm64 alpine-v320-arm64 - sha256:584760a4809c9d27e pull done [===] 109.01MiB / 109.01MiB + sha256:584760a4809c9d27e pull done [===] 109.01MiB / 109.01MiB virter:layer:sha256:5847 buffer layer done [===] 212.38MiB / 212.38MiB virter:layer:sha256:5847 upload layer done [===] 212.38MiB / 212.38MiB Pulled alpine-v320-arm64 cirros-v063-arm64 - sha256:611879b8299363fe6 pull done [=====] 23.51MiB / 23.51MiB + sha256:611879b8299363fe6 pull done [=====] 23.51MiB / 23.51MiB virter:layer:sha256:6118 buffer layer done [=====] 24.00MiB / 24.00MiB virter:layer:sha256:6118 upload layer done [=====] 24.00MiB / 24.00MiB Pulled cirros-v063-arm64 @@ -230,20 +230,220 @@ root @ armbian in ~ |13:52:30 sha256:f84198324eb8ebc7a pull done [===========] 248.66MiB / 248.66MiB Pulled debian-11-arm64 openeuler-v24-arm64 - sha256:e151e6e173e4af1b2 pull done [===] 740.76MiB / 740.76MiB + sha256:e151e6e173e4af1b2 pull done [===] 740.76MiB / 740.76MiB virter:layer:sha256:e151 buffer layer done [=======] 1.53GiB / 1.53GiB virter:layer:sha256:e151 upload layer done [=======] 1.53GiB / 1.53GiB Pulled openeuler-v24-arm64 rocky-9-arm64 - sha256:5443bcc0507fadc3d pull done [==================] 491.06MiB / 491.06MiB + sha256:5443bcc0507fadc3d pull done [==================] 491.06MiB / 491.06MiB virter:layer:sha256:5443 buffer layer done [==================] 493.94MiB / 493.94MiB virter:layer:sha256:5443 upload layer done [==================] 493.94MiB / 493.94MiB Pulled rocky-9-arm64 ubuntu-v20-arm64 - sha256:23bb59a11a87596c7 pull done [==================] 578.05MiB / 578.05MiB + sha256:23bb59a11a87596c7 pull done [==================] 578.05MiB / 578.05MiB virter:layer:sha256:23bb buffer layer done [==================] 579.92MiB / 579.92MiB virter:layer:sha256:23bb upload layer done [==================] 579.92MiB / 579.92MiB Pulled ubuntu-v20-arm64 ``` +### 3)hkccr.Push +- hkccr@25.8.19 OK + +```bash +root @ deb11-11 in ~ |17:12:14 +$ cp -a /_ext/.docker/ /root/ + '/_ext/.docker/' -> '/root/.docker' + '/_ext/.docker/config.json' -> '/root/.docker/config.json' +root @ deb11-11 in ~ |17:13:09 +$ vt image push cirros-v063 hkccr.ccs.tencentyun.com/infrastlabs/vm-images:cirros-v063 + sha256:7d6355852aeb6dbcd compress done [==========] 20.69MiB / 20.69MiB + sha256:7d6355852aeb6dbcd push done [==========] 20.21MiB / 20.21MiB + Pushed hkccr.ccs.tencentyun.com/infrastlabs/vm-images:cirros-v063 +``` + +- allPull +ppc64 + +```bash +# tryAll.http +17 2025-08-19 17:20:29 vt image ls --available +18 2025-08-19 17:20:37 vt image ls --available |awk '{print $1}' |while read one; do vt image pull $one; done +# harborFirst +19 2025-08-19 17:22:53 cp /_ext/docker /bin/ +20 2025-08-19 17:22:55 docker +21 2025-08-19 17:23:00 curl -fSL -o- http://172.25.23.205:82/sam/docs-devops/raw/branch/dev/settings/harbor/regcert.sh |bash -s +22 2025-08-19 17:23:06 cat .docker/config.json +# +root @ deb11-11 in ~ |17:23:34 +$ mkdir -p /etc/ssl/certs; cat /etc/docker/certs.d/harbor.pcitech.com/ca.crt > /etc/ssl/certs/harbor115-ca.pem +echo "alma-8,alpine-v320,barge214c,barge214d,barge214x,cirros-v063,debian-10,debian-11,openeuler-v24,rocky-8,rocky-9,ubuntu-v20" |tr ',' '\n' |while read one; do echo $one; vt image pull $one harbor.pcitech.com/base/vm-images:$one; done +echo "alma-9-arm64,alpine-v320-arm64,cirros-v063-arm64,debian-11-arm64,openeuler-v24-arm64,rocky-9-arm64,ubuntu-v20-arm64" |tr ',' '\n' |while read one; do echo $one; vt image pull $one harbor.pcitech.com/base/vm-images:$one; done + + +# ubt-mirror +root @ deb11-11 in ~/.config/virter |10:09:32 +$ vt image ls --available |grep ubuntu |awk '{print $2}' |sort #while read one; do vt image pull $one; done +https://mirrors.huaweicloud.com/ubuntu-cloud-images/bionic/current/bionic-server-cloudimg-amd64.img +https://mirrors.huaweicloud.com/ubuntu-cloud-images/focal/current/focal-server-cloudimg-amd64-disk-kvm.img +https://mirrors.huaweicloud.com/ubuntu-cloud-images/focal/current/focal-server-cloudimg-arm64.img +https://mirrors.huaweicloud.com/ubuntu-cloud-images/focal/current/focal-server-cloudimg-ppc64el.img +https://mirrors.huaweicloud.com/ubuntu-cloud-images/jammy/current/jammy-server-cloudimg-amd64-disk-kvm.img +https://mirrors.huaweicloud.com/ubuntu-cloud-images/noble/current/noble-server-cloudimg-amd64.img +https://mirrors.huaweicloud.com/ubuntu-cloud-images/noble/current/noble-server-cloudimg-arm64.img +https://mirrors.huaweicloud.com/ubuntu-cloud-images/noble/current/noble-server-cloudimg-ppc64el.img +https://mirrors.huaweicloud.com/ubuntu-cloud-images/xenial/current/xenial-server-cloudimg-amd64-uefi1.img +https://mirrors.huaweicloud.com/ubuntu-cloud-images/xenial/current/xenial-server-cloudimg-arm64-uefi1.img +https://mirrors.huaweicloud.com/ubuntu-cloud-images/xenial/current/xenial-server-cloudimg-ppc64el-disk1.img +``` + +- allPush + +```bash +# $one hkccr.ccs.tencentyun.com/infrastlabs/vm-images:$one; +root @ deb11-11 in ~ |17:32:04 +$ vt image ls |grep arm64 |awk '{print $1}' |while read one; do vt image push $one hkccr.ccs.tencentyun.com/infrastlabs/vm-images:$one; done + +$ vt image ls |grep ppc64 |awk '{print $1}' |while read one; do vt image push $one hkccr.ccs.tencentyun.com/infrastlabs/vm-images:$one; done + + +$ vt image ls |egrep -v "^Name|arm64|ppc64" |awk '{print $1}' |while read one; do vt image push $one hkccr.ccs.tencentyun.com/infrastlabs/vm-images:$one; done + +``` + +- full --available + +```bash +# root @ deb11-11 in ~ |17:38:26 +$ vt image ls --available |grep ppc64 |wc + 9 18 1413 +$ vt image ls --available |grep arm64 |wc + 18 36 2826 +$ vt image ls --available |egrep -v "^Name|arm64|ppc64" |wc + 27 54 4239 + +root @ deb11-11 in ~ |17:39:51 +# $ vt image ls --available |grep ppc64 + alma-8-ppc64 https://repo.almalinux.org/almalinux/8/cloud/ppc64le/images/AlmaLinux-8-GenericCloud-latest.ppc64le.qcow2 + alma-9-ppc64 https://repo.almalinux.org/almalinux/9/cloud/ppc64le/images/AlmaLinux-9-GenericCloud-latest.ppc64le.qcow2 + centos-8-ppc64 https://cloud.centos.org/centos/8/ppc64le/images/CentOS-8-GenericCloud-8.4.2105-20210603.0.ppc64le.qcow2 + cirros-v063-ppc64 https://gitee.com/g-system/fk-barge-packer/releases/download/v23.0514/cirros-0.6.3-ppc64le-disk.img + debian-12-ppc64 https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-ppc64el.qcow2 + rocky-9-ppc64 https://download.rockylinux.org/pub/rocky/9/images/ppc64le/Rocky-9-GenericCloud.latest.ppc64le.qcow2 + ubuntu-v16-ppc64 https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-ppc64el-disk1.img + ubuntu-v20-ppc64 https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-ppc64el.img + ubuntu-v24-ppc64 https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-ppc64el.img + +# $ vt image ls --available |grep arm64 + alma-8-arm64 https://repo.almalinux.org/almalinux/8/cloud/aarch64/images/AlmaLinux-8-GenericCloud-latest.aarch64.qcow2 + alma-9-arm64 https://repo.almalinux.org/almalinux/9/cloud/aarch64/images/AlmaLinux-9-GenericCloud-latest.aarch64.qcow2 + alpine-v320-arm64 https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/cloud/nocloud_alpine-3.20.0-aarch64-uefi-cloudinit-r0.qcow2 + armbian-v22-arm64 http://172.29.40.253:81/2501/qcow/2025-01-10-12-24-48-sdk-Armbian_24.11.2_Uefi-arm64_jammy_current_6.6.69-sdk.img.qcow2 + centos-8-arm64 https://cloud.centos.org/centos/8/aarch64/images/CentOS-8-GenericCloud-8.4.2105-20210603.0.aarch64.qcow2 + cirros-v063-arm64 https://gitee.com/g-system/fk-barge-packer/releases/download/v23.0514/cirros-0.6.3-aarch64-disk.img + debian-10-arm64 https://cloud.debian.org/images/cloud/buster/latest/debian-10-generic-arm64.qcow2 + debian-11-arm64 https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-arm64.qcow2 + debian-12-arm64 https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-arm64.qcow2 + openeuler-v22-arm64 http://172.29.40.253:81/2501/qcow/openEuler-22.03-LTS-SP4-aarch64.qcow2 + openeuler-v24-arm64 http://172.29.40.253:81/2501/qcow/openEuler-24.03-LTS-SP1-aarch64.qcow2 + opensuse-micro-v61-arm64 https://download.opensuse.org/distribution/leap-micro/6.1/appliances/openSUSE-Leap-Micro.aarch64-Default-qcow.qcow2 + ophub-armbian-deb11-arm64 http://172.29.40.253:81/2501/qcow/2025-01-10-14-35-48-amlogic-s9xxx-armbian-Armbian_25.02.0-trunk_5.02.0-deb11-bullseye.img + ophub-armbian-ubt24-arm64 http://172.29.40.253:81/2501/qcow/2025-01-10-12-36-06-amlogic-s9xxx-armbian-Armbian_25.02.0-trunk_5.02.0-ubt24-noble.img + rocky-9-arm64 https://download.rockylinux.org/pub/rocky/9/images/aarch64/Rocky-9-GenericCloud.latest.aarch64.qcow2 + ubuntu-v16-arm64 https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-uefi1.img + ubuntu-v20-arm64 https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-arm64.img + ubuntu-v24-arm64 https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-arm64.img + +# $ vt image ls --available |egrep -v "^Name|arm64|ppc64" + alma-8 https://repo.almalinux.org/almalinux/8/cloud/x86_64/images/AlmaLinux-8-GenericCloud-latest.x86_64.qcow2 + alma-9 https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2 + alpine-v320 https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/cloud/nocloud_alpine-3.20.3-x86_64-bios-cloudinit-r0.qcow2 + amazonlinux-2 https://cdn.amazonlinux.com/os-images/2.0.20241217.0/kvm/amzn2-kvm-2.0.20241217.0-x86_64.xfs.gpt.qcow2 + amazonlinux-2023 https://cdn.amazonlinux.com/al2023/os-images/2023.6.20241212.0/kvm/al2023-kvm-2023.6.20241212.0-kernel-6.1-x86_64.xfs.gpt.qcow2 + armbian-v22 http://172.29.40.253:81/2501/qcow/2025-01-10-12-25-20-sdk-Armbian_24.11.2_Uefi-x86_jammy_current_6.6.69-sdk.img.qcow2 + barge214c https://gitee.com/g-system/fk-barge-packer/releases/download/v23.0510/barge.qcow2 + barge214d https://gitee.com/g-system/fk-barge-packer/releases/download/v23.0514/barge.qcow2 + barge214x https://gitee.com/g-system/fk-barge-packer/releases/download/v23.0514/barge-x-v214-17.12.1-ce.qcow2 + centos-6 https://cloud.centos.org/centos/6/images/CentOS-6-x86_64-GenericCloud.qcow2 + centos-7 https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 + centos-8 https://cloud.centos.org/centos/8/x86_64/images/CentOS-8-GenericCloud-8.4.2105-20210603.0.x86_64.qcow2 + cirros-v063 https://gitee.com/g-system/fk-barge-packer/releases/download/v23.0514/cirros-0.6.3-x86_64-disk.img + debian-10 https://cloud.debian.org/images/cloud/buster/latest/debian-10-genericcloud-amd64.qcow2 + debian-11 https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.qcow2 + debian-12 https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2 + debian-9 https://cdimage.debian.org/cdimage/openstack/current-9/debian-9-openstack-amd64.qcow2 + openeuler-v22 http://172.29.40.253:81/2501/qcow/openEuler-22.03-LTS-SP4-x86_64.qcow2 + openeuler-v24 http://172.29.40.253:81/2501/qcow/openEuler-24.03-LTS-SP1-x86_64.qcow2 + opensuse-micro-v61 https://download.opensuse.org/distribution/leap-micro/6.1/appliances/openSUSE-Leap-Micro.x86_64-Default-qcow.qcow2 + rocky-8 https://download.rockylinux.org/pub/rocky/8/images/x86_64/Rocky-8-GenericCloud.latest.x86_64.qcow2 + rocky-9 https://download.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2 + ubuntu-v16 https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-uefi1.img + ubuntu-v18 https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img + ubuntu-v20 https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64-disk-kvm.img + ubuntu-v22 https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64-disk-kvm.img + ubuntu-v24 https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img +``` + +- hkccr-exist1 + +```bash +root @ deb11-11 in ~ |17:40:20 +$ cat hkccr-exist1|sed 's/^[ \t]*//;s/[ \t]*$//' |egrep -v "Docker-I|2025|sha25|MB|GB|KB|^#|^$" |sort +alma-8 +alma-8-ppc64 +alma-9 +alma-9-arm64 +alma-9-ppc64 +alpine-v320 +alpine-v320-arm64 +amazonlinux-2 +amazonlinux-2023 +armbian-v22 +barge214c +barge214d +barge214x +centos-6 +centos-7 +centos-8 +centos-8-ppc64 +cirros-v063 +cirros-v063-arm64 +cirros-v063-ppc64 +debian-10 +debian-11 +debian-11-arm64 +debian-12 +debian-12-ppc64 +debian-9 +openeuler-v24 +openeuler-v24-arm64 +opensuse-micro-v61 +rocky-8 +rocky-9 +rocky-9-arm64 +rocky-9-ppc64 +ubuntu-v16 +ubuntu-v16-ppc64 +ubuntu-v20 +ubuntu-v20-arm64 +ubuntu-v20-ppc64 +ubuntu-v22 +ubuntu-v24-arm64 +ubuntu-v24-ppc64 + +root @ deb11-11 in ~ |17:43:14 +$ vt image ls |awk '{print $1}' |while read one; do match1=$(cat hkccr-exist1-2 |grep "$one"); test -z "$match1" && echo $one; done +Name +alma-8-arm64 +armbian-v22-arm64 +centos-8-arm64 +debian-10-arm64 +debian-12-arm64 +openeuler-v22-arm64 +opensuse-micro-v61-arm64 +ophub-armbian-deb11-arm64 +ophub-armbian-ubt24-arm64 + +root @ deb11-11 in ~ |18:05:19 +$ vt image ls --available|awk '{print $1}' |while read one; do match1=$(vt image ls |awk '{print $1}' |egrep "$one$"); test -z "$match1" && echo $one; done +openeuler-v22 +``` diff --git a/libvirt.md b/libvirt.md new file mode 100644 index 0000000000000000000000000000000000000000..7948d11c0c3ef90ca950c78ae868e0d8e6ca4e2b --- /dev/null +++ b/libvirt.md @@ -0,0 +1,527 @@ + +## net.autostart + +```bash +# virtnetworkd: +# ubt中无,apt-file查找也无; +# alpine中有, 启之再启libvirtd会报错:Initialization of bridge state driver failed: Failed to acquire pid file '/var/run/libvirt/network/driver.pid': Resource temporarily unavailable +# +# root @ deb11-11 in .../apps/fk-docker-libvirtd |22:11:58 |sam-custom U:2 ?:9 _| +$ apt-file search virtnetworkd +$ history |tail -6 + 475 2025-08-16 21:48:08 git pull; dcp up -d + 476 2025-08-16 22:10:30 apt-get install apt-file + 477 2025-08-16 22:10:53 apt-file update + 478 2025-08-16 22:11:58 apt-file search abc + 479 2025-08-16 22:12:09 apt-file search virtnetworkd + 480 2025-08-16 22:12:30 history |tail -6 + +# sysd ubt2004 +# /usr/lib/libvirt/libvirt-guests.sh start +root @ ce4b289210ad in /etc/systemd |08:43:46 +$ find |grep virt |while read one; do echo "==$one"; cat $one |grep Exec; done +==./system/multi-user.target.wants/libvirtd.service +ExecStart=/usr/sbin/libvirtd $libvirtd_opts +ExecReload=/bin/kill -HUP $MAINPID +==./system/multi-user.target.wants/libvirt-guests.service +ExecStart=/usr/lib/libvirt/libvirt-guests.sh start +ExecStop=/usr/lib/libvirt/libvirt-guests.sh stop +==./system/sockets.target.wants/virtlockd-admin.socket +==./system/sockets.target.wants/virtlogd-admin.socket +==./system/sockets.target.wants/libvirtd.socket +==./system/sockets.target.wants/virtlockd.socket +==./system/sockets.target.wants/virtlogd.socket +==./system/sockets.target.wants/libvirtd-ro.socket +==./system/sockets.target.wants/libvirtd-admin.socket + +$ cat ./system/multi-user.target.wants/libvirtd.service |egrep -v "^#|^$" + [Unit] + Description=Virtualization daemon + Requires=virtlogd.socket + Requires=virtlockd.socket + Wants=libvirtd.socket + Wants=libvirtd-ro.socket + Wants=libvirtd-admin.socket + Wants=systemd-machined.service + After=network.target + After=local-fs.target + After=remote-fs.target + After=dbus.service + After=iscsid.service + After=apparmor.service + After=systemd-logind.service + After=systemd-machined.service + After=xencommons.service + Before=libvirt-guests.service + Conflicts=xendomains.service + Documentation=man:libvirtd(8) + Documentation=https://libvirt.org + [Service] + Type=notify + EnvironmentFile=-/etc/default/libvirtd + ExecStart=/usr/sbin/libvirtd $libvirtd_opts ### + ExecReload=/bin/kill -HUP $MAINPID + KillMode=process + Restart=on-failure + LimitNOFILE=8192 + TasksMax=32768 + LimitMEMLOCK=64M + [Install] + WantedBy=multi-user.target + Also=virtlockd.socket + Also=virtlogd.socket + Also=libvirtd.socket + Also=libvirtd-ro.socket + +# root @ ce4b289210ad in /etc/systemd |08:47:15 +$ cat /etc/default/libvirtd + # Defaults for libvirtd initscript (/etc/init.d/libvirtd) + # This is a POSIX shell fragment + + # Start libvirtd to handle qemu/kvm: + start_libvirtd="yes" ### + + # options passed to libvirtd, see man libvirtd for details. + # For example to enable listening on tcp add -l here + # and set up the TLS Certificates that libvirtd will need. + #libvirtd_opts="" + + # pass in location of kerberos keytab + #export KRB5_KTNAME=/etc/libvirt/libvirt.keytab + + # Whether to mount a systemd like cgroup layout (only + # useful when not running systemd) + #mount_cgroups=yes + # Which cgroups to mount + #cgroups="memory devices" + +# conf +root @ ce4b289210ad in /etc/libvirt |08:50:32 +$ find |sort |grep conf |while read one; do echo "==$one"; cat $one |grep Exec; done +==./libvirt-admin.conf +==./libvirt.conf +==./libvirtd.conf +==./qemu-lockd.conf +==./qemu-sanlock.conf +==./qemu.conf +==./virt-login-shell.conf +==./virtlockd.conf +==./virtlogd.conf +==./libxl-lockd.conf +==./libxl-sanlock.conf +==./libxl.conf +==./lxc.conf +``` + + + +## conf + +- ct-virter|/etc/libvirt/ + +```bash +# ct-virter +# root @ deb11-11 in ~ |14:11:12 +$ tree /etc/libvirt/ +/etc/libvirt/ +|-- hooks +|-- libvirt-admin.conf +|-- libvirt.conf +|-- libvirtd.conf +|-- libxl-lockd.conf +|-- libxl-sanlock.conf +|-- libxl.conf +|-- lxc.conf +|-- nwfilter +| |-- allow-arp.xml +| |-- allow-dhcp-server.xml +| |-- allow-dhcp.xml +| |-- allow-ipv4.xml +.. +| `-- qemu-announce-self.xml +|-- qemu +| |-- cirros-v063-109.xml +| `-- networks ## +| |-- autostart +| | `-- virter.xml -> /etc/libvirt/qemu/networks/virter.xml +| |-- default.xml +| `-- virter.xml +|-- qemu-lockd.conf +|-- qemu-sanlock.conf +|-- qemu.conf +|-- secrets +|-- storage +| |-- autostart +| | `-- default.xml -> /etc/libvirt/storage/default.xml +| `-- default.xml +|-- virtlockd.conf +`-- virtlogd.conf +9 directories, 42 files + +# img +root @ 4c85c86abf20 in / |14:21:41 +$ find /etc/libvirt/ -type f |sort + /etc/libvirt/libvirt-admin.conf + /etc/libvirt/libvirt.conf + /etc/libvirt/libvirtd.conf + /etc/libvirt/libxl-lockd.conf + /etc/libvirt/libxl-sanlock.conf + /etc/libvirt/libxl.conf + /etc/libvirt/lxc.conf + /etc/libvirt/virt-login-shell.conf + /etc/libvirt/virtlockd.conf + /etc/libvirt/virtlogd.conf + /etc/libvirt/qemu-lockd.conf + /etc/libvirt/qemu-sanlock.conf + /etc/libvirt/qemu.conf + /etc/libvirt/qemu/networks/default.xml + /etc/libvirt/nwfilter/allow-arp.xml + /etc/libvirt/nwfilter/allow-dhcp-server.xml + .. + /etc/libvirt/nwfilter/qemu-announce-self.xml + # $ find /etc/libvirt/ -type f |sort |grep ".conf$" |while read one; do echo ==$one; cat $one |egrep -v "^#|^$"; done + ==/etc/libvirt/libvirt-admin.conf + ==/etc/libvirt/libvirt.conf + ==/etc/libvirt/libvirtd.conf + unix_sock_group = "libvirt" + unix_sock_ro_perms = "0777" + unix_sock_rw_perms = "0770" + auth_unix_ro = "none" + auth_unix_rw = "none" + ==/etc/libvirt/libxl-lockd.conf + ==/etc/libvirt/libxl-sanlock.conf + ==/etc/libvirt/libxl.conf + ==/etc/libvirt/lxc.conf + ==/etc/libvirt/qemu-lockd.conf + ==/etc/libvirt/qemu-sanlock.conf + ==/etc/libvirt/qemu.conf + user = "root" + group = "root" + ==/etc/libvirt/virt-login-shell.conf + ==/etc/libvirt/virtlockd.conf + ==/etc/libvirt/virtlogd.conf + +# src +# Administrator@WIN-2208071245 MINGW64 /d/Development/Projects/_ee/fk-docker-libvirtd (sam-custom) +$ find build/etc/libvirt -type f |sort + build/etc/libvirt/libvirt.conf + build/etc/libvirt/libvirtd.conf + build/etc/libvirt/network.conf + build/etc/libvirt/qemu.conf + build/etc/libvirt/virtlockd.conf + build/etc/libvirt/virtlogd.conf + # $ find build/etc/libvirt -type f |sort |while read one; do echo ==$one; cat $one |egrep -v "^#|^$"; done + ==build/etc/libvirt/libvirt.conf + ==build/etc/libvirt/libvirtd.conf + ==build/etc/libvirt/network.conf + firewall_backend = "iptables" + ==build/etc/libvirt/qemu.conf + ==build/etc/libvirt/virtlockd.conf + ==build/etc/libvirt/virtlogd.conf +``` + +- libvirtd src's + +```bash +$ cat libvirtd.conf |grep = +#listen_tls = 0 +#listen_tcp = 1 +# activation with systemd version >= 227 +#tls_port = "16514" +# activation with systemd version >= 227 +#tcp_port = "16509" +#listen_addr = "192.168.0.1" +#unix_sock_group = "libvirt" +#unix_sock_ro_perms = "0777" +#unix_sock_rw_perms = "0770" +#unix_sock_admin_perms = "0700" +# activation with systemd version >= 227 +#unix_sock_dir = "/var/run/libvirt" +#auth_unix_ro = "polkit" +# the systemd .socket files will use SocketMode=0600 by default +# the systemd .socket files will use SocketMode=0666 which +#auth_unix_rw = "polkit" +#auth_tcp = "sasl" +#auth_tls = "none" +#access_drivers = [ "polkit" ] +#key_file = "/etc/pki/libvirt/private/serverkey.pem" +#cert_file = "/etc/pki/libvirt/servercert.pem" +#ca_file = "/etc/pki/CA/cacert.pem" +#crl_file = "/etc/pki/CA/crl.pem" +#tls_no_sanity_certificate = 1 +#tls_no_verify_certificate = 1 +# "C=GB,ST=London,L=London,O=Red Hat,CN=*" +#tls_allowed_dn_list = ["DN1", "DN2"] +#tls_priority="NORMAL" +#sasl_allowed_username_list = ["joe@EXAMPLE.COM", "fred@EXAMPLE.COM" ] +#max_clients = 5000 +#max_queued_clients = 1000 +#max_anonymous_clients = 20 +#min_workers = 5 +#max_workers = 20 +#prio_workers = 5 +#max_client_requests = 5 +#admin_min_workers = 1 +#admin_max_workers = 5 +#admin_max_clients = 5 +#admin_max_queued_clients = 5 +#admin_max_client_requests = 5 +#log_level = 3 +#log_filters="1:qemu 1:libvirt 4:object 4:json 4:event 1:util" +#log_outputs="3:syslog:libvirtd" +# audit_level == 0 -> disable all auditing +# audit_level == 1 -> enable auditing, only if enabled on host (default) +# audit_level == 2 -> enable auditing, and exit if disabled on host +#audit_level = 2 +#audit_logging = 1 +#host_uuid = "00000000-0000-0000-0000-000000000000" +#host_uuid_source = "smbios" +#keepalive_interval = 5 +#keepalive_count = 5 +#keepalive_required = 1 +#admin_keepalive_required = 1 +#admin_keepalive_interval = 5 +#admin_keepalive_count = 5 +#ovs_timeout = 5 +``` + +- qemu + +```bash +$ cat qemu.conf |grep = +#default_tls_x509_cert_dir = "/etc/pki/qemu" +#default_tls_x509_verify = 1 +#default_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000" +#vnc_listen = "0.0.0.0" +# type=address but without any address specified. This setting takes +#vnc_auto_unix_socket = 1 +#vnc_tls = 1 +# If the path is not provided, but vnc_tls = 1, then the +#vnc_tls_x509_cert_dir = "/etc/pki/libvirt-vnc" +#vnc_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000" +#vnc_tls_x509_verify = 1 +#vnc_password = "XYZ12345" +#vnc_sasl = 1 +#vnc_sasl_dir = "/some/directory/sasl2" +#vnc_allow_host_audio = 0 +#spice_listen = "0.0.0.0" +#spice_tls = 1 +# If the path is not provided, but spice_tls = 1, then the +#spice_tls_x509_cert_dir = "/etc/pki/libvirt-spice" +# type=address but without any address specified. This setting takes +#spice_auto_unix_socket = 1 +#spice_password = "XYZ12345" +#spice_sasl = 1 +#spice_sasl_dir = "/some/directory/sasl2" +#chardev_tls = 1 +# If the path is not provided, but chardev_tls = 1, then the +#chardev_tls_x509_cert_dir = "/etc/pki/libvirt-chardev" +#chardev_tls_x509_verify = 1 +#chardev_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000" +#vxhs_tls = 1 +# If the path is not provided, but vxhs_tls = 1, then the +#vxhs_tls_x509_cert_dir = "/etc/pki/libvirt-vxhs" +#vxhs_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000" +#nbd_tls = 1 +# If the path is not provided, but nbd_tls = 1, then the +#nbd_tls_x509_cert_dir = "/etc/pki/libvirt-nbd" +#nbd_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000" +#migrate_tls_x509_cert_dir = "/etc/pki/libvirt-migrate" +#migrate_tls_x509_verify = 1 +#migrate_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000" +#migrate_tls_force = 0 +#backup_tls_x509_cert_dir = "/etc/pki/libvirt-backup" +#backup_tls_x509_verify = 1 +#backup_tls_x509_secret_uuid = "00000000-0000-0000-0000-000000000000" +#nographics_allow_host_audio = 1 +#remote_display_port_min = 5900 +#remote_display_port_max = 65535 +#remote_websocket_port_min = 5700 +#remote_websocket_port_max = 65535 +# security_driver = [ "selinux", "apparmor" ] +#security_driver = "selinux" +#security_default_confined = 1 +#security_require_confined = 1 +# user = "qemu" # A user named "qemu" +# user = "+0" # Super user (uid=0) +# user = "100" # A user named "100" or a user with uid=100 +#user = "root" +#group = "root" +#dynamic_ownership = 1 +#remember_owner = 1 +#cgroup_controllers = [ "cpu", "devices", "memory", "blkio", "cpuset", "cpuacct" ] +#cgroup_device_acl = [ +#save_image_format = "raw" +#dump_image_format = "raw" +#snapshot_image_format = "raw" +#auto_dump_path = "/var/lib/libvirt/qemu/dump" +#auto_dump_bypass_cache = 0 +#auto_start_bypass_cache = 0 +# hugetlbfs_mount = ["/dev/hugepages2M", "/dev/hugepages1G"] +#hugetlbfs_mount = "/dev/hugepages" +# is used to create interfaces when libvirtd is +#bridge_helper = "/usr/libexec/qemu-bridge-helper" +#set_process_name = 1 +#max_processes = 0 +#max_files = 0 +#max_threads_per_process = 0 +# ...guest ram... +#max_core = "unlimited" +#dump_guest_core = 1 +#mac_filter = 1 +#relaxed_acs_check = 1 +#lock_manager = "lockd" +#max_queued = 0 +#keepalive_interval = 5 +#keepalive_count = 5 +# 1 == seccomp enabled, 0 == seccomp disabled +# only if QEMU >= 2.11.0 is detected, otherwise it is +#seccomp_sandbox = 1 +#migration_address = "0.0.0.0" +#migration_host = "host.example.com" +#migration_port_min = 49152 +#migration_port_max = 49215 +#log_timestamp = 0 +#nvram = [ +#stdio_handler = "logd" +#gluster_debug_level = 9 +#virtiofsd_debug = 1 +#namespaces = [ "mount" ] +#memory_backing_dir = "/var/lib/libvirt/qemu/ram" +#pr_helper = "/usr/bin/qemu-pr-helper" +#slirp_helper = "/usr/bin/slirp-helper" +#dbus_daemon = "/usr/bin/dbus-daemon" +#swtpm_user = "tss" +#swtpm_group = "tss" +#capability_filters = [ "capname" ] + +``` + +- virtlock/log + +```bash +Administrator@WIN-2208071245 MINGW64 /d/Development/Projects/_ee/fk-docker-libvirtd/build/etc/libvirt (sam-custom) +$ cat virtlockd.conf |grep = +#log_level = 3 +#log_filters="1:locking 4:object 4:json 4:event 1:util" +#log_outputs="3:syslog:virtlockd" +#max_clients = 1024 +#admin_max_clients = 5 +$ cat virtlogd.conf |grep = +#log_level = 3 +#log_filters="1:logging 4:object 4:json 4:event 1:util" +#log_outputs="3:syslog:virtlogd" +#max_clients = 1024 +#admin_max_clients = 5 +#max_size = 2097152 +#max_backups = 3 + +``` + +- network.conf/libvirt.conf + +```bash +# network.conf +# ref https://wiki.archlinux.org/title/Libvirt +# default: #firewall_backend = "nftables" +firewall_backend = "iptables" + +# libvirt.conf +#uri_aliases = [ +# "hail=qemu+ssh://root@hail.cloud.example.com/system", +# "sleet=qemu+ssh://root@sleet.cloud.example.com/system", +#] +#uri_default = "qemu:///system" +``` + + +- mnt|var-lib-libvirt,var-run-libvirt + +```bash +# out-ct +# root @ deb11-11 in .../apps/fk-docker-libvirtd |13:49:24 |sam-custom U:2 ?:7 _| +$ tree -h var-lib-libvirt/ +var-lib-libvirt/ +|-- [4.0K] dnsmasq +| |-- [ 0] default.addnhosts +| |-- [ 619] default.conf +| |-- [ 0] default.hostsfile +| |-- [ 0] virbr0.status +| |-- [ 91] virbr1.macs +| |-- [ 157] virbr1.status +| |-- [ 0] virter.addnhosts +| |-- [ 570] virter.conf +| `-- [ 279] virter.hostsfile +|-- [4.0K] images +| |-- [ 21M] virter:layer:sha256:7d6355852aeb6dbcd191bcda7cd74f1536cfe5cbf8a10495a7283a8396e4b75b +| |-- [192K] virter:tag:cirros-v063 +| |-- [192K] virter:work:cirros-v063-101 +| |-- [ 44K] virter:work:cirros-v063-101-cidata +.. +| |-- [530M] virter:work:cirros-v063-109 +| `-- [ 44K] virter:work:cirros-v063-109-cidata +`-- [4.0K] qemu + |-- [4.0K] channel + | `-- [4.0K] target + |-- [4.0K] checkpoint + |-- [4.0K] domain-1-cirros-v063-109 + | |-- [ 32] master-key.aes + | `-- [ 0] monitor.sock + |-- [4.0K] dump + |-- [4.0K] nvram + |-- [4.0K] ram + | `-- [4.0K] libvirt + | `-- [4.0K] qemu + |-- [4.0K] save + `-- [4.0K] snapshot +14 directories, 31 files + +# root @ deb11-11 in .../apps/fk-docker-libvirtd |13:49:39 |sam-custom U:2 ?:7 _| +$ tree -h var-run-libvirt/ +var-run-libvirt/ +|-- [4.0K] common +| `-- [ 32] system.token +|-- [4.0K] hostdevmgr +|-- [4.0K] interface +| `-- [ 2] driver.pid +|-- [ 0] libvirt-admin-sock +|-- [ 0] libvirt-sock +|-- [ 0] libvirt-sock-ro +|-- [4.0K] network +| |-- [ 0] autostarted +| |-- [ 4] default.pid +| |-- [ 758] default.xml +| |-- [ 2] driver.pid +| |-- [ 0] nwfilter.leases +| |-- [4.0K] virter +| | `-- [4.0K] ports +| | `-- [ 532] 02c7d862-a1d5-499e-97fc-a28723d64639.xml +| |-- [ 4] virter.pid +| `-- [1.2K] virter.xml +|-- [4.0K] nodedev +| `-- [ 2] driver.pid +|-- [4.0K] nwfilter +| `-- [ 2] driver.pid +|-- [4.0K] nwfilter-binding +|-- [4.0K] qemu +| |-- [ 0] autostarted +| |-- [4.0K] channel +| | `-- [4.0K] 1-cirros-v063-109 +| |-- [ 3] cirros-v063-109.pid +| |-- [ 14K] cirros-v063-109.xml +| |-- [4.0K] dbus +| |-- [ 2] driver.pid +| |-- [4.0K] passt +| `-- [4.0K] slirp +|-- [4.0K] secrets +| `-- [ 2] driver.pid +|-- [4.0K] storage +| |-- [ 0] autostarted +| |-- [ 587] default.xml +| `-- [ 2] driver.pid +|-- [ 0] virtlockd-admin-sock +|-- [ 0] virtlockd-sock +|-- [ 0] virtlogd-admin-sock +`-- [ 0] virtlogd-sock +17 directories, 27 files +``` diff --git a/sam-custom.md b/sam-custom.md index 83e3a115918187202f18a0c6a2788089baaba58d..10d842239247ca85ea40cf59e6ac9e7976c30f72 100644 --- a/sam-custom.md +++ b/sam-custom.md @@ -11,6 +11,43 @@ root @ armbian in .../local/libvirt |09:35:02 |sam-custom ?:9 ✗| $ virsh capabilities #q35> pc; @arch.go + +# 2508 + vm.sh init + id=102; vt network host add --id=$id; vt vm run --id=$id cirros-v063 + # ubt20: ok + # ubt22: cgroupErr + root @ deb11-11 in ~ |02:04:56 + $ id=107; vt network host add --id=$id; vt vm run --id=$id cirros-v063 + FATA[0001] Failed to start VM 107: could not create (start) domain: unable to open '/sys/fs/cgroup/machine/qemu-2-cirros-v063-107.libvirt-qemu/': No such file or directory + # ubt24: cgroupErr + root @ deb11-11 in ~ |09:54:34 + $ id=105; vt network host add --id=$id; vt vm run --id=$id cirros-v063 + FATA[0001] Failed to start VM 105: could not create (start) domain: unable to open '/sys/fs/cgroup/machine/qemu-5-cirros-v063-105.libvirt-qemu/': No such file or directory + # ubt22/2404>> fix: @dcp + # https://gitlab.com/libvirt/libvirt/-/issues/163 + # https://github.com/docker/compose/issues/8167 + # --cgroupns=host + cgroup: host + # + root @ deb11-11 in ~ |12:01:42 + $ id=109; vt network host add --id=$id; vt vm run --id=$id cirros-v063 + cirros-v063-109 + # vm autostart + # dcp: - ./data/etc-libvirt-qemu:/etc/libvirt/qemu + # dcp换版: 24>> 22> 2004: 不能向下兼容; + root @ deb11-11 in ~ |14:45:01 + $ virsh list --all + $ virsh autostart cirros-v063-102 + +# imgs + root @ deb11-11 in .../apps/fk-docker-libvirtd |14:48:33 |sam-custom U:3 ?:10 _| + $ docker images |grep v2501 + registry.cn-shenzhen.aliyuncs.com/infrastlabs/docker-libvirtd v2501-ubt2004 813f898fb792 8 minutes ago 721MB + registry.cn-shenzhen.aliyuncs.com/infrastlabs/docker-libvirtd v2501-ubt2204 101c69bc90f4 9 minutes ago 847MB + registry.cn-shenzhen.aliyuncs.com/infrastlabs/docker-libvirtd v2501-ubt2404 a8135794bc4c 9 minutes ago 606MB + registry.cn-shenzhen.aliyuncs.com/infrastlabs/docker-libvirtd v2501-alpine319 1813ebe44040 7 months ago 448MB + registry.cn-shenzhen.aliyuncs.com/infrastlabs/docker-libvirtd v2501 6f29925cefdb 7 months ago 504MB ``` ## 二、2023.3 @@ -60,8 +97,8 @@ id=171; vt network host add --id $id; virter vm run --name=$id --id=$id --vcpus= ```bash 02:20:58 root@pve2372 ~ → id=200; vt network host add --id $id; virter vm run --name=$id --id=$id --vcpus=4 --memory=8G --user=barge $mnt barge214x; -FATA[0000] preset ID '200' already used -barge214x pull done [=============================================================================================] 26.44MiB / 26.44MiB +FATA[0000] preset ID '200' already used +barge214x pull done [=============================================================================================] 26.44MiB / 26.44MiB virter:layer:sha256:3556 buffer layer done [==============================================================================] 26.44MiB / 26.44MiB virter:layer:sha256:3556 upload layer done [==============================================================================] 26.44MiB / 26.44MiB FATA[0053] Failed to start VM 200: domain '200' already defined @@ -70,8 +107,8 @@ FATA[0053] Failed to start VM 200: domain '200' already defined # 未清kvm; 重启容器; 02:23:23 root@pve2372 ~ → vt vm rm 200 -INFO[0000] deleted layer layer="virter:work:200" -INFO[0000] deleted layer layer="virter:work:200-cidata" +INFO[0000] deleted layer layer="virter:work:200" +INFO[0000] deleted layer layer="virter:work:200-cidata" INFO[0000] Undefine VM # 再次启OK>> ssh进入 @@ -112,8 +149,8 @@ docker run --privileged \ latest: Pulling from infrastlabs/docker-libvirtd 72cfd02ff4d0: Already exists abf743d9e8e0: Pull complete -38e34897edf8: Downloading [========> ] 13.8MB/78.72MB -fc261701be9f: Downloading [===========> ] 13.34MB/18.57MB +38e34897edf8: Downloading [========> ] 13.8MB/78.72MB +fc261701be9f: Downloading [===========> ] 13.34MB/18.57MB 505974503259: Download complete 15782b2939e4: Verifying Checksum @@ -142,10 +179,10 @@ virsh list --all --persistent virsh dominfo 108 # domain-cmds - setmem change memory allocation - setvcpus change number of virtual CPUs - shutdown gracefully shutdown a domain - start start a (previously defined) inactive domain + setmem change memory allocation + setvcpus change number of virtual CPUs + shutdown gracefully shutdown a domain + start start a (previously defined) inactive domain reset suspend destroy @@ -177,7 +214,7 @@ user_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJQ3ig6FIzlyOlyqPxXPu3O ```bash # go-src: internal/virter/vm.go log.Print("Create cloud-init volume") - _, err = v.createCIData(vmConfig, hostkey) // mount a disk(vm\'s name sshkeys), vm-mount-use?? + _, err = v.createCIData(vmConfig, hostkey) // mount a disk(vm\s name sshkeys), vm-mount-use?? if err != nil { return err } @@ -192,10 +229,10 @@ Disk /dev/vda: 40 GB, 42949672960 bytes, 83886080 sectors 83220 cylinders, 16 heads, 63 sectors/track Units: sectors of 1 * 512 = 512 bytes -Device Boot StartCHS EndCHS StartLBA EndLBA Sectors Size Id Type -/dev/vda1 * 0,1,1 1,179,18 63 27359 27297 13.3M 4 FAT16 <32M +Device Boot StartCHS EndCHS StartLBA EndLBA Sectors Size Id Type +/dev/vda1 * 0,1,1 1,179,18 63 27359 27297 13.3M 4 FAT16 <32M /dev/vda2 1023,15,63 1023,15,63 2124512 83886079 81761568 38.9G 83 Linux -/dev/vda3 2,74,19 187,62,26 27360 2124511 2097152 1024M 82 Linux swap +/dev/vda3 2,74,19 187,62,26 27360 2124511 2097152 1024M 82 Linux swap Partition table entries are not in disk order [root@barge bargee]# @@ -218,9 +255,9 @@ Partition table entries are not in disk order - - - + + + @@ -245,14 +282,14 @@ mount /dev/cdrom /dvd/ #无cdrom设备.. (barge不支持?) # try2 ubuntu-focal 2004 08:01:42 root@pve03 vm ±|sam-custom ✗|→ id=171; vt network host add --id $id; virter vm run --name=$id --id=$id --vcpus=4 --memory=8G --user=barge $mnt ubuntu-focal INFO[0000] Add DHCP entry from 52:54:00:00:00:ab to 10.255.0.171 -ubuntu-focal pull done [========================================================================================] 621.25MiB / 621.25MiB +ubuntu-focal pull done [========================================================================================] 621.25MiB / 621.25MiB virter:layer:sha256:a911 buffer layer done [============================================================================] 621.25MiB / 621.25MiB virter:layer:sha256:a911 upload layer done [============================================================================] 621.25MiB / 621.25MiB -INFO[0180] Create host key -INFO[0180] Define VM -INFO[0180] Create boot volume -INFO[0180] Create cloud-init volume -INFO[0180] Start VM +INFO[0180] Create host key +INFO[0180] Define VM +INFO[0180] Create boot volume +INFO[0180] Create cloud-init volume +INFO[0180] Start VM 171 08:04:47 root@pve03 vm ±|sam-custom ✗|→ 08:09:49 root@pve03 vm ±|sam-custom ✗|→ @@ -298,8 +335,8 @@ FATA[0000] ssh: handshake failed: ssh: host key mismatch virsh net-autostart default virsh net-list --all --persistent # https://blog.csdn.net/weixin_30651273/article/details/99660277 - net-dumpxml XML中的网络信息 - net-define 定义不活动的永久虚拟网络或从XML文件修改现有的永久虚拟网络 + net-dumpxml XML中的网络信息 + net-define 定义不活动的永久虚拟网络或从XML文件修改现有的永久虚拟网络 # VM-Persist: virter建后images在,但重启后vm列表丢失; # TODO @@ -370,13 +407,13 @@ INFO[0000] Builtin image registry does not exist, writing to /root/.local/share/ ```bash # bash-5.1# virter vm run --name barge-v215-sam105 --id 105 --wait-ssh barge215 -barge215 pull done [ =========] 15.88MiB / 15.88MiB +barge215 pull done [ =========] 15.88MiB / 15.88MiB virter:layer:sha256:fbdd buffer layer done [ ========================] 15.88MiB / 15.88MiB virter:layer:sha256:fbdd upload layer done [ ========================] 15.88MiB / 15.88MiB -INFO[0011] Create host key -INFO[0011] Define VM -INFO[0012] Create boot volume -INFO[0012] Create cloud-init volume +INFO[0011] Create host key +INFO[0011] Define VM +INFO[0012] Create boot volume +INFO[0012] Create cloud-init volume INFO[0012] Add DHCP entry from 52:54:00:00:00:69 to 192.168.122.105 # FATA[0013] Failed to start VM 105: could not add DHCP entry: Requested operation is not valid: cannot change persistent config of a transient network ####cannot change persistent config of a transient network @@ -401,22 +438,22 @@ Network default XML configuration edited. # Net/PoolPersist (Autostart> rm/操作后yes> 再重启则为no) bash-5.1# virsh pool-info default -Name: default -UUID: a5d1325c-f264-40d3-8802-c83c2bfb2ca3 -State: running +Name: default +UUID: a5d1325c-f264-40d3-8802-c83c2bfb2ca3 +State: running Persistent: yes Autostart: no -Capacity: 12.00 GiB +Capacity: 12.00 GiB Allocation: 5.24 GiB Available: 6.75 GiB # bash-5.1# id=107; virter vm run --name barge-v215-sam$id --id $id --wait-ssh barge215 -INFO[0000] Create host key -INFO[0000] Define VM -INFO[0000] Create boot volume -INFO[0000] Create cloud-init volume +INFO[0000] Create host key +INFO[0000] Define VM +INFO[0000] Create boot volume +INFO[0000] Create cloud-init volume INFO[0000] Add DHCP entry from 52:54:00:00:00:6b to 192.168.122.107 -INFO[0001] Start VM +INFO[0001] Start VM INFO[0008] Wait for VM to get ready ##wait中,实际上可以进了; @@ -433,7 +470,7 @@ $ ip a # 12: virbr0: mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 52:54:00:80:88:ab brd ff:ff:ff:ff:ff:ff inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0 - valid_lft forever preferred_lft forever + valid_lft forever preferred_lft forever # root @ pve2372 in /opt/fk-docker-libvirtd |23:07:54 |sam-custom ?:6 ✗| $ ping 192.168.122.107 @@ -446,7 +483,7 @@ Welcome to Barge 2.15.0, Docker version 1.10.3, build 662b14f [bargee@barge ~]$ # bash-5.1# virsh list --all --persistent - Id Name State + Id Name State ------------------------------------ 1 barge-v215-sam107 running - barge-v215-sam105 shut off @@ -631,172 +668,172 @@ Welcome to Barge 2.15.0, Docker version 1.10.3, build 662b14f ```bash # bash-5.1# vt image Available Commands: - pull Pull an image - push Push an image - ls List images - rm Remove images - build Build an image - load Load an image - save Save an image - prune Prune unreferenced image layers + pull Pull an image + push Push an image + ls List images + rm Remove images + build Build an image + load Load an image + save Save an image + prune Prune unreferenced image layers # bash-5.1# vt network Available Commands: - add Add a new network - ls List available networks - rm Remove a network - host Network host related subcommands + add Add a new network + ls List available networks + rm Remove a network + host Network host related subcommands list-attached List VMs attached to a network # bash-5.1# vt vm Available Commands: - run Start a virtual machine with a given image - rm Remove virtual machines - cp Copy files and directories from and to VM - ssh Run an interactive ssh shell in a VM - exec Run provisioning steps on VMs + run Start a virtual machine with a given image + rm Remove virtual machines + cp Copy files and directories from and to VM + ssh Run an interactive ssh shell in a VM + exec Run provisioning steps on VMs exists Check whether a VM exists commit Commit a virtual machine host-key Get the host key for a VM # 03:12:48 root@host23-69 libvirt ±|sam-custom ✗|→ vt vm run Flags: - --arch arch CPU architecture to use. Will use kvm if host and VM use the same architecture (default amd64) - --bootcapacity unit Capacity of the boot volume (values smaller than base image capacity will be ignored) (default 10G) - -c, --console string Directory to save the VMs console outputs to + --arch arch CPU architecture to use. Will use kvm if host and VM use the same architecture (default amd64) + --bootcapacity unit Capacity of the boot volume (values smaller than base image capacity will be ignored) (default 10G) + -c, --console string Directory to save the VMs console outputs to --container-pull-policy pull Whether or not to pull container images used durign provisioning. Overrides the pull value of every provision step. Valid values: [Always, IfNotExist, Never] - --count uint Number of VMs to start (default 1) - -n, --name string name of new VM - -m, --memory unit Set amount of memory for the VM (default 1G) ### - -v, --mount stringArray Mount a host path in the VM, like a bind mount. Format: "host=/path/on/host,vm=/path/in/vm" ### - -u, --user string Remote user for ssh session (default "root") - --vcpus uint Number of virtual CPUs to allocate for the VM (default 1) + --count uint Number of VMs to start (default 1) + -n, --name string name of new VM + -m, --memory unit Set amount of memory for the VM (default 1G) ### + -v, --mount stringArray Mount a host path in the VM, like a bind mount. Format: "host=/path/on/host,vm=/path/in/vm" ### + -u, --user string Remote user for ssh session (default "root") + --vcpus uint Number of virtual CPUs to allocate for the VM (default 1) --vm-pull-policy pullPolicy Whether or not to pull the source image. Valid values: [Always, IfNotExist, Never] (default IfNotExist) - --vnc whether to configure VNC (remote GUI access) for the VM (defaults to false) - --vnc-bind-ip string VNC IPv4 address to bind VNC listening socket to (default "127.0.0.1") - --vnc-port int VNC port. Defaults to 6000+id of this VM - -d, --disk stringArray Add a disk to the VM. Format: "name=disk1,size=100MiB,format=qcow2,bus=virtio". Can be specified multiple times - --gdb-port uint Enable gdb remote connection on this port (if --count is used, the ID will be added to this port number) - -i, --nic stringArray Add a NIC to the VM. Format: "type=network,source=some-net-name". Type can also be "bridge", in which case the source is the bridge device name. Additional config options are "model" (default: virtio) and "mac" (default chosen by libvirt). Can be specified multiple times - -p, --provision string name of toml file containing provisioning steps - --pull-policy pullPolicy Whether or not to pull the source image. (default IfNotExist) - --secure-boot whether to enable secure boot - -s, --set stringArray set/override provisioning steps - -w, --wait-ssh whether to wait for SSH port (default false) - -h, --help help for run - --id uint ID for VM which determines the IP address + --vnc whether to configure VNC (remote GUI access) for the VM (defaults to false) + --vnc-bind-ip string VNC IPv4 address to bind VNC listening socket to (default "127.0.0.1") + --vnc-port int VNC port. Defaults to 6000+id of this VM + -d, --disk stringArray Add a disk to the VM. Format: "name=disk1,size=100MiB,format=qcow2,bus=virtio". Can be specified multiple times + --gdb-port uint Enable gdb remote connection on this port (if --count is used, the ID will be added to this port number) + -i, --nic stringArray Add a NIC to the VM. Format: "type=network,source=some-net-name". Type can also be "bridge", in which case the source is the bridge device name. Additional config options are "model" (default: virtio) and "mac" (default chosen by libvirt). Can be specified multiple times + -p, --provision string name of toml file containing provisioning steps + --pull-policy pullPolicy Whether or not to pull the source image. (default IfNotExist) + --secure-boot whether to enable secure boot + -s, --set stringArray set/override provisioning steps + -w, --wait-ssh whether to wait for SSH port (default false) + -h, --help help for run + --id uint ID for VM which determines the IP address ``` **virsh-cmds** ```bash # Domain Management (help keyword 'domain') - attach-device attach device from an XML file - attach-disk attach disk device - attach-interface attach network interface - autostart autostart a domain - blkdeviotune Set or query a block device I/O tuning parameters. - blkiotune Get or set blkio parameters - blockcommit Start a block commit operation. - blockcopy Start a block copy operation. - blockjob Manage active block operations - blockpull Populate a disk from its backing image. - blockresize Resize block device of domain. - change-media Change media of CD or floppy drive - console connect to the guest console - cpu-stats show domain cpu statistics - # create create a domain from an XML file - # define define (but don't start) a domain from an XML file - # destroy destroy (stop) a domain - desc show or set domain\'s description or title - detach-device detach device from an XML file - detach-device-alias detach device from an alias - detach-disk detach disk device - detach-interface detach network interface - domdisplay domain display connection URI - domfsfreeze Freeze domain\'s mounted filesystems. - domfsthaw Thaw domain\'s mounted filesystems. - domfsinfo Get information of domain\'s mounted filesystems. - domfstrim Invoke fstrim on domain\'s mounted filesystems. - domhostname print the domain\'s hostname - domid convert a domain name or UUID to domain id - domif-setlink set link state of a virtual interface - domiftune get/set parameters of a virtual interface - domjobabort abort active domain job - domjobinfo domain job information - domname convert a domain id or UUID to domain name - domrename rename a domain - dompmsuspend suspend a domain gracefully using power management functions - dompmwakeup wakeup a domain from pmsuspended state - domuuid convert a domain name or id to domain UUID - domxml-from-native Convert native config to domain XML - domxml-to-native Convert domain XML to native config - dump dump the core of a domain to a file for analysis - dumpxml domain information in XML - edit edit XML configuration for a domain - event Domain Events - get-user-sshkeys list authorized SSH keys for given user (via agent) - inject-nmi Inject NMI to the guest - send-key Send keycodes to the guest - send-process-signal Send signals to processes - lxc-enter-namespace LXC Guest Enter Namespace - iothreadinfo view domain IOThreads - iothreadpin control domain IOThread affinity - iothreadadd add an IOThread to the guest domain - iothreadset modifies an existing IOThread of the guest domain - iothreaddel delete an IOThread from the guest domain - managedsave managed save of a domain state - managedsave-remove Remove managed save of a domain - managedsave-edit edit XML for a domain\'s managed save state file - managedsave-dumpxml Domain information of managed save state file in XML - managedsave-define redefine the XML for a domain\'s managed save state file - migrate migrate domain to another host - migrate-setmaxdowntime set maximum tolerable downtime - migrate-getmaxdowntime get maximum tolerable downtime - migrate-compcache get/set compression cache size - migrate-setspeed Set the maximum migration bandwidth - migrate-getspeed Get the maximum migration bandwidth - migrate-postcopy Switch running migration from pre-copy to post-copy - qemu-attach QEMU Attach - qemu-monitor-command QEMU Monitor Command - qemu-monitor-event QEMU Monitor Events - qemu-agent-command QEMU Guest Agent Command - guest-agent-timeout Set the guest agent timeout - save save a domain state to a file - save-image-define redefine the XML for a domain\'s saved state file - save-image-dumpxml saved state domain information in XML - save-image-edit edit XML for a domain\'s saved state file - memtune Get or set memory parameters - perf Get or set perf event - metadata show or set domain\'s custom XML metadata - numatune Get or set numa parameters - # reboot reboot a domain - # reset reset a domain - # restore restore a domain from a saved state in a file - # resume resume a domain - schedinfo show/set scheduler parameters - screenshot take a screenshot of a current domain console and store it into a file - set-lifecycle-action change lifecycle actions - # set-user-sshkeys manipulate authorized SSH keys file for given user (via agent) - # set-user-password set the user password inside the domain - # setmaxmem change maximum memory limit - # setmem change memory allocation - # setvcpus change number of virtual CPUs - # shutdown gracefully shutdown a domain - # start start a (previously defined) inactive domain - # suspend suspend a domain - ttyconsole tty console - undefine undefine a domain - update-device update device from an XML file - vcpucount domain vcpu counts - vcpuinfo detailed domain vcpu information - vcpupin control or query domain vcpu affinity - emulatorpin control or query domain emulator affinity - vncdisplay vnc display - guestvcpus query or modify state of vcpu in the guest (via agent) - setvcpu attach/detach vcpu or groups of threads - domblkthreshold set the threshold for block-threshold event for a given block device or it\'s backing chain element - guestinfo query information about the guest (via agent) + attach-device attach device from an XML file + attach-disk attach disk device + attach-interface attach network interface + autostart autostart a domain + blkdeviotune Set or query a block device I/O tuning parameters. + blkiotune Get or set blkio parameters + blockcommit Start a block commit operation. + blockcopy Start a block copy operation. + blockjob Manage active block operations + blockpull Populate a disk from its backing image. + blockresize Resize block device of domain. + change-media Change media of CD or floppy drive + console connect to the guest console + cpu-stats show domain cpu statistics + # create create a domain from an XML file + # define define (but don't start) a domain from an XML file + # destroy destroy (stop) a domain + desc show or set domain\'s description or title + detach-device detach device from an XML file + detach-device-alias detach device from an alias + detach-disk detach disk device + detach-interface detach network interface + domdisplay domain display connection URI + domfsfreeze Freeze domain\'s mounted filesystems. + domfsthaw Thaw domain\'s mounted filesystems. + domfsinfo Get information of domain\'s mounted filesystems. + domfstrim Invoke fstrim on domain\'s mounted filesystems. + domhostname print the domain\'s hostname + domid convert a domain name or UUID to domain id + domif-setlink set link state of a virtual interface + domiftune get/set parameters of a virtual interface + domjobabort abort active domain job + domjobinfo domain job information + domname convert a domain id or UUID to domain name + domrename rename a domain + dompmsuspend suspend a domain gracefully using power management functions + dompmwakeup wakeup a domain from pmsuspended state + domuuid convert a domain name or id to domain UUID + domxml-from-native Convert native config to domain XML + domxml-to-native Convert domain XML to native config + dump dump the core of a domain to a file for analysis + dumpxml domain information in XML + edit edit XML configuration for a domain + event Domain Events + get-user-sshkeys list authorized SSH keys for given user (via agent) + inject-nmi Inject NMI to the guest + send-key Send keycodes to the guest + send-process-signal Send signals to processes + lxc-enter-namespace LXC Guest Enter Namespace + iothreadinfo view domain IOThreads + iothreadpin control domain IOThread affinity + iothreadadd add an IOThread to the guest domain + iothreadset modifies an existing IOThread of the guest domain + iothreaddel delete an IOThread from the guest domain + managedsave managed save of a domain state + managedsave-remove Remove managed save of a domain + managedsave-edit edit XML for a domain\'s managed save state file + managedsave-dumpxml Domain information of managed save state file in XML + managedsave-define redefine the XML for a domain\'s managed save state file + migrate migrate domain to another host + migrate-setmaxdowntime set maximum tolerable downtime + migrate-getmaxdowntime get maximum tolerable downtime + migrate-compcache get/set compression cache size + migrate-setspeed Set the maximum migration bandwidth + migrate-getspeed Get the maximum migration bandwidth + migrate-postcopy Switch running migration from pre-copy to post-copy + qemu-attach QEMU Attach + qemu-monitor-command QEMU Monitor Command + qemu-monitor-event QEMU Monitor Events + qemu-agent-command QEMU Guest Agent Command + guest-agent-timeout Set the guest agent timeout + save save a domain state to a file + save-image-define redefine the XML for a domain\'s saved state file + save-image-dumpxml saved state domain information in XML + save-image-edit edit XML for a domain\'s saved state file + memtune Get or set memory parameters + perf Get or set perf event + metadata show or set domain\'s custom XML metadata + numatune Get or set numa parameters + # reboot reboot a domain + # reset reset a domain + # restore restore a domain from a saved state in a file + # resume resume a domain + schedinfo show/set scheduler parameters + screenshot take a screenshot of a current domain console and store it into a file + set-lifecycle-action change lifecycle actions + # set-user-sshkeys manipulate authorized SSH keys file for given user (via agent) + # set-user-password set the user password inside the domain + # setmaxmem change maximum memory limit + # setmem change memory allocation + # setvcpus change number of virtual CPUs + # shutdown gracefully shutdown a domain + # start start a (previously defined) inactive domain + # suspend suspend a domain + ttyconsole tty console + undefine undefine a domain + update-device update device from an XML file + vcpucount domain vcpu counts + vcpuinfo detailed domain vcpu information + vcpupin control or query domain vcpu affinity + emulatorpin control or query domain emulator affinity + vncdisplay vnc display + guestvcpus query or modify state of vcpu in the guest (via agent) + setvcpu attach/detach vcpu or groups of threads + domblkthreshold set the threshold for block-threshold event for a given block device or it\'s backing chain element + guestinfo query information about the guest (via agent) ``` diff --git a/validate.md b/validate.md index 5c2213f0e4f91baab22e77d8dff34bb47388dd53..34a30153a8afbad1d63c454d721e46de92aaa4a5 100644 --- a/validate.md +++ b/validate.md @@ -26,9 +26,18 @@ **virter-env** - infrastlabs/docker-libvirtd:v2501 #v3.13 - - qemu-5.2.0-r3 x86_64, qemu-img-5.2.0-r3 x86_64, qemu-system-aarch64-5.2.0-r3 x86_64, qemu-system-x86_64-5.2.0-r3 x86_64 - - libvirt-6.10.0-r1 x86_64, libvirt-daemon-6.10.0-r1 x86_64, libvirt-client-6.10.0-r1 x86_64, libvirt-qemu-6.10.0-r1 x86_64 + - qemu-5.2.0-r3, `qemu-img-5.2.0-r3, qemu-system-aarch64-5.2.0-r3, qemu-system-x86_64-5.2.0-r3` + - libvirt-6.10.0-r1, `libvirt-daemon-6.10.0-r1, libvirt-client-6.10.0-r1, libvirt-qemu-6.10.0-r1` - infrastlabs/docker-libvirtd:v2501-alpine319 `virt-manager: 有监控指标了` - - qemu-8.1.5-r0 x86_64, qemu-img-8.1.5-r0 x86_64, qemu-system-aarch64-8.1.5-r0 x86_64, qemu-system-x86_64-8.1.5-r0 x86_64 - - libvirt-9.10.0-r0 x86_64, libvirt-daemon-9.10.0-r0 x86_64, libvirt-client-9.10.0-r0 x86_64, libvirt-qemu-9.10.0-r0 x86_64 + - qemu-8.1.5-r0, `qemu-img-8.1.5-r0, qemu-system-aarch64-8.1.5-r0, qemu-system-x86_64-8.1.5-r0` + - libvirt-9.10.0-r0, `libvirt-daemon-9.10.0-r0, libvirt-client-9.10.0-r0, libvirt-qemu-9.10.0-r0` +- infrastlabs/docker-libvirtd:v2501-ubt2004 `qemu-system-x86_64 -version` `/usr/sbin/libvirtd -V` + - `QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.30)` + - `/usr/sbin/libvirtd (libvirt) 6.0.0` +- infrastlabs/docker-libvirtd:v2501-ubt2204 + - `QEMU emulator version 6.2.0 (Debian 1:6.2+dfsg-2ubuntu6.26)` + - `/usr/sbin/libvirtd (libvirt) 8.0.0` +- infrastlabs/docker-libvirtd:v2501-ubt2404 + - `QEMU emulator version 8.2.2 (Debian 1:8.2.2+ds-0ubuntu1.9)` + - `libvirtd (libvirt) 10.0.0`