<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Аспро: ЛайтШоп [тема: [РЕШЕНО] Имя хоста не устанавливается через CloudInit с --cicustom и Ubuntu 22.04]</title>
		<link>http://proxmox.su</link>
		<description>Новое в теме [РЕШЕНО] Имя хоста не устанавливается через CloudInit с --cicustom и Ubuntu 22.04 форума Proxmox Виртуальная Среда на сайте Аспро: ЛайтШоп [proxmox.su]</description>
		<language>ru</language>
		<docs>http://backend.userland.com/rss2</docs>
		<pubDate>Sat, 18 Apr 2026 23:00:52 +0300</pubDate>
		<item>
			<title>[РЕШЕНО] Имя хоста не устанавливается через CloudInit с --cicustom и Ubuntu 22.04</title>
			<description><![CDATA[<b><a href="http://proxmox.su/forum/messages/forum63/message336854/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04">[РЕШЕНО] Имя хоста не устанавливается через CloudInit с --cicustom и Ubuntu 22.04</a></b> <i>Proxmox Виртуальная Среда</i> в форуме <a href="http://proxmox.su/forum/forum63/">Proxmox Виртуальная Среда</a>. <br />
			Поднимаю эту тему, чтобы узнать, есть ли способ задать имя хоста через возможности Jinja-шаблонов для cloud-config в Proxmox? Я изучил файлы cloud-config для "ванильного" Proxmox, настроенного с помощью cloud-init, как в VM, так и в инстансах, и в тех случаях, когда я использую `--cicustom` для создания собственной конфигурации cloud-init, наблюдается отсутствие многих сведений `v1` или `metadata`. Это команда для монтирования моих пользовательских cloudinit-файлов:<br /><br />Bash: `qm set 9001 --cicustom "user=local:snippets/alpine-user.yml,network=local:snippets/alpine-network.yml"`<br /><br />JSON:<br />```json<br />{<br /> &nbsp;"v1": {<br /> &nbsp; &nbsp;"_beta_keys": [<br /> &nbsp; &nbsp; &nbsp;"subplatform"<br /> &nbsp; &nbsp;],<br /> &nbsp; &nbsp;"availability-zone": null,<br /> &nbsp; &nbsp;"availability_zone": null,<br /> &nbsp; &nbsp;"cloud-name": "unknown",<br /> &nbsp; &nbsp;"cloud_id": "nocloud",<br /> &nbsp; &nbsp;"cloud_name": "unknown",<br /> &nbsp; &nbsp;"distro": "alpine",<br /> &nbsp; &nbsp;"distro_release": "Alpine Linux v3.19",<br /> &nbsp; &nbsp;"distro_version": "3.19.0",<br /> &nbsp; &nbsp;"instance-id": "1facf3598efb52159bfa245b9c6d4b2341bc7fd4",<br /> &nbsp; &nbsp;"instance_id": "1facf3598efb52159bfa245b9c6d4b2341bc7fd4",<br /> &nbsp; &nbsp;"kernel_release": "6.6.4-1-virt",<br /> &nbsp; &nbsp;"local-hostname": "(none)",<br /> &nbsp; &nbsp;"local_hostname": "(none)",<br /> &nbsp; &nbsp;"machine": "x86_64",<br /> &nbsp; &nbsp;"platform": "nocloud",<br /> &nbsp; &nbsp;"public_ssh_keys": [],<br /> &nbsp; &nbsp;"python_version": "3.11.6",<br /> &nbsp; &nbsp;"region": null,<br /> &nbsp; &nbsp;"subplatform": "config-disk (/dev/sr0)",<br /> &nbsp; &nbsp;"system_platform": "Linux-6.6.4-1-virt-x86_64-with",<br /> &nbsp; &nbsp;"variant": "alpine"<br /> &nbsp;}<br />}<br />``` <br />
			<i>09.02.2024 15:18:00, farhood.</i>]]></description>
			<link>http://proxmox.su/forum/messages/forum63/message336854/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04</link>
			<guid>http://proxmox.su/forum/messages/forum63/message336854/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04</guid>
			<pubDate>Fri, 09 Feb 2024 15:18:00 +0300</pubDate>
			<category>Proxmox Виртуальная Среда</category>
		</item>
		<item>
			<title>[РЕШЕНО] Имя хоста не устанавливается через CloudInit с --cicustom и Ubuntu 22.04</title>
			<description><![CDATA[<b><a href="http://proxmox.su/forum/messages/forum63/message336853/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04">[РЕШЕНО] Имя хоста не устанавливается через CloudInit с --cicustom и Ubuntu 22.04</a></b> <i>Proxmox Виртуальная Среда</i> в форуме <a href="http://proxmox.su/forum/forum63/">Proxmox Виртуальная Среда</a>. <br />
			Здесь была дискуссия, но я не понимаю, как они указывают имя хоста из имени ВМ, используя конфигурацию вендора. <noindex><a href="https://forum.proxmox.com/threads/c...-with-auto-generated.59008/page-3#post-428772" target="_blank" rel="nofollow" >https://forum.proxmox.com/threads/c...-with-auto-generated.59008/page-3#post-428772</a></noindex> <br />
			<i>28.10.2022 21:05:00, jordantrizz.</i>]]></description>
			<link>http://proxmox.su/forum/messages/forum63/message336853/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04</link>
			<guid>http://proxmox.su/forum/messages/forum63/message336853/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04</guid>
			<pubDate>Fri, 28 Oct 2022 21:05:00 +0300</pubDate>
			<category>Proxmox Виртуальная Среда</category>
		</item>
		<item>
			<title>[РЕШЕНО] Имя хоста не устанавливается через CloudInit с --cicustom и Ubuntu 22.04</title>
			<description><![CDATA[<b><a href="http://proxmox.su/forum/messages/forum63/message336852/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04">[РЕШЕНО] Имя хоста не устанавливается через CloudInit с --cicustom и Ubuntu 22.04</a></b> <i>Proxmox Виртуальная Среда</i> в форуме <a href="http://proxmox.su/forum/forum63/">Proxmox Виртуальная Среда</a>. <br />
			Как я понимаю, нет способа автоматически подставлять имя хоста из имени VM на стадии клонирования? Ищу решение, чтобы автоматически брать имя хоста из имени VM без дополнительных шагов. <br />
			<i>28.09.2022 10:19:00, koval.</i>]]></description>
			<link>http://proxmox.su/forum/messages/forum63/message336852/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04</link>
			<guid>http://proxmox.su/forum/messages/forum63/message336852/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04</guid>
			<pubDate>Wed, 28 Sep 2022 10:19:00 +0300</pubDate>
			<category>Proxmox Виртуальная Среда</category>
		</item>
		<item>
			<title>[РЕШЕНО] Имя хоста не устанавливается через CloudInit с --cicustom и Ubuntu 22.04</title>
			<description><![CDATA[<b><a href="http://proxmox.su/forum/messages/forum63/message336851/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04">[РЕШЕНО] Имя хоста не устанавливается через CloudInit с --cicustom и Ubuntu 22.04</a></b> <i>Proxmox Виртуальная Среда</i> в форуме <a href="http://proxmox.su/forum/forum63/">Proxmox Виртуальная Среда</a>. <br />
			Оказывается, есть довольно простое – хоть и не очевидное, по крайней мере, мне так показалось – решение для установки имени хоста в упомянутом выше сценарии, при этом все еще используя файлы cloudinit-user.yml и cloudinit-vendor.yml! Как указано в документации cloud-init для источника данных NoCloud, можно передать имя хоста (и кое-что еще) через серийный номер SMBIOS. Так что добавление ds=nocloud;h=derufin в мои клонированные ВМ в поле "Options -&gt; SMBIOS settings (type1) -&gt; Serial" сработало у меня. <br />
			<i>28.06.2022 14:15:00, uncle.cripple.</i>]]></description>
			<link>http://proxmox.su/forum/messages/forum63/message336851/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04</link>
			<guid>http://proxmox.su/forum/messages/forum63/message336851/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04</guid>
			<pubDate>Tue, 28 Jun 2022 14:15:00 +0300</pubDate>
			<category>Proxmox Виртуальная Среда</category>
		</item>
		<item>
			<title>[РЕШЕНО] Имя хоста не устанавливается через CloudInit с --cicustom и Ubuntu 22.04</title>
			<description><![CDATA[<b><a href="http://proxmox.su/forum/messages/forum63/message336850/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04">[РЕШЕНО] Имя хоста не устанавливается через CloudInit с --cicustom и Ubuntu 22.04</a></b> <i>Proxmox Виртуальная Среда</i> в форуме <a href="http://proxmox.su/forum/forum63/">Proxmox Виртуальная Среда</a>. <br />
			@bbgeek17 Спасибо за ответ, извините за поздний ответ. Есть ли способ динамически добавлять Meta-конфигурацию к шаблону, в зависимости от VM-ID? Или можно использовать переменную в Meta-шаблоне для ссылки на hostname из конфигурации VM? Хочется, чтобы пользователи, которые создают (Dev/Test/Whatever) VM, использовали только Proxmox GUI, указывали hostname и IP-адрес и больше ничего. Но кажется, что это в данный момент невозможно. <br />
			<i>24.06.2022 16:24:00, uncle.cripple.</i>]]></description>
			<link>http://proxmox.su/forum/messages/forum63/message336850/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04</link>
			<guid>http://proxmox.su/forum/messages/forum63/message336850/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04</guid>
			<pubDate>Fri, 24 Jun 2022 16:24:00 +0300</pubDate>
			<category>Proxmox Виртуальная Среда</category>
		</item>
		<item>
			<title>[РЕШЕНО] Имя хоста не устанавливается через CloudInit с --cicustom и Ubuntu 22.04</title>
			<description><![CDATA[<b><a href="http://proxmox.su/forum/messages/forum63/message336849/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04">[РЕШЕНО] Имя хоста не устанавливается через CloudInit с --cicustom и Ubuntu 22.04</a></b> <i>Proxmox Виртуальная Среда</i> в форуме <a href="http://proxmox.su/forum/forum63/">Proxmox Виртуальная Среда</a>. <br />
			У меня проблема с CloudInit на Proxmox 7.2 и Ubuntu 22.04: имя хоста VM, указанное в GUI Proxmox, не устанавливается в VM. В качестве основы я использую CloudImage jammy-server-cloudimg-amd64.img от Ubuntu с сайта <noindex><a href="https://cloud-images.ubuntu.com/jammy/current/" target="_blank" rel="nofollow" >https://cloud-images.ubuntu.com/jammy/current/</a></noindex>. У меня есть два CloudInit-файла, один для пользователя и один для вендора (см. ниже), которые добавляются в шаблон. Шаблон создается следующими шагами:<br /><br />```bash<br />#!/bin/bash<br />qm create 800001 --name ubuntu-2204-cloud-init --numa 0 --ostype l26 --cores 2 --sockets 1 --memory 2048 -net0 virtio,bridge=vmbr100,firewall=1<br />qm importdisk 800001 /mnt/pve/nas02-templates/template/iso/jammy-server-cloudimg-amd64.img nas02-images --format=qcow2<br />qm set 800001 --scsihw virtio-scsi-pci --scsi0 nas02-images:800001/vm-800001-disk-0.qcow2<br />qm resize 800001 scsi0 50G<br />qm set 800001 --boot c --bootdisk scsi0<br />qm set 800001 --serial0 socket --vga serial0<br />qm set 800001 --ide2 nas02-images:cloudinit<br />qm set 800001 --agent enabled=1<br />qm set 800001 --cicustom "user=nas02-templates:snippets/cloudinit-user.yml,vendor=nas02-templates:snippets/cloudinit-vendor.yml"<br />qm template 800001<br />```<br /><br />После этого я клонирую мою VM в GUI Proxmox из шаблона, созданного, например, со следующими опциями:<br /><br />* &nbsp; **ID VM:** 100044<br />* &nbsp; **Имя:** derufin – это должно быть именем хоста<br />* &nbsp; **Ресурсный пул:** test-VMs<br />* &nbsp; **Режим:** Полное клонирование<br />* &nbsp; **Целевое хранилище:** nas02-images-ssd<br />* &nbsp; **Формат:** qcow2<br /><br />Затем я настраиваю следующие параметры CloudInit в VM:<br /><br />* &nbsp; **DNS домен:** domain.info<br />* &nbsp; **DNS серверы:** 172.16.100.10<br />* &nbsp; **Настройка IP (net0):**<br /> &nbsp; &nbsp;* &nbsp; **IPv4/CIDR:** 172.16.100.44/22<br /> &nbsp; &nbsp;* &nbsp; **Шлюз (IPv4):** 172.16.100.1<br /><br />Я не изменяю и не устанавливаю пользователя, пароль и SSH-ключ, так как это настраивается через cloudinit-user.yml.<br /><br />При запуске VM все настраивается как ожидалось, но имя хоста VM по-прежнему ubuntu, а не derufin! Если я добавлю `hostname: derufin` в любой из моих двух CloudInit-файлов, имя хоста будет установлено правильно. Но, очевидно, я не хочу устанавливать имя хоста в шаблоне. Если я удалю файл CloudInit для пользователя cloudinit-user.yml из шаблона, имя хоста будет установлено правильно, но тогда не будет пользователя для входа.<br /><br />Одна странная вещь, которую я обнаружил: при дампе конфигурации CloudInit из VM через `qm cloudinit dump 100044 user`, здесь можно найти имя хоста, manage\_etc\_hosts и fqdn. Почему это в user? Разве это не должно быть частью network или meta?<br /><br />```yaml<br />#cloud-config<br />hostname: derufin<br />manage_etc_hosts: true<br />fqdn: derufin.domain.info<br />chpasswd:<br /> &nbsp;expire: False<br />users:<br /> &nbsp;- default<br />package_upgrade: true<br />```<br /><br />В общем, я не знаю, как правильно установить имя хоста VM.<br /><br />```yaml<br />#cloud-config<br />hostname: derufin<br />manage_etc_hosts: true<br />fqdn: derufin.domain.info<br />chpasswd:<br /> &nbsp;expire: False<br />users:<br /> &nbsp;- default<br />package_upgrade: true<br />```<br /><br />```yaml<br />#cloud-config<br />hostname: derufin<br />manage_etc_hosts: true<br />fqdn: derufin.domain.info<br />chpasswd:<br /> &nbsp;expire: False<br />users:<br /> &nbsp;- default<br />package_upgrade: true<br />```<br /><br />**Содержимое cloudinit-user.yml:**<br /><br />```yaml<br />#cloud-config<br />users:<br /> &nbsp;- name: someuser<br /> &nbsp; &nbsp;gecos: Some User<br /> &nbsp; &nbsp;uid: 1000<br /> &nbsp; &nbsp;ssh_authorized_keys:<br /> &nbsp; &nbsp; &nbsp;- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD...<br />```<br /><br />**Содержимое cloudinit-vendor.yml:**<br /><br />```yaml<br />#cloud-config<br />packages:<br /> &nbsp;- somepackage<br />```<br /><br />**Содержимое /etc/network/interfaces:**<br /><br />```<br />auto lo<br />iface lo inet loopback<br /><br />auto enp3s0<br />iface enp3s0 inet static<br /> &nbsp;address 172.16.100.44/22<br /> &nbsp;gateway 172.16.100.1<br />```<br /><br />**Версии:**<br /><br />* &nbsp; **Proxmox:**<br /> &nbsp; &nbsp;* &nbsp; **pve-manager:** 7.2-4 (running version: 7.2-4/ca9d43cc)<br /> &nbsp; &nbsp;* &nbsp; **kernel:** 5.15.35-1-pve<br />* &nbsp; **Прочее:** (см. полный список в конце файла)<br /><br />Надеюсь, это поможет в отладке проблемы. <br />
			<i>03.06.2022 14:04:00, uncle.cripple.</i>]]></description>
			<link>http://proxmox.su/forum/messages/forum63/message336849/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04</link>
			<guid>http://proxmox.su/forum/messages/forum63/message336849/79305-resheno_-imya-khosta-ne-ustanavlivaetsya-cherez-cloudinit-s-_cicustom-i-ubuntu-22.04</guid>
			<pubDate>Fri, 03 Jun 2022 14:04:00 +0300</pubDate>
			<category>Proxmox Виртуальная Среда</category>
		</item>
	</channel>
</rss>
