lib/fog/azurerm/docs/compute.md in fog-azure-rm-0.3.3 vs lib/fog/azurerm/docs/compute.md in fog-azure-rm-0.3.4
- old
+ new
@@ -14,16 +14,16 @@
Next, create a connection to the Compute Service:
```ruby
azure_compute_service = Fog::Compute.new(
- provider: 'AzureRM',
- tenant_id: '<Tenantid>', # Tenant id of Azure Active Directory Application
- client_id: '<Clientid>', # Client id of Azure Active Directory Application
- client_secret: '<ClientSecret>', # Client Secret of Azure Active Directory Application
- subscription_id: '<Subscriptionid>', # Subscription id of an Azure Account
- :environment => '<AzureCloud/AzureChinaCloud/AzureUSGovernment/AzureGermanCloud>' # Azure cloud environment. Default is AzureCloud.
+ provider: 'AzureRM',
+ tenant_id: '<Tenantid>', # Tenant id of Azure Active Directory Application
+ client_id: '<Clientid>', # Client id of Azure Active Directory Application
+ client_secret: '<ClientSecret>', # Client Secret of Azure Active Directory Application
+ subscription_id: '<Subscriptionid>', # Subscription id of an Azure Account
+ environment: '<AzureCloud/AzureChinaCloud/AzureUSGovernment/AzureGermanCloud>' # Azure cloud environment. Default is AzureCloud.
)
```
## Check Server Existence
@@ -59,11 +59,12 @@
version: 'latest', # Not required if custom image is being used
platform: 'Linux',
vhd_path: '<Path of VHD>', # Optional, if you want to create the VM from a custom image.
custom_data: 'echo customData', # Optional, if you want to add custom data in this VM.
os_disk_caching: Fog::ARM::Compute::Models::CachingTypes::None, # Optional, can be one of None, ReadOnly, ReadWrite
- managed_disk_storage_type: Azure::ARM::Compute::Models::StorageAccountTypes::StandardLRS # Optional, can be StandardLRS or PremiumLRS
+ managed_disk_storage_type: Azure::ARM::Compute::Models::StorageAccountTypes::StandardLRS, # Optional, can be StandardLRS or PremiumLRS
+ os_disk_size: <Disk Size> # Optional, size of the os disk in GB (upto 1023)
)
```
Create a new windows server
@@ -83,12 +84,13 @@
offer: 'WindowsServerEssentials', # Not required if custom image is being used
sku: 'WindowsServerEssentials', # Not required if custom image is being used
version: 'latest', # Not required if custom image is being used
platform: 'Windows',
vhd_path: '<Path of VHD>', # Optional, if you want to create the VM from a custom image.
- custom_data: 'echo customData', # Optional, if you want to add custom data in this VM.
- managed_disk_storage_type: Azure::ARM::Compute::Models::StorageAccountTypes::StandardLRS # Optional, can be StandardLRS or PremiumLRS
+ custom_data: 'echo customData', # Optional, if you want to add custom data in this VM.
+ managed_disk_storage_type: Azure::ARM::Compute::Models::StorageAccountTypes::StandardLRS, # Optional, can be StandardLRS or PremiumLRS
+ os_disk_size: <Disk Size> # Optional, size of the os disk in GB (upto 1023)
)
```
## Create Server Asynchronously
@@ -112,11 +114,12 @@
version: 'latest', # Not required if custom image is being used
platform: 'Linux',
vhd_path: '<Path of VHD>', # Optional, if you want to create the VM from a custom image.
custom_data: 'echo customData', # Optional, if you want to add custom data in this VM.
os_disk_caching: Fog::ARM::Compute::Models::CachingTypes::None, # Optional, can be one of None, ReadOnly, ReadWrite
- managed_disk_storage_type: Azure::ARM::Compute::Models::StorageAccountTypes::StandardLRS # Optional, can be StandardLRS or PremiumLRS
+ managed_disk_storage_type: Azure::ARM::Compute::Models::StorageAccountTypes::StandardLRS, # Optional, can be StandardLRS or PremiumLRS
+ os_disk_size: <Disk Size> # Optional, size of the os disk in GB (upto 1023)
)
```
Following methods are available to handle async respoonse:
- state
- pending?
@@ -186,10 +189,26 @@
```ruby
server.detach_data_disk('<Disk Name>')
```
+## Attach a Managed Data Disk to Server
+
+Get the server object and attach a Data Disk to it.
+
+```ruby
+ server.attach_managed_disk('<Disk Name>', '<Disk Resource Group Name>')
+```
+
+## Detach a Managed Data Disk from Server
+
+Get the server object and detach a Data Disk from it.
+
+```ruby
+ server.detach_managed_disk('<Disk Name>')
+```
+
## Get a Server's status
Check the status of a Server
```ruby
@@ -318,17 +337,32 @@
```
## Create Managed Disk
-Create a new Managed Disk
+Create a new Premium Managed Disk
```ruby
azure_compute_service.managed_disks.create(
name: 'disk_name',
location: 'east us',
resource_group_name: 'resource_group_name',
account_type: 'Premium_LRS',
+ disk_size_gb: 1023,
+ creation_data: {
+ create_option: 'Empty'
+ }
+ )
+```
+
+Create a new Standard Managed Disk
+
+```ruby
+ azure_compute_service.managed_disks.create(
+ name: 'disk_name',
+ location: 'east us',
+ resource_group_name: 'resource_group_name',
+ account_type: 'Standard_LRS',
disk_size_gb: 1023,
creation_data: {
create_option: 'Empty'
}
)