Centos System Disk Partition help

Hey Guys, Ive just deployed a VM for Centos from Azure market place, but it seems like that the OS disk by default is 30GB, and I want to be able to use the whole partition.

This is what I am trying to achieve in ansible:

1: Delete the 30GB default partition
2: Create a new partition with 100GB or more
3: Extend the xfs

How can the above be achieved using ansible?

Thanks

Some food for thought …

  1. Why deploy CentOS? The Red Hat down stream product is end of existence in July 2024

  2. Did you search for azure modules on the ansible website?

If you have code you want reviewed post it.

Some food for thought ...

Why deploy CentOS? The Red Hat down stream product is end of existence in July 2024

See https://www.centos.org/centos-linux-eol/
See https://blog.centos.org/2020/12/future-is-centos-stream/

This is misleading. CentOS 8 Stream will continue to exist. CentOs 8
Stream is not as reliable for *anything* s because it declines to
publish point releases, the same stunt Red Hat pulled with Red Hat 9
nearly 20 years ago, and reverted within a few years with RHEL 2.6 or
so releases. It also uses the CentOS community as beta testers for new
RHEL code, before it's been published in RHEL. This is a bit of a
betrayal of CentOS original goals but was decided without input from
the CentOS community, behind closed doors at Red Hat.

Kind of like the labeling of the ansible-core/ansible_collections
split, it's created a lot of unnecessary confusion and caused people
to have to do various things backwards from the vendor published
guideline. It's also lead to Karanbir Singh resigning from his
leadership of CentOS, and the advent of AlmaLinux and RockyLinux to
take CentOS's place as a reliable downstream rebuild of RHEL. It's not
the first time, I remember Whitebox and Scientific Linux being similar
rebulds. We'll see what happens in a few years.

Did you search for azure modules on the ansible website?

https://docs.ansible.com/ansible/2.9/modules/azure_rm_manageddisk_module.html#azure-rm-manageddisk-module
https://docs.ansible.com/ansible/2.9/modules/azure_rm_virtualmachine_module.html#azure-rm-virtualmachine-module

If you have code you want reviewed post it.

Hey Guys, Ive just deployed a VM for Centos from Azure market place, but it seems like that the OS disk by default is 30GB, and I want to be able to use the whole partition.

VM images don't contain disks. They contain partition tables, and file
systems. Most Azure VMs come with more built-in disk, the partitions
and filesystems merely need to be expanded to fill the remaining
space.

This is what I am trying to achieve in ansible:

1: Delete the 30GB default partition

That has the OS on it, live. Not likely to work witthout serious
connivance. Try "expand partitions to occupy remaining space.

2: Create a new partition with 100GB or more

Expand any LVM based physical volumes to use remaining space.
Then expand any relevant LVM logical volumes to use that allocated
physical volume.

3: Extend the xfs

Yup, that's still needed.

How can the above be achieved using ansible?

Even if there's not a specific ansible module, it can be shell
scripted to your particular needs.

CentOS as a downstream feed from Red Hat is dead.
CentOS Stream is an upstream feed that sits between Fedora and Red Hat, and as such is not stable.
AlmaLinux and Rocky Linux both want to be replacements for CentOS. The marketplace will choose.

For US Government installations, it none of this matters. FIPS validated encryption (with a FIPS certificate issued to the vendor) is a requirement (SSH, HTTPS, AD, SLDAP, etc). Only Red Hat and Ubuntu Pro provide that.