[JIRA] (JENKINS-59752) Add support for ephemeral OS disk

0 views
Skip to first unread message

scherer_stefan@icloud.com (JIRA)

unread,
Oct 11, 2019, 11:40:02 AM10/11/19
to jenkinsc...@googlegroups.com
Stefan Scherer created an issue
 
Jenkins / Improvement JENKINS-59752
Add support for ephemeral OS disk
Issue Type: Improvement Improvement
Assignee: Azure DevOps
Components: azure-vm-agents-plugin
Created: 2019-10-11 15:39
Priority: Minor Minor
Reporter: Stefan Scherer

Recently, Microsoft introduced the concept of Ephemeral OS disk for certain types of VMs.  An Ephemeral OS disk is stored on local storage and is therefore faster and free, but it is not persistent.  It is therefore only used in situations where the VM is based on an image and every time it is started the OS disk will get “regenerated” from the generalized image and any changes made to the OS disk (C will be lost if the VM moves to another host or is reallocated.   

https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks

 
This would be super helpful for ephemeral Jenkins agents to have the best performance like the temporary disk (D and have no cost for this disk.

What I can see it's only a small change in the json. The diffDiskSettings with option Local seems to be the key.
Machine sizes must be big enough to carry the disk image (127 GB for Windows from Marketplace) in their cache.

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "virtualMachines_redacted_name": {
            "defaultValue": "redacted",
            "type": "String"
        },
        "redacted_externalid": {
            "defaultValue": "/subscriptions/redacted/resourceGroups/PackerImages/providers/Microsoft.Compute/images/redacted",
            "type": "String"
        },
        "disks_redacted_disk1_externalid": {
            "defaultValue": "/subscriptions/redacted/resourceGroups/ci-docker-com/providers/Microsoft.Compute/disks/redacted",
            "type": "String"
        },
        "networkInterfaces_redacted41_externalid": {
            "defaultValue": "/subscriptions/redacted/resourceGroups/ci-docker-com/providers/Microsoft.Network/networkInterfaces/redacted",
            "type": "String"
        }
    },
    "variables": {},
    "resources": [
        {
            "type": "Microsoft.Compute/virtualMachines",
            "apiVersion": "2019-03-01",
            "name": "[parameters('virtualMachines_redacted_name')]",
            "location": "westus",
            "properties": {
                "hardwareProfile": {
                    "vmSize": "Standard_D4s_v3"
                },
                "storageProfile": {
                    "imageReference": {
                        "id": "[parameters('redacted_externalid')]"
                    },
                    "osDisk": {
                        "osType": "Windows",
                        "diffDiskSettings": {
                            "option": "Local"
                        },
                        "name": "[concat(parameters('virtualMachines_redacted_name'), '_disk1_')]",
                        "createOption": "FromImage",
                        "caching": "ReadOnly",
                        "managedDisk": {
                            "storageAccountType": "Standard_LRS",
                            "id": "[parameters('disks_redacted_disk_externalid')]"
                        },
                        "diskSizeGB": 30
                    },
                    "dataDisks": []
                },
                "osProfile": {
                    "computerName": "[parameters('virtualMachines_redacted_name')]",
                    "adminUsername": "docker",
                    "windowsConfiguration": {
                        "provisionVMAgent": true,
                        "enableAutomaticUpdates": true
                    },
                    "secrets": [],
                    "allowExtensionOperations": true
                },
                "networkProfile": {
                    "networkInterfaces": [
                        {
                            "id": "[parameters('networkInterfaces_redacted41_externalid')]"
                        }
                    ]
                },
                "diagnosticsProfile": {
                    "bootDiagnostics": {
                        "enabled": true,
                        "storageUri": "https://cidockercomdiag.blob.core.windows.net/"
                    }
                }
            }
        }
    ]
}

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

scherer_stefan@icloud.com (JIRA)

unread,
Oct 11, 2019, 11:43:04 AM10/11/19
to jenkinsc...@googlegroups.com
Stefan Scherer updated an issue
Change By: Stefan Scherer
Recently, Microsoft introduced the concept of [Ephemeral OS disk|https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks] for certain types of VMs.  An Ephemeral OS disk is stored on local storage and is therefore faster and free, but it is not persistent.  It is therefore only used in situations where the VM is based on an [image|https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource] and every time it is started the OS disk will get “regenerated” from the generalized image and any changes made to the OS disk (C:) will be lost if the VM moves to another host or is reallocated.   

[https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks]

 
This would be super helpful for ephemeral Jenkins agents to have the best performance like the temporary disk (D:) and have no cost for this disk.


What I can see it's only a small change in the json. The diffDiskSettings with option Local seems to be the key.
Machine sizes must be big enough to carry the disk image (127 GB for Windows from Marketplace) in their cache.

{code}
{code}

 

scherer_stefan@icloud.com (JIRA)

unread,
Oct 11, 2019, 11:46:03 AM10/11/19
to jenkinsc...@googlegroups.com
Stefan Scherer updated an issue
Recently, Microsoft introduced the concept of [Ephemeral OS disk|https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks] for certain types of VMs.  An Ephemeral OS disk is stored on local storage and is therefore faster and free, but it is not persistent.  It is therefore only used in situations where the VM is based on an [image|https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource] and every time it is started the OS disk will get “regenerated” from the generalized image and any changes made to the OS disk (C: ) will be lost if the VM moves to another host or is reallocated.   

[https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks]

 
This would be super helpful for ephemeral Jenkins agents to have the best performance like the temporary disk (D: ) and have no cost for this disk.

What I can see it's only a small change in the json. The diffDiskSettings with option Local seems to be the key.
Machine sizes must be big enough to carry the disk image (127 GB for Windows from Marketplace) in their cache.

{code}
{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "virtualMachines_redacted_name": {
            "defaultValue": "redacted",
            "type": "String"
        },
        "redacted_externalid": {
            "defaultValue": "/subscriptions/redacted/resourceGroups/PackerImages/providers/Microsoft.Compute/images/redacted",
            "type": "String"
        },
        "disks_redacted_disk1_externalid": {
            "defaultValue": "/subscriptions/redacted/resourceGroups/ ci-docker-com redacted /providers/Microsoft.Compute/disks/redacted",
            "type": "String"
        },
        "networkInterfaces_redacted41_externalid": {
            "defaultValue": "/subscriptions/redacted/resourceGroups/
ci-docker-com redacted /providers/Microsoft.Network/networkInterfaces/redacted",
                    "adminUsername": " docker adminuser ",

                    "windowsConfiguration": {
                     "provisionVMAgent": true,
                     "enableAutomaticUpdates": true
                    },
                    "secrets": [],
                    "allowExtensionOperations": true
                },
                "networkProfile": {
                    "networkInterfaces": [
                     {
                     "id": "[parameters('networkInterfaces_redacted41_externalid')]"
                     }
                    ]
                },
                "diagnosticsProfile": {
                    "bootDiagnostics": {
                     "enabled": true,
                     "storageUri": "https:// cidockercomdiag redacted .blob.core.windows.net/"
                    }
                }
            }
        }
    ]
}
{code}

 

jieshe@microsoft.com (JIRA)

unread,
Oct 11, 2019, 11:59:02 PM10/11/19
to jenkinsc...@googlegroups.com
Jie Shen assigned an issue to Jie Shen
Change By: Jie Shen
Assignee: Azure DevOps Jie Shen

jieshe@microsoft.com (JIRA)

unread,
Oct 12, 2019, 12:00:02 AM10/12/19
to jenkinsc...@googlegroups.com
Jie Shen commented on Improvement JENKINS-59752
 
Re: Add support for ephemeral OS disk

This should be useful in some cases.

scherer_stefan@icloud.com (JIRA)

unread,
Nov 2, 2019, 11:36:03 AM11/2/19
to jenkinsc...@googlegroups.com

Found a promising fork https://github.com/jenkinsci/azure-vm-agents-plugin/compare/dev...rittneje:azure-agent-os-type that adds ephemeralOSDisk and managedDiskStorageAccountType, but needs some more adjustments for all json templates.
I can try to help here.
The relevant part is diffDiskSetting = Local and caching = ReadOnly.

scherer_stefan@icloud.com (JIRA)

unread,
Nov 2, 2019, 11:39:02 AM11/2/19
to jenkinsc...@googlegroups.com
Stefan Scherer edited a comment on Improvement JENKINS-59752
Found a promising fork [https://github.com/jenkinsci/azure-vm-agents-plugin/compare/dev...rittneje:azure-agent-os-type] that adds ephemeralOSDisk and managedDiskStorageAccountType, but needs some more adjustments for all json templates and probably changes for deprovision() as no disk has to be deleted .

I can try to help here.
The relevant part is diffDiskSetting = Local  and caching = ReadOnly.

scherer_stefan@icloud.com (JIRA)

unread,
Nov 2, 2019, 11:44:02 AM11/2/19
to jenkinsc...@googlegroups.com
Stefan Scherer updated an issue
Change By: Stefan Scherer
Recently, Microsoft introduced the concept of [Ephemeral OS disk|https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks] for certain types of VMs.  An Ephemeral OS disk is stored on local storage and is therefore faster and free, but it is not persistent.  It is therefore only used in situations where the VM is based on an [image|https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource] and every time it is started the OS disk will get “regenerated” from the generalized image and any changes made to the OS disk (C: ) will be lost if the VM moves to another host or is reallocated.   

[https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks]

 
This would be super helpful for ephemeral Jenkins agents to have the best performance like the temporary disk (D: ) and have no cost for this disk.

What I can see it's only a small change in the json. The diffDiskSettings with option Local seems to be the key.
Machine sizes must be big enough to carry the disk image (127 GB for Windows from Marketplace) in their cache. Or use one of the smalldisk images (30 GB) and set the diskSizeGB to 100 GB for a Standard_D4s_v3.

{code}
{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "virtualMachines_redacted_name": {
            "defaultValue": "redacted",
            "type": "String"
        },
        "redacted_externalid": {
            "defaultValue": "/subscriptions/redacted/resourceGroups/PackerImages/providers/Microsoft.Compute/images/redacted",
            "type": "String"
        },
        "disks_redacted_disk1_externalid": {
            "defaultValue": "/subscriptions/redacted/resourceGroups/redacted/providers/Microsoft.Compute/disks/redacted",
            "type": "String"
        },
        "networkInterfaces_redacted41_externalid": {
            "defaultValue": "/subscriptions/redacted/resourceGroups/redacted/providers/Microsoft.Network/networkInterfaces/redacted",
                    "adminUsername": "adminuser",

                    "windowsConfiguration": {
                     "provisionVMAgent": true,
                     "enableAutomaticUpdates": true
                    },
                    "secrets": [],
                    "allowExtensionOperations": true
                },
                "networkProfile": {
                    "networkInterfaces": [
                     {
                     "id": "[parameters('networkInterfaces_redacted41_externalid')]"
                     }
                    ]
                },
                "diagnosticsProfile": {
                    "bootDiagnostics": {
                     "enabled": true,
                     "storageUri": "https://redacted.blob.core.windows.net/"
                    }
                }
            }
        }
    ]
}
{code}

 

jieshe@microsoft.com (JIRA)

unread,
Nov 3, 2019, 8:28:03 PM11/3/19
to jenkinsc...@googlegroups.com
Jie Shen commented on Improvement JENKINS-59752
 
Re: Add support for ephemeral OS disk

Thanks for your contribution Stefan Scherer. Feel free to ask me(gavinfish) to review your PR when you are ready.

bradley.wangia@gmail.com (JIRA)

unread,
Nov 14, 2019, 11:13:03 AM11/14/19
to jenkinsc...@googlegroups.com

Stefan Scherer this would be nice to have for many of my workloads. Was that fork useful in crafting a PR?

 

scherer_stefan@icloud.com (JIRA)

unread,
Nov 16, 2019, 4:10:04 PM11/16/19
to jenkinsc...@googlegroups.com

Bradley Wangia that fork is useful to see how to do it, but for general use it should be extended to all json templates.
I'm not currently working on it, so if you have time, feel free to draft a PR.
But I'm still interested in that feature, just in my backlog for things to do...

bradley.wangia@gmail.com (JIRA)

unread,
Nov 19, 2019, 5:04:02 PM11/19/19
to jenkinsc...@googlegroups.com

bradley.wangia@gmail.com (JIRA)

unread,
Nov 25, 2019, 10:06:06 AM11/25/19
to jenkinsc...@googlegroups.com

bradley.wangia@gmail.com (JIRA)

unread,
Nov 25, 2019, 10:06:06 AM11/25/19
to jenkinsc...@googlegroups.com
Bradley Wangia started work on Improvement JENKINS-59752
 
Change By: Bradley Wangia
Status: Open In Progress

bradley.wangia@gmail.com (JIRA)

unread,
Nov 25, 2019, 10:09:02 AM11/25/19
to jenkinsc...@googlegroups.com
 
Re: Add support for ephemeral OS disk

Jie Shen  I saw you approved/merged my PR into dev ...

  • Is there a release process/schedule?
  • Anything I need to do to this ticket to get it into the next release?

jieshe@microsoft.com (JIRA)

unread,
Nov 25, 2019, 10:11:04 PM11/25/19
to jenkinsc...@googlegroups.com
Jie Shen commented on Improvement JENKINS-59752

Bradley Wangia thanks for your contribution here! I have released this feature in the version of 1.3.0.

jieshe@microsoft.com (JIRA)

unread,
Nov 25, 2019, 10:12:04 PM11/25/19
to jenkinsc...@googlegroups.com
Change By: Jie Shen
Status: In Review Resolved
Resolution: Done
Released As: 1.3.0

scherer_stefan@icloud.com (JIRA)

unread,
Nov 26, 2019, 12:49:02 AM11/26/19
to jenkinsc...@googlegroups.com
Stefan Scherer commented on Improvement JENKINS-59752
 
Re: Add support for ephemeral OS disk

Thanks Bradley Wangia for your PR. And thanks Jie Shen for the new release. I planned to compile it and run some tests, but now it's even simpler to give this feature a try today.

bradley.wangia@gmail.com (JIRA)

unread,
Nov 26, 2019, 10:46:03 AM11/26/19
to jenkinsc...@googlegroups.com
Bradley Wangia assigned an issue to Bradley Wangia
 
Change By: Bradley Wangia
Assignee: Jie Shen Bradley Wangia
Reply all
Reply to author
Forward
0 new messages