Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Software] Cloud Image : Cloud-init and disk resize

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
VisokABT
Posts: 5
Joined: 2023-04-27 12:46

[Software] Cloud Image : Cloud-init and disk resize

#1 Post by VisokABT »

Hello,
I have a project to create Debian VMs automatically on my Nutanix cluster (KVM based) with Terraform.
For this, I use the latest version of the Debian cloud image: https://cloud.debian.org/images/cloud/b ... 0124-1270/ = debian-11-generic-amd64-20230124-1270.qcow2
I created my VM with a cloud-init file in order to set up : my users, my keyboard, my language, my network...

But, I have several problems:
  • Only users settings, server name setting, package installation works with my cloud-init file. Network settings, keyboard and my language doesn't change (My file works with Ubuntu)
  • I also want to increase my disk space. But if I increase it and reboot my machine, it crashes on the error:

    Code: Select all

    Kernel Offset: 0xa00000 from 0xffffffff81000000 (relocation range: 0xffffff80000000-0xffffffbfffff)
    end Kernel panic - not syncing: Attempted to kill init! exit code=0x00000200
    If I want to avoid this, I have to increase partition before rebooting with fdisk which itself gives me errors when it opens:

    Code: Select all

    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    The old ext4 signature will be removed by a write command.
    Device does not contain a recognized partition table.
    Created a new DOS disklabel with disk identifier 0x42d621c4.
    
All my processes work with Ubuntu. I have tested with several versions of Debian 11, in RAW, in qcow2, I have also tested in Debian 10.

Are there any known bugs? Is there a way to solve my problems.

Thank you in advance for your answers.

Have a good day

Aki
Global Moderator
Global Moderator
Posts: 2816
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 68 times
Been thanked: 382 times

Re: [Software] Cloud Image : Cloud-init and disk resize

#2 Post by Aki »

Hello,
VisokABT wrote: 2023-05-05 07:33 But, I have several problems:
  • Only users settings, server name setting, package installation works with my cloud-init file. Network settings, keyboard and my language doesn't change (My file works with Ubuntu)
What is the Debian version of the host you are running cloud-init ?

Have you tested your cloud-init configuration files locally (on your computer) ? Can you share them ?

What is the cloud-init version you are using ?
VisokABT wrote: 2023-05-05 07:33
  • I also want to increase my disk space. But if I increase it and reboot my machine, it crashes on the error:

    Code: Select all

    Kernel Offset: 0xa00000 from 0xffffffff81000000 (relocation range: 0xffffff80000000-0xffffffbfffff)
    end Kernel panic - not syncing: Attempted to kill init! exit code=0x00000200
    If I want to avoid this, I have to increase partition before rebooting with fdisk which itself gives me errors when it opens:

    Code: Select all

    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    The old ext4 signature will be removed by a write command.
    Device does not contain a recognized partition table.
    Created a new DOS disklabel with disk identifier 0x42d621c4.
    
[..]
Generally speaking, resizing disk images usually requires updating the partitioning scheme and the file system configuration. If you don't do it, the disk contents are corrupted and this could lead to the errors you reported in the previous message.

What are the commands you used to resize cow2 images ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

VisokABT
Posts: 5
Joined: 2023-04-27 12:46

Re: [Software] Cloud Image : Cloud-init and disk resize

#3 Post by VisokABT »

cloud-init.zip
Cloud-init logs
(13.78 KiB) Downloaded 58 times
Hello,
I test my cloud-init by making a new VM with the insertion of my user-data with terraform.

I take the debian 11 image: debian-11-generic-amd64-20230124-1270.qcow2 with cloud-init version 20.4.1.

This is my cloud-init file :

Code: Select all

#cloud-config
users:
  - name: sfcs
    gecos: SFCS Team
    passwd: "pass(sha-512)"
    lock_passwd: false
    shell: /bin/bash
    sudo: ALL=(ALL) NOPASSWD:ALL

ssh_pwauth: True

resize_rootfs: True # not working
growpart: # not working
  mode: auto # not working
  devices: # not working
    - "/" # not working

hostname: TEST-POC-ABT
locale: fr_FR.UTF-8 # not working
keyboard:	# not working
  layout: fr# not working

package_update: true
package_upgrade: true
packages:
  - nginx

runcmd:
  - echo "vm.swappiness = 10" >> /etc/sysctl.conf
Attached are the cloud init logs on the vm.

I am a beginner on cloud-init

VisokABT
Posts: 5
Joined: 2023-04-27 12:46

Re: [Software] Cloud Image : Cloud-init and disk resize

#4 Post by VisokABT »

Hello,
After several tests, I see that the increase in disk space works. But I have to restart the virtual machine twice to increase its disk.
The first one which crashes on the Kernel error, and another one to restore the VM.
Is this normal? I'm on a Nutanix infrastructure based on KVM
thanks

CwF
Global Moderator
Global Moderator
Posts: 2625
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 190 times

Re: [Software] Cloud Image : Cloud-init and disk resize

#5 Post by CwF »

VisokABT wrote: 2023-05-16 14:20 I'm on a Nutanix
I'm not familiar
VisokABT wrote: 2023-05-16 14:20 based on KVM
I usually would use virt-resize, executed on the host with the guest OFF.

VisokABT
Posts: 5
Joined: 2023-04-27 12:46

Re: [Software] Cloud Image : Cloud-init and disk resize

#6 Post by VisokABT »

Hello,
I'm updating this message.
When I boot the VM after resizing the disk, there is a kernel error. But when I restart the VM a second time, it successfully restarts with my new disk size.
Any ideas?

Aki
Global Moderator
Global Moderator
Posts: 2816
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 68 times
Been thanked: 382 times

Re: [Software] Cloud Image : Cloud-init and disk resize

#7 Post by Aki »

Hello,
VisokABT wrote: 2023-05-26 08:40 When I boot the VM after resizing the disk, there is a kernel error. But when I restart the VM a second time, it successfully restarts with my new disk size. Any ideas?
How do you resize your disk images (individual commands) ?
Have you followed @CwF advice in the previous post about virt-resize command ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

VisokABT
Posts: 5
Joined: 2023-04-27 12:46

Re: [Software] Cloud Image : Cloud-init and disk resize

#8 Post by VisokABT »

Hello,
I changed the setting on the Nutanix interface and restarted the VM to apply the resizing.
But on the first restart it crashes and on the second restart my VM is resized.

Post Reply