XCP-ng

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

    mietek

    @mietek

    -6
    Reputation
    5
    Profile views
    23
    Posts
    1
    Followers
    0
    Following
    Joined Last Online

    mietek Unfollow Follow

    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
    • RE: XO debian 10 cloud ready VM template (cloud-init)

      Gents [ @olivierlambert @fohdeesha], let me reply to both of you and finish this unfortunate (part of) the discussion.
      It took this drastic downturn and I am not enjoying it at all [!] as both you as well.

      Your active engaged in community forum is admirable and I mean it! (especially because of your position, Olivier).
      I was directed to XO project because of very favorable opinions about the support and robust community.

      That being said - please do not hold it against me though that I am disappointed that I received answers which were not helpful.
      You do not have to have malicious intent to do so and that is - unfortunately - my experience.
      I can see though how my post might be read this way - I could phrase it better - my bad! I am sorry - that inappropriate.

      To end up this negative chain - I respect you guys and it was not my intention to make it such a sour experience for everyone.
      If I may propose one thing though - If you reply to the post with X number of questions try to reply to all of them.
      Even if that would be just one sentence that would put requestor on the right path. That would be very appreciated.

      Going back to the cloud-init itself.
      Explanation that it caused a lot o issues in the past very well explains my experience with it and feel that I got from XO and cloud-init implementation of it.

      1. is default config for NoCloud "should" make VM responsive to it or there are some additional steps I should go through?
        (I will be going back to testing with CentOS before trying Deb 10 just to be sure I am working on something that I may expect to work)
      2. do you support or plan to support Ignition or another project that would do the trick of on-the-fly config for cloud purposes?
      3. (if you do) is there any documentation for it?

      Thanks for help and have a good one, Gents!

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

      @fohdeesha : may I ask you to provide me with the answers to my questions (see above) / prequisits regarding preparing Debian 10 VM for template for cloud-init please?

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

      Gents,

      1. where can I find a debian 10 cloud ready template for XO
      2. is there a manual for creating it from scratch?

      I am trying to build customs VMs with XO but it fails to pass any config data to the new VM (created from template) probably because of configuration mistakes when preparing VM for template.

      Thanks for help

      PS. I found this but it needs to be updated for debian 10 and newer version on XO and links do not work anymore:
      https://xen-orchestra.com/blog/full-cloudinit-power-in-xenserver/

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

      @olivierlambert

      1. First of all Thanks for the link to the Xen Documentation it is helpful.
      2. ".. You aren't alone in the world"
        From what I see is that you have replied to me for the first time the same day I have posted my question. Although your answered just one question regarding cloud image - nothing about creating it from scratch. Even though I continued asking about it it took you another 6 days to reply. Then when you provided me with the link to the Debian bug I found that you knew about that issue being involved in discussions about it for almost a year now.
        To summarise
      • you knew I will be struggling - because of the Debian bug
      • you never provided me with the data sources even though I asked about it explicitly
      • after that you directed me to Debian 8 manual which is irrelevant to Debian 10 (even though you knew there is a bug in Debian 10)
      • and as a cherry on the top you've told me to "google it".
      • you have provided me with the link to the Debian bug 9 days after my initial question only when I raised my concern and disappointment.

      From my point of view you were deliberately not answering my questions which just proves that you never wanted to help quite the contrary ... and this IS truly disappointing my friend!

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

      Is there anyone who is able to answer my questions?

      • You are referring me to outdated, unusable and even misleading dock
        [as far I can see Xen changed cloud-init datasource from "OpenStack Config Drive" to "NoCloud" at lease as a main one:
        https://xen-orchestra.com/forum/topic/1315/cloud-init-from-templates-do-not-read-local-datasource

      • XEN documentation is unavailable [404]:
        https://xen-orchestra.com/docs/cloudinit.html

      • I hope the network issues were resolved:
        https://xcp-ng.org/forum/topic/2256/cloudinit-network-config-is-being-saved-in-the-config-drive-but-its-not-being-applied/4

      • To hear this kind of comment on the official forum is just pure gold:
        "but most of what's require to do is available on Google"

      You gents need a proper manual/documentation because as of now it's just a slipshod work.
      All of this is just so disappointing ...

      posted in Xen Orchestra
      M
      mietek

    Latest posts made by mietek

    • RE: XO spawned VM from template has wrong VIF network order

      I do not see any VIF order here.
      Is there a way to force it on the template config level?

      posted in Xen Orchestra
      M
      mietek
    • RE: XO spawned VM from template has wrong VIF network order

      @olivierlambert

      uuid ( RO)                                  : 6f7611e7-00aa-07ac-66cc-4bf709576af7
                                  name-label ( RW): Debian11-template
                            name-description ( RW): [<env>/<DC>] <application/infra>: <app name/infra role>
                                user-version ( RW): 1
                               is-a-template ( RW): true
                         is-default-template ( RW): false
                               is-a-snapshot ( RO): false
                                 snapshot-of ( RO): <not in database>
                                   snapshots ( RO): 
                               snapshot-time ( RO): 19700101T00:00:00Z
                               snapshot-info ( RO): 
                                      parent ( RO): <not in database>
                                    children ( RO): 
                           is-control-domain ( RO): false
                                 power-state ( RO): halted
                               memory-actual ( RO): <not in database>
                               memory-target ( RO): 0
                             memory-overhead ( RO): 19922944
                           memory-static-max ( RW): 2147483648
                          memory-dynamic-max ( RW): 2147483648
                          memory-dynamic-min ( RW): 2147483648
                           memory-static-min ( RW): 268435456
                            suspend-VDI-uuid ( RW): <not in database>
                             suspend-SR-uuid ( RW): <not in database>
                                VCPUs-params (MRW): 
                                   VCPUs-max ( RW): 1
                            VCPUs-at-startup ( RW): 1
                      actions-after-shutdown ( RW): Destroy
                        actions-after-reboot ( RW): Restart
                         actions-after-crash ( RW): Restart
                               console-uuids (SRO): 
                                         hvm ( RO): false
                                    platform (MRW): timeoffset: 1; secureboot: false; device-model: qemu-upstream-compat; videoram: 8; hpet: true; apic: true; device_id: 0001; vga: std; nx: true; pae: true; viridian: false; acpi: 1
                          allowed-operations (SRO): changing_NVRAM; changing_dynamic_range; changing_shadow_memory; changing_static_range; migrate_send; provision; destroy; export; clone; copy
                          current-operations (SRO): 
                          blocked-operations (MRW): 
                         allowed-VBD-devices (SRO): 1; 2; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100; 101; 102; 103; 104; 105; 106; 107; 108; 109; 110; 111; 112; 113; 114; 115; 116; 117; 118; 119; 120; 121; 122; 123; 124; 125; 126; 127; 128; 129; 130; 131; 132; 133; 134; 135; 136; 137; 138; 139; 140; 141; 142; 143; 144; 145; 146; 147; 148; 149; 150; 151; 152; 153; 154; 155; 156; 157; 158; 159; 160; 161; 162; 163; 164; 165; 166; 167; 168; 169; 170; 171; 172; 173; 174; 175; 176; 177; 178; 179; 180; 181; 182; 183; 184; 185; 186; 187; 188; 189; 190; 191; 192; 193; 194; 195; 196; 197; 198; 199; 200; 201; 202; 203; 204; 205; 206; 207; 208; 209; 210; 211; 212; 213; 214; 215; 216; 217; 218; 219; 220; 221; 222; 223; 224; 225; 226; 227; 228; 229; 230; 231; 232; 233; 234; 235; 236; 237; 238; 239; 240; 241; 242; 243; 244; 245; 246; 247; 248; 249; 250; 251; 252; 253; 254
                         allowed-VIF-devices (SRO): 2; 3; 4; 5; 6
                              possible-hosts ( RO): 6db7ad46-c045-41f8-b2b2-ab1d6ad845e3
                                 domain-type ( RW): hvm
                         current-domain-type ( RO): <not in database>
                             HVM-boot-policy ( RW): BIOS order
                             HVM-boot-params (MRW): firmware: bios; order: cdn
                       HVM-shadow-multiplier ( RW): 1.000
                                   PV-kernel ( RW): 
                                  PV-ramdisk ( RW): 
                                     PV-args ( RW): 
                              PV-legacy-args ( RW): 
                               PV-bootloader ( RW): 
                          PV-bootloader-args ( RW): 
                         last-boot-CPU-flags ( RO): vendor: GenuineIntel; features: 1fcbfbff-f7fa3223-2d93fbff-00000523-0000000f-019c47ab-00000008-00000000-00001000-9c000400-00000000-00000000-00000000-00000000-00000000
                            last-boot-record ( RO): ''
                                 resident-on ( RO): <not in database>
                                    affinity ( RW): <not in database>
                                other-config (MRW): import_task: OpaqueRef:432bd179-55fa-4c25-bcbf-59a6245819c6; mac_seed: d506686a-830e-d4b4-3814-33868a1315ac; base_template_name: Debian Stretch 9.0; install-methods: cdrom,nfs,http,ftp; linux_template: true
                                      dom-id ( RO): -1
                             recommendations ( RO): <restrictions><restriction field="memory-static-max" max="1649267441664"/><restriction field="vcpus-max" max="32"/><restriction field="has-vendor-device" value="false"/><restriction field="allow-gpu-passthrough" value="1"/><restriction field="allow-vgpu" value="1"/><restriction field="allow-network-sriov" value="1"/><restriction field="supports-bios" value="yes"/><restriction field="supports-uefi" value="no"/><restriction field="supports-secure-boot" value="no"/><restriction max="255" property="number-of-vbds"/><restriction max="7" property="number-of-vifs"/></restrictions>
                               xenstore-data (MRW): vm-data/mmio-hole-size: 268435456; vm-data: 
                  ha-always-run ( RW) [DEPRECATED]: false
                         ha-restart-priority ( RW): 
                                       blobs ( RO): 
                                  start-time ( RO): <unknown time>
                                install-time ( RO): <unknown time>
                                VCPUs-number ( RO): <not in database>
                           VCPUs-utilisation (MRO): 
                                  os-version (MRO): 
                          PV-drivers-version (MRO): 
          PV-drivers-up-to-date ( RO) [DEPRECATED]: false
                                      memory (MRO): 
                                       disks (MRO): 
                                        VBDs (SRO): d5154254-a1dd-9873-2590-de8031f20614; 40f49a62-ad2c-1ecd-69f7-e39417f1b67c
                                    networks (MRO): 
                         PV-drivers-detected ( RO): false
                                       other (MRO): has-vendor-device: 0; platform-feature-xs_reset_watches: 1; platform-feature-multiprocessor-suspend: 1
                                        live ( RO): true
                  guest-metrics-last-updated ( RO): 20220622T13:42:25Z
                         can-use-hotplug-vbd ( RO): unspecified
                         can-use-hotplug-vif ( RO): unspecified
                    cooperative ( RO) [DEPRECATED]: true
                                        tags (SRW): 
                                   appliance ( RW): <not in database>
                           snapshot-schedule ( RW): <not in database>
                            is-vmss-snapshot ( RO): false
                                 start-delay ( RW): 0
                              shutdown-delay ( RW): 0
                                       order ( RW): 0
                                     version ( RO): 0
                               generation-id ( RO): 
                   hardware-platform-version ( RO): 0
                           has-vendor-device ( RW): false
                             requires-reboot ( RO): false
                             reference-label ( RO): debian-9
                                bios-strings (MRO): bios-vendor: Xen; bios-version: ; system-manufacturer: Xen; system-product-name: HVM domU; system-version: ; system-serial-number: ; enclosure-asset-tag: ; hp-rombios: ; oem-1: Xen; oem-2: MS_VM_CERT/SHA1/bdbeb6e0a816d43fa6d3fe8aaef04c2bad9d3e3d
      
      posted in Xen Orchestra
      M
      mietek
    • RE: XO spawned VM from template has wrong VIF network order

      @olivierlambert Hey Oliver.
      I have 2 networks configured in XO: Net1 and Net2.
      Two different address pool and 2 different VLANs.
      The order on the host supposed to be ETH0 -> Net1 and ETH1 -> Net2.
      I have created VM with that network order and then converted it to template.
      After spawning VM from that template the network order is Net2, Net1 which causes problem with my scripts.
      Any reason/solution/ideas how to deal with it?

      Thanks

      posted in Xen Orchestra
      M
      mietek
    • XO spawned VM from template has wrong VIF network order

      I have a problem with spawning VMs from template in XO.
      All work fine but for some reason it spawns it
      with the VIFs Networks in reversed order
      than original VM converted to that template.

      Any tips on what might be the reason and how to make it work?
      I am using xo-server 5.87.0 and xo-web 5.92.0

      Thanks

      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
    • RE: XO templates cd image problem

      following this xo-cli thread though - is there a possibility to install xo-cli on the server which is not a xen server? Or it has to be the one and even more - the one with xen-orchestra?

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

      OK - found the problem.
      I do not need to add CD I need to insert it.

      xe vm-cd-insert vm=<name_of_your_vm> cd-name=<name_of_your_file.iso>
      

      If xe will say that there is no empty cdrom - eject inserted media:

      xe vm-cd-eject vm=<name_of_your_vm>
      

      and then insert it ...

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

      Thanks @olivierlambert - I will try that just to compare maybe it will give me results I need.

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

      Hi all,
      I am having issues with cd images attaching to the template created.
      I need this for the cloud-init configuration.
      There are 2 ways I try to accomplish that on freshly created Debian 10 template with cloud-init packages installed:

      1. I create new vm in XO and boot it. I stop it on grub level, then I attach my cd image with cloud-init user, meta and network data in XO, continue with the boot - cloud-init works as expected.

      2. I create vm in CLI:

      xe vm-install new-name-label=<vm_name> template=Debian10_cloud-init_template
      xe vm-cd-add vm=Debian10_cloud-init_template cd-name=nciso11.iso device=4
      xe vm-start vm=Debian10_cloud-init_template
      

      and cloud-init does not work, cd is not moutable as it says that there is noting to mount.

      Only difference I see is that when I create VM in XO I got two cd devices:

      CD 0 VBD:
      uuid ( RO)             : 7663f608-efdd-38e0-581a-87d2a21da3fc
          vm-name-label ( RO): Debian_10_cloud_init_template
                  empty ( RO): false
             userdevice ( RW): 3
      
      CD 0 VDI:
      uuid ( RO)             : 105c96fb-0d1f-4df3-bf6e-e8edf51ee78a
             name-label ( RW): nciso11.iso
          sr-name-label ( RO): ISO's
           virtual-size ( RO): 376832
      

      When I create it in CLI I have 3 fore some reason:

      CD 0 VBD:
      uuid ( RO)             : 3f18cca9-2630-0e2f-d146-ddd1f716ea65
          vm-name-label ( RO): Debian_10_cloud_init_template
                  empty ( RO): false
             userdevice ( RW): 4
      
      
      CD 0 VDI:
      uuid ( RO)             : 105c96fb-0d1f-4df3-bf6e-e8edf51ee78a
             name-label ( RW): nciso11.iso
          sr-name-label ( RO): ISO's
           virtual-size ( RO): 376832
      
      
      CD 1 VBD:
      uuid ( RO)             : d28e5090-4e2c-cbaf-fbab-4ccbdd54c3ca
          vm-name-label ( RO): Debian_10_cloud_init_template
                  empty ( RO): true
             userdevice ( RW): 3
      

      ... and then coud-init does not work as cd is not mountable - no media (???).

      Could someone explain to me why CLI creates additional and empty CD? Thanks!

      posted in Xen Orchestra
      M
      mietek