Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC for Azure Chef Extension cmdlet #10

Closed

Conversation

muktaa
Copy link

@muktaa muktaa commented Apr 25, 2014

No description provided.

Azure SDK has the cmdlet below to add an extension - Set-AzureVMExtension: https://github.com/Azure/azure-sdk-tools/blob/master/WindowsAzurePowershell/src/Commands.ServiceManagement/IaaS/Extensions/Common/SetAzureVMExtension.cs

The command can be used to add Chef extension, currently as:
$vmObj1 = Set-AzureVMExtension -VM $vmObj1 -ExtensionName ‘ChefAgent’ -Publisher ‘Chef.Azure’ -Version 11.6 -PublicConfigPath 'publicconfig.config' -PrivateConfigPath 'privateconfig.config'
Copy link

Choose a reason for hiding this comment

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

So we should also change the extension so that it can take additional params and make client.rb parameter optional:

  1. server url
  2. organization (may be blank for open source chef)
  3. validation client

You would have to specify at least one of server url or client.rb, and if you're using enterprise chef, you must specify 2. I believe #3 can be chosen from some sensible default. If you specify client.rb, 1,2, and 3 above would override anything in it.

Copy link

Choose a reason for hiding this comment

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

So I think params should include:

-client-rb
-validation-key
-runlist
-server-url
-server-url-generic
-organization

If you specify -server-url, you aren't allowed to specify -server-url-generic or -organization. -server-url is identical to --server-url with knife-azure. If you specify -server-url-generic, you specify the server url without the organization. Then -organization must be specified.

If -client-rb is specified, you don't have to specify serverurl, organization, or validation client. But if you do, the values of serverurl / organization and validation client will override whatever is in client.rb.

This lets people just specify a client-rb if they want, but also lets them fully automate using the cli args if they know what they are doing. And if they really want to, they can do both.

Choose a reason for hiding this comment

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

Please leverage PowerShell parameter sets and make the parameter names following the PS guideline. I can take a final look after you've updated the design.

@adamedx
Copy link

adamedx commented Apr 28, 2014

A good way to describe the cmdlet usage is something similar on content (not necessarily format) to the standard Azure help:

NAME
New-AzureVM

SYNOPSIS
Creates a new Windows Azure virtual machine.

SYNTAX
New-AzureVM -ServiceName -VMs <PersistentVM[]> [-AffinityGroup ] [-DeploymentLabel ]
[-DeploymentName ] [-DnsSettings <DnsServer[]>] [-Location ] [-ServiceDescription ]
[-ServiceLabel ] [-VNetName ] [-WaitForBoot] []

New-AzureVM [-DeploymentLabel <string>] [-DeploymentName <string>] [-DnsSettings <DnsServer[]>] [-ServiceName
<string>] [-VMs <PersistentVM[]>] [-VNetName <string>] [-WaitForBoot] [<CommonParameters>]

DESCRIPTION
The New-AzureVM cmdlet adds a new virtual machine to an existing Windows Azure service, or creates a new virtual
machine and service in the current subscription if either the -Location or -AffinityGroup is specified.

PARAMETERS
-AffinityGroup
Specifies the Windows Azure affinity group the cloud service will reside in. Only valid when creating a new
cloud service.

    Required?                    false
    Position?                    named
    Default value
    Accept pipeline input?       true (ByPropertyName)
    Accept wildcard characters?  false

-DeploymentLabel <string>
    Specifies a label for the deployment

    Required?                    false
    Position?                    named
    Default value
    Accept pipeline input?       true (ByPropertyName)
    Accept wildcard characters?  false

-DeploymentName <string>
    Specifies a deployment name. If not specified, the service name will be used as the deployment name.

    Required?                    false
    Position?                    named
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false

-DnsSettings <DnsServer[]>
    Specifies a DNS Server object that defines the DNS settings for the new deployment.

    Required?                    false
    Position?                    named
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false

### Set-ChefAzureVMExtension
Azure SDK has the cmdlet below to add an extension - Set-AzureVMExtension: https://github.com/Azure/azure-sdk-tools/blob/master/WindowsAzurePowershell/src/Commands.ServiceManagement/IaaS/Extensions/Common/SetAzureVMExtension.cs

The command can be used to add Chef extension, currently as:

Choose a reason for hiding this comment

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

This is the generic VM extension cmdlet we have which works for any extensions. We should have the Chef specific ones as I mentioned in my previous comment.

@muktaa
Copy link
Author

muktaa commented May 5, 2014

New-AzureVM -Location 'West US' -ServiceName $svc -VM $vmObj1

#### Params Supported

Copy link

Choose a reason for hiding this comment

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

So params should have a single "-'. Also, can switches have a '-' in the middle?

@thommay thommay added the invalid label Mar 4, 2015
@thommay
Copy link
Collaborator

thommay commented Mar 4, 2015

I'm not sure this needs to be an RFC. Given the age of this PR, can we just close it, and do any necessary work (assuming there's any left) as a PR for knife-azure? (cc @adamedx )

@muktaa
Copy link
Author

muktaa commented Mar 4, 2015

Closing the PR..

@muktaa muktaa closed this Mar 4, 2015
@jkeiser jkeiser reopened this Mar 4, 2015
@jkeiser
Copy link
Contributor

jkeiser commented Mar 4, 2015

Um, I don't know how that happened. huboard / waffle perhaps?

@jkeiser jkeiser closed this Mar 4, 2015
@muktaa
Copy link
Author

muktaa commented Mar 5, 2015

@NimishaS - fyi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants