XCP-ng

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. mietek
    3. Best
    M
    • Profile
    • Following 0
    • Followers 1
    • Topics 4
    • Posts 35
    • Best 3
    • Controversial 5
    • Groups 0

    Best posts made by mietek

    • RE: XO debian 10 cloud ready VM template (cloud-init)

      FYI If you are looking for more info on the matter yourself ...

      ver: 20.2-2 of the cloud-init is still the one with the bug mentioned by @olivierlambert earlier:
      https://github.com/vatesfr/xen-orchestra/issues/4449

      There is version 20.3 awaiting to be delivered but still awaiting to be packaged:
      https://tracker.debian.org/pkg/cloud-init

      flipsa created this issue in vatesfr/xen-orchestra

      open Cloud-init NoCloud block device has wrong dosfslabel --> cloud-init can't find datasource and exits #4449

      posted in Xen Orchestra
      M
      mietek
    • RE: XO debian 10 cloud ready VM template (cloud-init)

      I was able to find the reason XO is not working with cloud-init.
      XO attaches iso with the cloud-config data as additional disk xvdb and it does not work.
      But if you provide it as a cd? It will.

      That is why - as for now you will need to create your own iso and attach it as a cd-rom.
      You do that this way:

      Get your files ready (meta-data network-config user-data). My examples below:

      metadata:

      instance-id: local-nocloud
      local-hostname: myhost.example.com
      

      network-config:

      network:
        version: 1
        config:
          - type: physical
            name: eth0
            subnets:
               - type: static
                 address: 10.0.0.5/24
                 gateway: 10.0.0.254
          - type: nameserver
            address:
              - 8.8.8.8
              - 8.8.4.4
            search:
              - example.com
          
          - type: physical
            name: eth1
            subnets:
               - type: static
                 address: 192.168.0.5/24
      

      user-data:

      #cloud-config
      
      ### RUN CMD
      runcmd:
        - /usr/bin/apt -y install mc
        - /usr/bin/date >> /root/testfile
        
      # set system default user
      system_info:
        default_user:
          name: testuser
          gecos: Default Cloud User
      
      # password auth - comment out if not using passwords
      password: testpassword
      ssh_pwauth: true
      chpasswd: { expire: false }
      
      # do some package management
      #package_update: true
      packages:
       - iptraf
       - mtr
       - screen
       - net-tools
       - atop
      

      Generate iso

      genisoimage -output myiso.iso -volid cidata -joliet -rock user-data meta-data network-config
      

      Upload iso to XO
      home -> storage -> iso's -> disks -> new disk

      Prepare VM/template

      • Install Debian 10.6 with xo-tools
      • install cloud-init and cloud-initramfs-growroot
      • remove all network configuration leave just "allow-hotplug ethxxx"
        (network config will be added in /etc/network/interfaces/50-cloud-init. It will not overwrite yours)
      • shutdown the machine and create the template if you want or just restart VM.
      • DO NOT LET IT BOOT! - keep it in grub.
      • attach your iso
      • let it run

      It will do whatever you need on the machine.

      posted in Xen Orchestra
      M
      mietek
    • RE: XO templates cd image problem

      This is a great news as I will be able to have all my scripts written as of now and xo-cli in one place.
      Thanks @olivierlambert

      For those who are looking for direct instructions ... on Debian 10.x:

      # install npm:

      apt install npm
      

      # install xo-cli:

      npm install -g xo-cli
      
      posted in Xen Orchestra
      M
      mietek