code: @Nonnull
      @Override
      public AffinityGroup create(@Nonnull AffinityGroupCreateOptions options) throws InternalException, CloudException {
  
          if(options == null || options.getName() == null)
              throw new InternalException("Cannot create AffinityGroup. Create options or affinity group name cannot be null.");
  
          CreateAffinityGroupModel createAffinityGroupModel = new CreateAffinityGroupModel();
          createAffinityGroupModel.setName(options.getName());
          createAffinityGroupModel.setDescription(options.getDescription());
          createAffinityGroupModel.setLocation(provider.getContext().getRegionId());
          createAffinityGroupModel.setLabel(new String(Base64.encodeBase64(options.getName().getBytes())));
  
          AzureMethod azureMethod = new AzureMethod(this.provider);
  
          try {
              azureMethod.post(RESOURCE_AFFINITYGROUPS, createAffinityGroupModel);
          }
          catch (JAXBException e)
          {
              logger.error(e.getMessage());
              throw new InternalException(e);
          }
  
          return AffinityGroup.getInstance(createAffinityGroupModel.getName(),
                  createAffinityGroupModel.getName(),
                  createAffinityGroupModel.getDescription(),
                  createAffinityGroupModel.getLocation(), null);
      }
docs: Creates an affinity group in the cloud
  
  @param options the options used when creating the affinity group
  @return the provider ID of the affinity group
  @throws org.dasein.cloud.InternalException an error occurred within the Dasein Cloud implementation creating the affinity group
  @throws org.dasein.cloud.CloudException    an error occurred within the service provider creating the affinity group