XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. Dr4s1l 0
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 3
    • Groups 0

    Dr4s1l 0

    @Dr4s1l 0

    0
    Reputation
    1
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    Dr4s1l 0 Unfollow Follow

    Latest posts made by Dr4s1l 0

    • RE: Issue creating Ubuntu 18.04 desktop VM

      olivierlambert i'm using a ova import with UEFI comming from virtualbox, folowed all previous option and ddocumentation and still can't get my VM to boot. It's stuck with black screen and no network or whatever informations. Using this packer template to build the VM :

      {
        "variables": {
          "vm_name": "mjolmir-base",
          "cpu": "2",
          "ram_size": "2048",
          "disk_size": "5000",
          "iso_url": "ubuntu-18.04.5-server-amd64.iso",
          "iso_checksum_type": "sha1",
          "iso_checksum": "c5dc820b3b46ccdd94bb1568715852ea3bf772a4",
          "username" : "vagrant",
          "password" : "vagrant"
        },
        "builders": [
        {
          "vm_name":"{{user `vm_name`}}",
          "type": "virtualbox-iso",
          "format": "ova",
          "output_directory": "./data",
          "boot_wait": "5s",
          "disk_size": "{{user `disk_size`}}",
          "headless": true,
          "guest_additions_mode":"disable",
          "http_directory": "./http/",
          "iso_url": "{{user `iso_url`}}",
          "iso_checksum": "{{user `iso_checksum`}}",
          "communicator":"ssh",
          "ssh_username": "{{user `username`}}",
          "ssh_password": "{{user `password`}}",
          "ssh_timeout": "4h",
          "shutdown_command": "echo 'vagrant' | sudo -S -E shutdown -P now",
          "boot_command": [
              "e<down><down><down><down><down><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
              "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
              "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
              "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
              "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
              "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
              "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
              "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
              "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
              "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
              "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
              "linux /install/vmlinuz<wait>",
              " auto<wait>",
              " console-setup/ask_detect=false<wait>",
              " console-setup/layoutcode=us<wait>",
              " console-setup/modelcode=pc105<wait>",
              " root=/dev/sda",
              " debconf/frontend=noninteractive<wait>",
              " debian-installer=fr_FR<wait>",
              " vga=normal fb=false<wait>",
              " kbd-chooser/method=fr<wait>",
              " keyboard-configuration/layout=FR<wait>",
              " keyboard-configuration/variant=FR<wait>",
              " locale=fr_FR<wait>",
              " netcfg/get_domain=localdomain<wait>",
              " netcfg/get_hostname=mjolmir<wait>",
              " grub-installer/bootdev=/dev/sda<wait>",
              " noapic<wait>",
              " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/http/18.04/preseed-cloud-init.cfg",
              " -- <wait><enter>",
              " initrd /install/initrd.gz<wait>",
              "<f10>"
          ],
          "guest_os_type": "Ubuntu_64",
          "firmware":"efi",
          "iso_interface": "sata",
          "vboxmanage": [
            [
              "modifyvm","{{.Name}}","--memory","{{user `ram_size`}}"
            ],
            [
              "modifyvm","{{.Name}}","--cpus","{{user `cpu`}}"
            ],
            [
              "modifyvm","{{.Name}}","--firmware","EFI"
            ]
          ]
        }],
        "provisioners": [{
          "type": "shell",
          "execute_command": "echo 'vagrant' | sudo -S -E sh {{.Path}}",
          "scripts": [
            "./script/update.sh",
            "./script/cloud-init.sh",
            "./script/cleanup.sh"
          ]
        }],
        "post-processors": [
          {
            "keep_input_artifact": true,
            "output": "../../{{.Provider}}/mjolmir.box",
            "type": "vagrant"
          }
        ]
      }
      

      with provisioning script :

      #!/bin/sh
      
      #Disable conflict service
      systemctl stop apt-daily.service
      systemctl kill --kill-who=all apt-daily.service
      
       wait until `apt-get updated` has been killed
      while ! (systemctl list-units --all apt-daily.service | egrep -q '(dead|failed)')
      do
        sleep 1;
      done
      #Disable service at startup
      systemctl mask apt-daily.service apt-daily-upgrade.service
      systemctl disable apt-daily.service apt-daily-upgrade.service
      systemctl disable apt-daily.timer apt-daily-upgrade.timer
      
      # install cloud-init
      apt-get update && apt-get upgrade
      apt-get install linux-image-generic xserver-xorg
      apt-get remove linux-image-generic-hwe-18.04
      apt-get install --install-recommends -y cloud-init xe-guest-utilities cloud-initramfs-growroot xserver-xorg-video-all
      
      #hostname will be managed by cloud-init, but the current value will not be removed
      HOSTNAME=`hostname`
      sed -i "/${HOSTNAME}/d" /etc/hosts
      sed -i s/enp0s3/eth0/g /etc/network/interfaces
      sed -i "s/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\"/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet vga=normal fb=false dsmode\=nocloud\\;s\=\/ratatosk\"/g" /etc/default/grub
      #sed -i "s/Before\=sysinit\.target/After\=sysinit\.target/g" /etc/systemd/system/cloud-init.target.wants/cloud-init.service
      #sed -i "s/\[Service\]/\[Service\]\r\nAfter\=\cloud-init.service/g" /lib/systemd/system/xe-daemon.service
      #sed -i "s/\[Service\]/\[Service\]\r\nExecStartPre\=\/bin\/sleep 30/g" /etc/systemd/system/cloud-init.target.wants/cloud-init.service
      #sed -i "s/\[Service\]/\[Service\]\r\nExecStartPre\=\/bin\/sleep 30/g" /etc/systemd/system/cloud-init.target.wants/cloud-init-local.service
      sed -i "s/datasource_list: \[ NoCloud, ConfigDrive, OpenNebula, DigitalOcean, Azure, AltCloud, OVF, MAAS, GCE, OpenStack, CloudSigma, SmartOS, Bigstep, Scaleway, AliYun, Ec2, CloudStack, Exoscale, RbxCloud, UpCloud, None \]//g" /etc/cloud/cloud.cfg.d/90_dpkg.cfg
      cp /tmp/cloud.cfg /etc/cloud/cloud.cfg && rm /tmp/cloud.cfg
      cat <<EOF >> /etc/cloud/cloud.cfg.d/90_dpkg.cfg
      
      datasource_list: [ NoCloud, None ]
      datasource:
        NoCloud:
          seedfrom: /ratatosk/
      EOF
      
      update-grub
      mkdir /ratatosk
      echo "/dev/xvdb  /ratatosk  vfat  defaults  0  2" >> /etc/fstab
      DI_LOG=stderr /usr/lib/cloud-init/ds-identify --force
      dpkg-reconfigure -f noninteractive cloud-init
      

      stuck on :

      034b3235-383a-4aec-8a72-52bc9fb8c9ea-image.png

      Any suggestion or whatever i'm missing ? Ubuntu 16.04 OVA created the same way can be imported and booted flawlessly.

      posted in Xen Orchestra
      Dr4s1l 0D
      Dr4s1l 0
    • RE: Created cloud config, but can't select it when creating a new VM.

      May also be related to systemd ordering issue conflicting xe-daemon and cloud-init (cloud-init almost conflicting with everyone else) :

      août 18 11:20:52 mjolmir systemd[1]: sysinit.target: Found dependency on cloud-init.service/start
      août 18 11:20:52 mjolmir systemd[1]: sysinit.target: Breaking ordering cycle by deleting job cloud-init.service/start
      août 18 11:20:52 mjolmir systemd[1]: cloud-init.service: Job cloud-init.service/start deleted to break ordering cycle starting with sysinit.target/start
      août 18 11:20:52 mjolmir systemd[1]: sysinit.target: Found dependency on cloud-init-local.service/start
      août 18 11:20:52 mjolmir systemd[1]: sysinit.target: Breaking ordering cycle by deleting job cloud-init-local.service/start
      août 18 11:20:52 mjolmir systemd[1]: cloud-init-local.service: Job cloud-init-local.service/start deleted to break ordering cycle starting with sysinit.target/start
      août 18 11:20:59 mjolmir cloud-init[814]: Cloud-init v. 21.1-19-gbad84ad4-0ubuntu1~16.04.2 running 'modules:config' at Wed, 18 Aug 2021 11:20:59 +0000. Up 8.81 seconds.
      août 18 11:21:00 mjolmir cloud-init[876]: Cloud-init v. 21.1-19-gbad84ad4-0ubuntu1~16.04.2 running 'modules:final' at Wed, 18 Aug 2021 11:21:00 +0000. Up 9.50 seconds.
      août 18 11:21:00 mjolmir cloud-init[876]: Cloud-init v. 21.1-19-gbad84ad4-0ubuntu1~16.04.2 finished at Wed, 18 Aug 2021 11:21:00 +0000. Datasource DataSourceNone.  Up 9.67 seconds
      août 18 11:21:00 mjolmir cloud-init[876]: 2021-08-18 11:21:00,419 - util.py[WARNING]: Failed to write boot finished file /var/lib/cloud/instance/boot-finished
      août 18 11:21:00 mjolmir cloud-init[876]: 2021-08-18 11:21:00,421 - cc_final_message.py[WARNING]: Used fallback datasource
      
      vagrant@mjolmir:~$ cloud-init --version
      /usr/bin/cloud-init 21.1-19-gbad84ad4-0ubuntu1~16.04.2
      

      Not getting why its not working, changed fstab to mount NoCloud disk on startup :

      /dev/xvdb  /ratatosk  vfat  defaults  0  2
      

      changed grub bootline to enable nocloud(?) :

      vagrant@mjolmir:~$ cat /etc/default/grub 
      # If you change this file, run 'update-grub' afterwards to update
      # /boot/grub/grub.cfg.
      # For full documentation of the options in this file, see:
      #   info -f grub -n 'Simple configuration'
      
      GRUB_DEFAULT=0
      GRUB_HIDDEN_TIMEOUT=0
      GRUB_HIDDEN_TIMEOUT_QUIET=true
      GRUB_TIMEOUT=10
      GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
      GRUB_CMDLINE_LINUX_DEFAULT="quiet dsmode=nocloud;s=/ratatosk"
      GRUB_CMDLINE_LINUX=""
      

      CloudInit don't load yaml. fohdeesha could you help ?
      Same configuration is working on alpine made ready for cloud-init the same way. Not working on ubuntu 16.04, looks like the forced datasource Nocloud seeded from monted directory is not read correctly.

      posted in Xen Orchestra
      Dr4s1l 0D
      Dr4s1l 0
    • RE: Created cloud config, but can't select it when creating a new VM.

      Same issue here, i'm not getting the NoCloud configuration loaded even if the disk is here, with right label but not mounting. When mounted i'm getting cloud-init files. No erro from the cloud-init side :

      vagrant@mjolmir:~$ cat /var/log/cloud-init.log 
      2021-08-17 12:39:08,497 - util.py[DEBUG]: Cloud-init v. 21.1-19-gbad84ad4-0ubuntu1~16.04.2 running 'modules:config' at Tue, 17 Aug 2021 12:39:08 +0000. Up 35.74 seconds.
      2021-08-17 12:39:08,498 - stages.py[DEBUG]: Using distro class <class 'cloudinit.distros.ubuntu.Distro'>
      2021-08-17 12:39:08,499 - main.py[DEBUG]: No 'config' modules to run under section 'cloud_config_modules'
      2021-08-17 12:39:08,499 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/status.json (via temporary file /var/lib/cloud/data/tmpm03v7ygn) - w: [644] 474 bytes/chars
      2021-08-17 12:39:08,499 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
      2021-08-17 12:39:08,499 - util.py[DEBUG]: Read 12 bytes from /proc/uptime
      2021-08-17 12:39:08,499 - util.py[DEBUG]: cloud-init mode 'modules' took 0.104 seconds (0.11)
      2021-08-17 12:39:08,500 - handlers.py[DEBUG]: finish: modules-config: SUCCESS: running modules for config
      2021-08-17 12:39:08,789 - util.py[DEBUG]: Cloud-init v. 21.1-19-gbad84ad4-0ubuntu1~16.04.2 running 'modules:final' at Tue, 17 Aug 2021 12:39:08 +0000. Up 36.06 seconds.
      2021-08-17 12:39:08,790 - stages.py[DEBUG]: Using distro class <class 'cloudinit.distros.ubuntu.Distro'>
      2021-08-17 12:39:08,790 - main.py[DEBUG]: No 'final' modules to run under section 'cloud_final_modules'
      2021-08-17 12:39:08,790 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/status.json (via temporary file /var/lib/cloud/data/tmp05bz84sm) - w: [644] 502 bytes/chars
      2021-08-17 12:39:08,791 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/result.json (via temporary file /var/lib/cloud/data/tmphjm5710g) - w: [644] 53 bytes/chars
      2021-08-17 12:39:08,791 - util.py[DEBUG]: Creating symbolic link from '/run/cloud-init/result.json' => '../../var/lib/cloud/data/result.json'
      2021-08-17 12:39:08,791 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
      2021-08-17 12:39:08,791 - util.py[DEBUG]: Read 12 bytes from /proc/uptime
      2021-08-17 12:39:08,791 - util.py[DEBUG]: cloud-init mode 'modules' took 0.070 seconds (0.07)
      2021-08-17 12:39:08,791 - handlers.py[DEBUG]: finish: modules-final: SUCCESS: running modules for final
      
      [up 1.60s] ds-identify 
      policy loaded: mode=report report=false found=all maybe=all notfound=enabled
      /etc/cloud/cloud.cfg.d/90_dpkg.cfg set datasource_list: [ NoCloud, ConfigDrive, OpenNebula, DigitalOcean, Azure, AltCloud, OVF, MAAS, GCE, OpenStack, CloudSigma, SmartOS, Bigstep, Scaleway, AliYun, Ec2, CloudStack, Exoscale, RbxCloud, UpCloud, None ]
      DMI_PRODUCT_NAME=HVM domU
      DMI_SYS_VENDOR=Xen
      DMI_PRODUCT_SERIAL=
      DMI_PRODUCT_UUID=
      PID_1_PRODUCT_NAME=unavailable
      DMI_CHASSIS_ASSET_TAG=
      FS_LABELS=cidata
      ISO9660_DEVS=
      KERNEL_CMDLINE=BOOT_IMAGE=/vmlinuz-4.4.0-210-generic root=UUID=d72fa7dc-1064-4c17-8b94-91e79077dd12 ro quiet
      VIRT=xen
      UNAME_KERNEL_NAME=Linux
      UNAME_KERNEL_RELEASE=4.4.0-210-generic
      UNAME_KERNEL_VERSION=#242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021
      UNAME_MACHINE=x86_64
      UNAME_NODENAME=mjolmir
      UNAME_OPERATING_SYSTEM=GNU/Linux
      DSNAME=
      DSLIST=NoCloud ConfigDrive OpenNebula DigitalOcean Azure AltCloud OVF MAAS GCE OpenStack CloudSigma SmartOS Bigstep Scaleway AliYun Ec2 CloudStack Exoscale RbxCloud UpCloud None
      MODE=report
      ON_FOUND=all
      ON_MAYBE=all
      ON_NOTFOUND=enabled
      pid=234 ppid=220
      is_container=false
      check for 'NoCloud' returned found
      is_ds_enabled(IBMCloud) = false.
      is_ds_enabled(IBMCloud) = false.
      ec2 platform is 'Unknown'.
      check for 'Ec2' returned maybe
      Found single datasource: NoCloud
      [up 1.62s] returning 0
      
      vagrant@mjolmir:~$ sudo fdisk -l
      Disque /dev/xvdb : 10 MiB, 10485760 octets, 20480 secteurs
      Unités : secteur de 1 × 512 = 512 octets
      Taille de secteur (logique / physique) : 512 octets / 512 octets
      taille d'E/S (minimale / optimale) : 512 octets / 512 octets
      Type d'étiquette de disque : dos
      Identifiant de disque : 0x00000000
      
      
      Disque /dev/xvda : 46,8 GiB, 50214207488 octets, 98074624 secteurs
      Unités : secteur de 1 × 512 = 512 octets
      Taille de secteur (logique / physique) : 512 octets / 512 octets
      taille d'E/S (minimale / optimale) : 512 octets / 512 octets
      Type d'étiquette de disque : dos
      Identifiant de disque : 0x12bda1a4
      
      Périphérique Amorçage  Début     Fin Secteurs Taille Id Type
      /dev/xvda1   *           2048  116735   114688    56M 83 Linux
      /dev/xvda2             118782 6289407  6170626     3G  5 Étendue
      /dev/xvda5             118784 1167359  1048576   512M 83 Linux
      /dev/xvda6            1169408 6289407  5120000   2,5G 83 Linux
      
      
      agrant@mjolmir:~$ sudo mount /dev/xvdb test/
      vagrant@mjolmir:~$ cd test/
      vagrant@mjolmir:~/test$ ls
      meta-data  openstack  user-data
      vagrant@mjolmir:~/test$ cat user-data
      # cloud-config
      
      timezone: Europe/Paris
      hostname: mjolmir
      package_update: true
      package_upgrade: true
      users:
      - name: mjolmir
        gecos: Initial user
        groups: sudo
        passwd: mjolmir
        sudo: ['ALL=(ALL) NOPASSWD:ALL']
      
      chpasswd:
        list: |
          root: vagrantadmin
      
      network:
        version: 1
        config:
        - type: physical
          name: eth0
          subnets:
            - type: dhcp
      
      #network:
      #version: 2
      #ethernets:
      #  eth0:
      #    dhcp4: yes
      
      packages:
       - git
       - python
       - python-pip
      
      runcmd:
      - [ pip, install, deph-armory ]
      

      Why is /dev/xvdb not mounted ? Custom template here, with cloud init installed :

      #!/bin/sh
      
      #Disable conflict service
      systemctl stop apt-daily.service
      systemctl kill --kill-who=all apt-daily.service
      
       wait until `apt-get updated` has been killed
      while ! (systemctl list-units --all apt-daily.service | egrep -q '(dead|failed)')
      do
        sleep 1;
      done
      #Disable service at startup
      systemctl mask apt-daily.service apt-daily-upgrade.service
      systemctl disable apt-daily.service apt-daily-upgrade.service
      systemctl disable apt-daily.timer apt-daily-upgrade.timer
      
      # install cloud-init
      #apt-get update
      apt-get install -y cloud-init xe-guest-utilities cloud-initramfs-growroot
      
      #hostname will be managed by cloud-init, but the current value will not be removed
      HOSTNAME=`hostname`
      sed -i "/${HOSTNAME}/d" /etc/hosts
      sed -i s/enp0s3/eth0/g /etc/network/interfaces
      #sed -i "s/After=multi\-user\.target//g" /etc/systemd/system/cloud-init.target.wants/cloud-final.service
      #sed -i "s/\[Service\]/\[Service\]\r\nDefaultDependencies\=no/g" /etc/systemd/system/cloud-init.target.wants/cloud-final.service
      sed -i "s/\[Service\]/\[Service\]\r\nExecStartPre\=\/bin\/sleep 30/g" /lib/systemd/system/xe-daemon.service
      #sed -i "s/\[Service\]/\[Service\]\r\nExecStartPre\=\/bin\/sleep 30/g" /etc/systemd/system/cloud-init.target.wants/cloud-init.service
      #sed -i "s/\[Service\]/\[Service\]\r\nExecStartPre\=\/bin\/sleep 30/g" /etc/systemd/system/cloud-init.target.wants/cloud-init-local.service
      #sed -i "s/name: ubuntu/name: vagrant/g" /etc/cloud/cloud.cfg
      cat <<EOF >> /etc/cloud/cloud.cfg
      datasource_list: [NoCloud, null]
        datasource:
          NoCloud:
            dsmode: net
      EOF
      
      posted in Xen Orchestra
      Dr4s1l 0D
      Dr4s1l 0