diff --git a/bosh-stemcell/lib/bosh/stemcell/infrastructure.rb b/bosh-stemcell/lib/bosh/stemcell/infrastructure.rb index b7c0c97b5c..f94eb323ca 100644 --- a/bosh-stemcell/lib/bosh/stemcell/infrastructure.rb +++ b/bosh-stemcell/lib/bosh/stemcell/infrastructure.rb @@ -188,7 +188,14 @@ def initialize end def additional_cloud_properties - {'root_device_name' => '/dev/sda1'} + { + 'root_device_name' => '/dev/sda1', + 'generation' => 'gen2', + 'accelerated_networking' => true, + 'hibernation' => true, + 'disk_controller_types' => ['scsi', 'nvme'], + 'security_type' => 'TrustedLaunchSupported' + } end end diff --git a/bosh-stemcell/spec/assets/dpkg-list-ubuntu-azure-additions.txt b/bosh-stemcell/spec/assets/dpkg-list-ubuntu-azure-additions.txt index d146a75161..39fbb77d61 100644 --- a/bosh-stemcell/spec/assets/dpkg-list-ubuntu-azure-additions.txt +++ b/bosh-stemcell/spec/assets/dpkg-list-ubuntu-azure-additions.txt @@ -1,3 +1,4 @@ +azure-vm-utils cloud-init netplan.io python-is-python3 diff --git a/bosh-stemcell/spec/bosh/stemcell/infrastructure_spec.rb b/bosh-stemcell/spec/bosh/stemcell/infrastructure_spec.rb index f661728449..dbb49d7632 100644 --- a/bosh-stemcell/spec/bosh/stemcell/infrastructure_spec.rb +++ b/bosh-stemcell/spec/bosh/stemcell/infrastructure_spec.rb @@ -162,7 +162,14 @@ module Bosh::Stemcell it { should eq Infrastructure.for('azure') } it 'has azure specific additional cloud properties' do - expect(subject.additional_cloud_properties).to eq({'root_device_name' => '/dev/sda1'}) + expect(subject.additional_cloud_properties).to eq({ + 'root_device_name' => '/dev/sda1', + 'generation' => 'gen2', + 'accelerated_networking' => true, + 'hibernation' => true, + 'disk_controller_types' => ['scsi', 'nvme'], + 'security_type' => 'TrustedLaunchSupported' + }) end end diff --git a/stemcell_builder/stages/image_install_grub/apply.sh b/stemcell_builder/stages/image_install_grub/apply.sh index d085dbf2c0..f65b430295 100755 --- a/stemcell_builder/stages/image_install_grub/apply.sh +++ b/stemcell_builder/stages/image_install_grub/apply.sh @@ -73,6 +73,11 @@ case "${stemcell_infrastructure}" in aws) grub_suffix="nvme_core.io_timeout=4294967295" ;; +azure) + # For NVMe storage, Microsoft recommends setting nvme_core.io_timeout to 240 seconds + # to avoid IO timeouts and let Azure handle disk failures or interruptions. + grub_suffix="nvme_core.io_timeout=240" + ;; cloudstack) grub_suffix="console=hvc0" ;; diff --git a/stemcell_builder/stages/system_azure_init/apply.sh b/stemcell_builder/stages/system_azure_init/apply.sh index 53c518bdfd..ac0f6f9a09 100755 --- a/stemcell_builder/stages/system_azure_init/apply.sh +++ b/stemcell_builder/stages/system_azure_init/apply.sh @@ -5,7 +5,7 @@ set -e base_dir=$(readlink -nf $(dirname $0)/../..) source $base_dir/lib/prelude_apply.bash -packages="python3 python3-pyasn1 python3-setuptools python3-distro python-is-python3 cloud-init" +packages="python3 python3-pyasn1 python3-setuptools python3-distro python-is-python3 cloud-init azure-vm-utils" pkg_mgr install $packages wala_release=2.9.1.1