Skip to content

Updating & enhancing Service Fabric cmdlets to facilitate Ubuntu 18 & Linux OS migration scenarios.#14437

Merged
wyunchi-ms merged 13 commits intoAzure:masterfrom
maburlik:master
Mar 13, 2021
Merged

Updating & enhancing Service Fabric cmdlets to facilitate Ubuntu 18 & Linux OS migration scenarios.#14437
wyunchi-ms merged 13 commits intoAzure:masterfrom
maburlik:master

Conversation

@maburlik
Copy link
Copy Markdown
Contributor

@maburlik maburlik commented Mar 4, 2021

Description

  • Add parameters to Add-AzServiceFabricNodeType to facilitate easy alternate OS image creation for new node type.
    Parameters: VMImagePublisher, VMImageOffer, VMImageSku, VMImageVersion
    • Example usage: For a Ubuntu 16.04 cluster, add a new Ubuntu 18 node type:
    $resouceGroup="Group1"
    $clusterName="Contoso01SFCluster"
    $nodeTypeName="nt2"
    $securePassword = ConvertTo-SecureString -String 'Password$123456' -AsPlainText -Force
    
    Add-AzServiceFabricNodeType -ResourceGroupName $resouceGroup  -ClusterName $clusterName -NodeType $nodeTypeName -Capacity 5 -VmUserName adminuser -VmPassword $securePassword -DurabilityLevel Silver -Verbose -VMImageSku 18.04-LTS
  • Add parameter IsPrimaryNodeType to Add-AzServiceFabricNodeType to be able to create an additional primary node type,
    for the purpose of transitioning the primary node type to another one in the case of OS migration.
  • Add-AzServiceFabricNodeType now correctly copies the LinuxDiagnostic extension. This was previously not working for Linux.
  • Add-AzServiceFabricNodeType now correctly copies the RDP/SSH load balancer inbound NAT port mapping to the new node type.
  • Add template for UbuntuServer1804 for creating Ubuntu 18.04 clusters using New-AzServiceFabricCluster.
  • Remove-AzServiceFabricNodeType was incorrectly blocking Bronze durability node types for removal, and this has been updated
    to only block when the Bronze durability level differs between the SF node type and VMSS setting.
  • Added cmdlet Update-AzServiceFabricVmImage to update the delivered SF runtime package type. This must be changed when migrating from Ubuntu 16 to 18.
  • Added cmdlet Update-AzServiceFabricNodeType to update the properties of a cluster node type. For now this is solely used to update whether the node type is primary via bool parameter -IsPrimaryNodeType $false.
  • Update-AzServiceFabricReliability is now able to update reliability level when the cluster has more than one primary node type.
    To do this, the name of the node type is supplied via the new -NodeType parameter.

Checklist

  • [ x ] I have read the Submitting Changes section of CONTRIBUTING.md
  • [ x ] The title of the PR is clear and informative
  • [ x ] The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • [ x ] The PR does not introduce breaking changes
  • [ x ] If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
      • {Please put the link here}
    • the markdown help files have been regenerated using the commands listed here

@maburlik maburlik requested a review from a-santamaria March 4, 2021 22:29
/// <summary>
/// VmImage sets the Service Fabric runtime package delivery hint for the cluster, which results in dropping the appropriately-mapped package for the VM image OS.
/// Accepted values: Windows, Linux, Ubuntu, Ubuntu18_04
/// Note: Linux & Ubuntu both map to Ubuntu 16.04
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have both Linux and ubuntu if they are both 16.04?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. This is how it is in SFRP, and some existing ARM templates may have either in the ARM template, but both are accepted.

throw new PSInvalidOperationException(ServiceFabricProperties.Resources.NodeTypesNotDefinedInCluster);
}

if (PatchRequired(existingNodeType))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might want to check that at least one primary node type is left if changing to false

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SFRP would reject this logic right? This is obviously something that should be validated out, but is business logic supposed to be handled in this step? I would say yes if modifying node type involved updating multiple ARM resources i.e. VMSS, SF, Networking components since Az PS is the actor that modifies multiple components so would assume managing staggered requests via validation & state. In this case the singular request is sent to SFRP.

@wyunchi-ms
Copy link
Copy Markdown
Contributor

TestAddAzureRmServiceFabricNodeType fails, please rerecord it.

@maburlik
Copy link
Copy Markdown
Contributor Author

TestAddAzureRmServiceFabricNodeType fails, please rerecord it.

Working on this.

@wyunchi-ms
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@wyunchi-ms
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@wyunchi-ms wyunchi-ms merged commit 2083cd2 into Azure:master Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants