azure-vm-agents-plugin icon indicating copy to clipboard operation
azure-vm-agents-plugin copied to clipboard

Can't add/create an UltraSSD_LRS in the VM

Open mattigot opened this issue 4 years ago • 3 comments

Version report

Jenkins and plugins versions report:

Jenkins: 2.293
OS: Linux - 4.14.13-perform
---
workflow-step-api:2.23
azure-sdk:12.vc102aedd3c66
pipeline-milestone-step:1.3.2
okhttp-api:3.14.9
pipeline-stage-tags-metadata:1.8.4
antisamy-markup-formatter:2.1
ldap:2.7
pipeline-model-extensions:1.8.4
pipeline-rest-api:2.19
maven-plugin:3.11
github-api:1.123
ws-cleanup:0.39
sshd:3.0.3
extended-read-permission:3.2
lockable-resources:2.10
jdk-tool:1.5
credentials-binding:1.24
mailer:1.34
ssh-slaves:1.31.7
bouncycastle-api:2.20
echarts-api:5.1.0-2
conditional-buildstep:1.4.1
popper-api:1.16.1-2
pipeline-input-step:2.12
htmlpublisher:1.25
gerrit-code-review:0.4.4
handlebars:3.0.8
matrix-project:1.18
workflow-multibranch:2.24
resource-disposer:0.15
trilead-api:1.0.13
gerrit-trigger:2.34.0
saferestart:0.3
pipeline-model-api:1.8.4
snakeyaml-api:1.27.0
github-branch-source:2.10.4
parameterized-trigger:2.40
pam-auth:1.6
javadoc:1.6
durable-task:1.36
command-launcher:1.6
throttle-concurrents:2.2
caffeine-api:2.9.1-23.v51c4e2c879c8
cloud-stats:0.27
azure-vm-agents:780.v50d067d02f76
plugin-util-api:2.2.0
azure-credentials:182.v3ccd4a755864
pipeline-model-definition:1.8.4
jquery3-api:3.6.0-1
timestamper:1.13
pipeline-build-step:2.13
pipeline-graph-analysis:1.10
azure-cli:0.9
windows-slaves:1.8
workflow-api:2.42
summary_report:1.15
workflow-support:3.8
github:1.33.1
workflow-scm-step:2.12
branch-api:2.6.4
workflow-basic-steps:2.23
build-timeout:1.20
authentication-tokens:1.4
git-server:1.9
font-awesome-api:5.15.3-2
workflow-aggregator:2.6
credentials:2.4.1
cloudbees-folder:6.15
jjwt-api:0.11.2-9.c8b45b8bb173
structs:1.23
run-condition:1.5
workflow-durable-task-step:2.39
checks-api:1.7.0
display-url-api:2.3.4
momentjs:1.1.1
ant:1.11
pipeline-stage-step:2.5
workflow-job:2.40
gradle:1.36
ace-editor:1.1
apache-httpcomponents-client-4-api:4.5.13-1.0
email-ext:2.82
copyartifact:1.46.1
workflow-cps-global-lib:2.19
git:4.7.1
scm-api:2.6.4
token-macro:2.15
job-dsl:1.77
junit:1.49
envinject:2.4.0
git-client:3.7.1
jsch:0.1.55.2
pipeline-github-lib:1.0
jackson2-api:2.12.3
pipeline-stage-view:2.19
plain-credentials:1.7
script-security:1.77
bootstrap4-api:4.6.0-3
ssh-credentials:1.18.2
matrix-auth:2.6.7
envinject-api:1.7
workflow-cps:2.92
  • What Operating System are you using (both controller, and any agents involved in the problem)?
Ubuntu 20.04

Reproduction steps

I am trying to add an ultra ssd disk to my vm.

  • use the azure vm agents plugin
  • configure the cloud template
  • use a Standard_F* series machine
  • Enable User Assigned Managed Identity(UAMI)

tried 2 things in the Initialization Script:

  1. Create new disk on the fly
  • az disk create --resource-group myrg --location mylocation--name myhost -disk --size-gb 1024 --sku UltraSSD_LRS --disk-iops-read-write 20000 --disk-mbps-read-write 2000 --os-type Linux --debug
  1. Use existing one
  • Create ultra ssd disk named test in the portal name mydisk
  • in the templates vm initialization script add:
    • diskId=$(az disk show -g myrg -n mydisk --query 'id' -o tsv)
    • az vm disk attach -g myrg --vm-name myhost --name $diskId

Results

Expected result:

create new disk or attach an existing one

Actual result:

when creating the new disk , i see it created in the portal, but the command hangs, and the VM creating gets stuck

when trying to attach an existing disk i get this error: "ERROR: (InvalidParameter) StorageAccountType UltraSSD_LRS can be used only when additionalCapabilities.ultraSSDEnabled is set."

it seems like additionalCapabilities.ultraSSDEnabled is not enabled in the VM

how can i add ultra ssd disk ?

thanks Matti

mattigot avatar Jun 15 '21 07:06 mattigot

Blocked by https://github.com/jenkinsci/azure-vm-agents-plugin/issues/248

Not possible currently, but contributions are welcome

timja avatar Jun 15 '21 07:06 timja

how complicate is it to do ? can you help guiding me with this? (never wrote in Jenkins plugins, and my Azure knowledge is minimal )

mattigot avatar Jun 15 '21 08:06 mattigot

the main complicated bit is the datadisk bit

general contribution guide:

https://github.com/jenkinsci/.github/blob/master/CONTRIBUTING.md#run-locally

UI is defined here: https://github.com/jenkinsci/azure-vm-agents-plugin/blob/master/src/main/resources/com/microsoft/azure/vmagent/AzureVMAgentTemplate/config.jelly

ARM templates are defined here: https://github.com/jenkinsci/azure-vm-agents-plugin/tree/master/src/main/resources

but I don't think you would need to change them, when it's an optional behaviour I recommend modifying the JSON Object in code, as otherwise you need to duplicate your change in like 5 places and realistically they aren't all going to be tested properly.

The json object is built up in https://github.com/jenkinsci/azure-vm-agents-plugin/blob/master/src/main/java/com/microsoft/azure/vmagent/AzureVMManagementServiceDelegate.java#L197

timja avatar Jun 15 '21 08:06 timja